Return to site

Cplot With Factors R

broken image


Creating a Factor. The command used to create or modify a factor in R language is – factor with a vector as input. The two steps to creating a factor are: Creating a vector; Converting the vector created into a factor using function factor Examples: Let us create a factor gender with levels female, male and transgender. Length of factor level names in splits. Default 0, meaning display the full factor names. Possible values are as varlen above, except that for back-compatibility with text.rpart the special value 1 means represent the factor levels with alphabetic characters (a for the first level, b for the second, etc.). This document describes how to plot estimates as forest plots (or dot whisker plots) of various regression models, using the plotmodel function. Plotmodel is a generic plot-function, which accepts many model-objects, like lm, glm, lme, lmerMod etc.

Question: Using biomaRt to convert gene symbols to entrez id in dataframe of gene-sets
2
2.7 years ago by

Hi

I have a large data frame of gene sets whose components are in the form of gene symbols. I'm trying to use biomaRt to convert these symbols into entrez IDs so that I can run the sets through MAGMA. However, I can't work out how to convert the data frame without destroying the structure of the gene sets. I always get a data frame just listing the the IDs of genes in my sets, which obviously isn't very useful for me. Can anyone help?

I thought this would work to preserve the headers of the original data frame but I still just get a list: Slots of vegas casino.

Thanks

ADD COMMENT • link • modified 18 months ago by zx8754 ♦ 9.9k • written 2.7 years ago by jack.bakewell • 20

Merge by gene symbols with your data frame. getBM function ouput is data frame with gene symbol and NCBI gene ID. Now merge both the data frames by gene symbol. If you do not know how to merge data frame, post example data here from big data frame.

ADD REPLY • link modified 2.7 years ago • written 2.7 years ago by cpad0112 ♦ 14k

Thanks! But yeah I don't know how to merge them by gene symbol. Can you direct me to any useful webpages or packages that teach this?

Mt data set looks like this:

But formatted by rows, the sets are a lot longer and there's about 1600 of them.

Thanks

ADD REPLY • link modified 2.7 years ago by GenoMax ♦ 95k • written 2.7 years ago by jack.bakewell • 20

could you please reformat your post, so that data frame can be clear? You can look at the merge examples here: https://www.statmethods.net/management/merging.html

ADD REPLY • link modified 2.7 years ago • written 2.7 years ago by cpad0112 ♦ 14k

Looks like genomax reformatted it for me. Thanks genomax

ADD REPLY • link written 2.7 years ago by jack.bakewell • 20

For future posts: you can do this formatting by selecting the text and clicking the 101010 button. When you compose or edit a post that button is in your toolbar, see image below:

Plot With Factors Reading

ADD REPLY • link written 2.7 years ago by WouterDeCoster ♦ 45k

I am assuming every row has different number of genes?

ADD REPLY • link written 2.6 years ago by zx8754 ♦ 9.9k

Hi

I am new to this R and Bioinformatics game. I tried using the code posted by cpad0112 with my dataset and got the following error.

I think I have found a workaround using 'list attributes' to find alternative attributes but would appreciate it somebody could confirm what attribute people use in place of hngc_symbol or correct any errors in my code.

Plot With Factors Ratios

thanks

Peter

ADD REPLY • link modified 18 months ago by GenoMax ♦ 95k • written 18 months ago by peter.berry5 • 20

Cplot With Factors R

Please use ADD COMMENT/ADD REPLY when responding to existing posts to keep threads logically organized.SUBMIT ANSWER is for new answers to original question.

Factors

Plot With Factors Ratio

ADD REPLY • link written 18 months ago by GenoMax ♦ 95k




broken image