I have 6 files that I obtained from TCGA portal. 4 are metastatic while other 2 are normal tissue samples. I obtained the .count files. I am rather new to rna-seq analysis and previously have done using the salmon alligned files with my own reads and never with HT seq files. When I am importing the files using the DESeqDataSetFromHTSeqCount function, the script throws an error : all samples have 0 counts for all genes. check the counting script. I am unable to figure as in what is lacking or what I missed. Kindly help. Thank in advance.
Code should be placed in three backticks as shown below
files <- list.files(datadir, recursive = TRUE, pattern = ".count",
full.names = TRUE)
files
summary(files)
## Load sample table
samples <- read.csv(file.path(datadir, "files_df.csv"))
samples
## Get base name of files
bsname <- basename(gsub(".count", "", files))
names(files) <- bsname
names(files)
## Assign base file name to file names with path
samples$samplename <-as.character(samples$files)
samples$samplename <- as.character(lapply(samples$samplename, function(x){ strsplit(x, "\\.")[[1]][1]}))
samples$samplename
samples$Files <- files[match(samples$samplename, names(files))]
samples$Files
samples$Group <- as.character(samples$Group)
samples$Group
samples$Samplename <- as.character(paste0(samples$Group,"_",samples$ID))
samples$Samplename
files <- samples$Files
x <- samples$Samplename
names(files) <- x
files <- as.character(files)
sampleCondition <- as.data.frame(samples$Group)
sampleCondition
sampleTable <- data.frame(sampleName = samples$samplename,
fileName = bsname,
condition = sampleCondition)
sampleTable$condition <- factor(sampleTable$samples.Group)
library("DESeq2")
ddsHTSeq <- DESeqDataSetFromHTSeqCount(sampleTable = samples,
directory = datadir,
design= ~ condition)
# include your problematic code here with any corresponding output
# please also include the results of running the following in an R session
sessionInfo( )
Error in DESeqDataSet(se, design = design, ignoreRank) : all samples have 0 counts for all genes. check the counting script.
