This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How do I grab the log2fc RNA-seq data from a defined list of genes?

Hello, I'm new to RNA-seq and R and what I need to do seems easy enough but I can't find answers. I have a log2fc matrix of >60k gene rows and 9 columns for n=3 reps of conditions. This file is called "allnoig"

    > head(allnoig)
                          a.1           a.2          a.3           b.1
DDX11L1         -0.0009149667 -0.0003525518  0.007609285 -0.0006162814
WASH7P           0.0122970288 -0.0255903899  0.077002423  0.0658547244
MIR6859-1       -0.2469086552 -0.2163589684 -0.057892591  0.0041760959

This goes all the way to c.3. I have a list of ~70 genes that I would like to extract the row informations for. I have entered the 70 genes into a new .cvs and it's called "list"

head(list)
        Symbol
    1   ABTB2
    2 ANGPTL4
    3    ATF3
    4   BATF3

I've tried

subsetlist <- subset(allnoig, row.names %in% list)

and I get the error "Error in match(x, table, nomatch = 0L) : 'match' requires vector arguments"

Please help!

rna-seq r

1 answer

Hey,

Either of these should work:

allnoig[which(rownames(allnoig) %in% list$Symbol),]

allnoig[which(rownames(allnoig) %in% list[,1]),]

If order is important, then use:

allnoig[match(list[,1], rownames(allnoig)),]

Kevin

Log in to answer this question.