Question: How to extract fold change data for a list of specified genes using R?
0
gravatar for cs308
18 months ago by
cs3080
cs3080 wrote:

I am a newbie to R and I am analyzing expression data from an Illumina array. I have imported the excel file to R which includes in my column titles GENE SYMBOL and FOLD CHANGE. In this file there is fold change data for almost every gene in the genome. I want to know how to extract the fold change values for a list of specified gene names which will be under the gene symbol column.

ADD COMMENTlink modified 18 months ago by ATpoint15k • written 18 months ago by cs3080

vlookup in excel does the same trick.

ADD REPLYlink written 18 months ago by cpad011211k
1
gravatar for ATpoint
18 months ago by
ATpoint15k
Germany
ATpoint15k wrote:
# Make or load a list of genes that you want to check:
query.genes <- c("gene1", "gene2")

# Subset the data frame for these genes
tmp.subset <- your.df[your.df$genes == query.genes,]

# and get the column with the FCs
tmp.subset$FC

Adjust the names after $ according to your column names.

EDIT: Also, if your column name is really GENE SYMBOL, try to get used to avoid whitespaces and rather use GENE_SYMBOL or similar delimiters (and of course never use Excel :-D )

ADD COMMENTlink modified 18 months ago • written 18 months ago by ATpoint15k

Hi. Thanks so much. I am completely new to R. My colum title is actually just SYMBOL. When I try the second part: tmp.subset <- your.df[your.df$genes == query.genes,] It tells me : longer object length is not a multiple of shorter object length. What does this mean? Also I assume I replace "your.df" with the name of my file.

ADD REPLYlink written 18 months ago by cs3080
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1644 users visited in the last hour