Entering edit mode
4.1 years ago
Kumar
▴
170
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)
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
sampleTable
to include both "factors", then can't you just create another column namedsex
insampleTable
?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
samples
is. 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)?