Filtering very low genes counts across all libraries
3
0
Entering edit mode
@humberto_munoz-10903
Last seen 8.4 years ago

I am trying to filter low genes counts across all libraries with the suggested commands from edgeR, but an error in the type of comparison appears. Any help will be appreciated.

 

> files <- dir(pattern="*\\.csv$")
> group<- c(1,2,2,3,3,4,4,5,5,6,6,7,7)
> RG<- readDGE(files, group=group, labels=NULL)
> RG$samples
                                    files group lib.size norm.factors
CO21Hour                     CO21Hour.csv     1 11198927            1
CO224Hours                 CO224Hours.csv     2 11294624            1
Light1Hour                 Light1Hour.csv     2 12454641            1
Light24Hours             Light24Hours.csv     3  8668049            1
NaCl1Hour                   NaCl1Hour.csv     3  6550245            1
NaCl24Hours               NaCl24Hours.csv     4 11475584            1
NaNO31Hour                 NaNO31Hour.csv     4 10521157            1
NaNO324Hours             NaNO324Hours.csv     5  9045265            1
pH1Hour                       pH1Hour.csv     5 11850679            1
pH24Hours                   pH24Hours.csv     6  9275761            1
Reference1                 Reference1.csv     6  2911654            1
Temperature1Hour     Temperature1Hour.csv     7 11726524            1
Temperature24Hours Temperature24Hours.csv     7  8120990            1
> keep <-rowSums(cpm(RG)>1) >=2
> RG<= RG[keep, , keep.lib.sizes=FALSE]
Error in RG <= RG[keep, , keep.lib.sizes = FALSE] : 
  comparison of these types is not implemented

gene filtering • 1.1k views
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 6 hours ago
United States

Your last line is

RG <= RG[keep, , keep.lib.sizes=FALSE]

instead of

RG <- RG[keep, , keep.lib.sizes=FALSE]

 

ADD COMMENT
0
Entering edit mode
@humberto_munoz-10903
Last seen 8.4 years ago

Thanks a lot

ADD COMMENT
0
Entering edit mode
@humberto_munoz-10903
Last seen 8.4 years ago

BTY how I can delete the repeated sample names in RG$samples?  

ADD COMMENT
0
Entering edit mode

If you want to add a comment, click on the ADD COMMENT button and add in the box that appears. The Add your answer box below is intended for answers, not comments.

As to your question, I don't see any repeated sample names. And you wouldn't want to delete repeated sample names in RG$samples, because they pertain to the samples in your DGEList.

ADD REPLY
0
Entering edit mode

Thank you again. My DGEList has 13 samples, ( 6 conditions with 1HR and 24 HRs and a reference), and I am trying to create the design matrix using and additive linear model, but  I got an error with the object Time using the below commands. How I can overcome this error? 

> design <-model.matrix(~Time+Treat)
Error in eval(expr, envir, enclos) : object 'Time' not found
> rownames(design)<-colnames(RG)
Error in rownames(design) <- colnames(RG) : object 'design' not found
> design
Error: object 'design' not found

ADD REPLY
0
Entering edit mode

You need to tell model.matrix where to find the Time and Treat variables

design <- model.matrix(~ Time + Treat, RG$samples)

Please don't take offense, but it also seems like you would benefit from boning up on some of your basic R chops, too. There are many online tutorials available now to help, too.

ADD REPLY

Login before adding your answer.

Traffic: 542 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6