How to run DESeq2 for multiple factors
Hi, I have 187 samples with two factors: (affected and unaffected) and (male and female) for RNA-Seq data analysis. I have run Kallisto and got output file, now I am using DESeq2 package DGE analysis. I have samples with two factors. Please let me know how to improve the script according to the following metadata.
Here is the metadata information:
affected =94
Male =5
Female: 89
Unaffected: 93
Male: 52
Female:41
Here is the script:
names(files) <- paste0("sample", 1:187)
txi.kallisto <- tximport(files, type = "kallisto", txOut = TRUE)
head(txi.kallisto$counts)
sampleTable <- data.frame(condition = factor(rep(c("affected", "unaffected"), each = 94)))
rownames(sampleTable) <- colnames(txi.kallisto$counts)
• 2,117 views
•
link
0 answers
No answers yet.
Log in to answer this question.
Set
txOutto FALSE since DESeq2 is a gene-level tool and therefore expects per-gene and not per-transcripts counts.eachcan also not be 94 in both cases since you have 94 and 93 and not 2x94 samples.Hi, When I set txOut to FALSE, it shows the following error.
Error in summarizeFail() :
tximport failed at summarizing to the gene-level. Please see 'Solutions' in the Details section of the man page: ?tximport
Please read the tximport manual. You need a tx2gene map for the summarization. Just follow the manuals.
Hi, I did not get my answer in the post. My initial question is how to import these two factors types of data with different numbers. I will use tx2gene after importing the data.
Can you give us more information?
Is your script working or is it producing an error? Which specific part of the script are you running into issues with?
If you're trying to get
sampleTableto include both "factors", then can't you just create another column namedsexinsampleTable?Hi, first I am not sure how to load all abundance.h5 files from different folders. I have a total of 187 abundance.h5 samples files in different folders.
ERROR: Error in samples$run : object of type 'closure' is not subsettable
Next, how to make the change here because I have different groups and factors. The below script is for one factor (affected and unaffected), I need to add male and female as a factor also.
Let's start with one problem at a time, and get things working with one factor first.
In general, you should start with getting the simple things working before moving onto something more complicated.
So, the first thing that needs addressing is: object of type 'closure' is not subsettable
Perhaps you might want to show us exactly what
samplesis. Otherwise, we can't help you just by looking at a small piece of your code.Here are some samples, in such a order I have total 187 samples: However, I am trying if I can access these samples by a single command.
Hi, do you have an idea about my question as I mentioned below? Is there any command to access these all .h5 files in a variable (files)?