Entering edit mode
                    5.1 years ago
        Kumar
        
    
        ▴
    
    170
    Hi, I am trying to perform DESeq2 for Kallisto. I ran Kallisto for 36 PE samples and got results files such as abundance.h5. Now I am trying DESeq2 analysis. I am getting everything correct but while making plotPCA it is making the plot of 6 samples. However, I have a total of 36 samples, I tried to find out the issue but not sure why the script taking only 6 samples for the analysis.
Here is the script:
files <- c("/DataAnalysis/270-aligned/abundance.h5", 
 "/DataAnalysis/272-aligned/abundance.h5") ######just displaying 2 samples here, I have total 36 samples 
names(files) <- paste0("sample", 1:length(files))
txi.kallisto <- tximport(files, type = "kallisto", txOut = TRUE)
head(txi.kallisto$counts)
sampleTable <- data.frame(condition = factor(rep(c("mutant", "control"), each = 3)))
rownames(sampleTable) <- colnames(countdata$counts)
dds <- DESeqDataSetFromTximport(countdata, sampleTable, ~condition)
#PCA plot
vsd <- vst(dds)
class(vsd)
head(colData(vsd))
plotPCA(vsd, "condition")
output
> head(colData(vsd))
DataFrame with 6 rows and 1 column
    condition
     <factor>
sample1    mutant
sample2    mutant
sample3    mutant
sample4   control
sample5   control
sample6   control
                    
                
                
You only specify 6 samples. What is
CountData? Are all samples imported by tximport?I believe so. All data has been imported by tximport. I changed CountData by txi.kallisto variable but it is showing following error. I am following the process of analysis at https://bioconductor.org/packages/release/bioc/vignettes/tximport/inst/doc/tximport.html. Where do I need to specify samples?
Well, you are hand making your ColData there with only 6 samples. If you have count values for 36 samples, how can they possibly be the same? Ar you just copy-pasting that code from some tutorial?
I am not catching entirely. I am following the tutorial I am new in this analysis. I tried to change but not getting improved. If you could help me to improve the code.
error:
Remove the
rep(c(....),each=36)part. If you explicitely write down each factor level then you don't have torepit.I got it! if I write with rep as following:
However, I need one more help in the following code. What should I use here instead of ColData.
Want the values?
assay(vsd), read the manual!SampleTable is 1296 lines long. Are you so confident in your coding skills that you didn't even look at it before trying to use it?
I did not know about it. If you could really want to help, you could have sent the link instead of commenting on me. I mentioned that I am new about the analysis and do not know about the coding either.