I am trying to use a
sampleTable from a
.txt file as I normally would when importing counts as a count matrix using
DESeqDataSetFromMatrix however when I do this the function doesn't find the proper path for the files. I receive the error message listed below.
I have tried to assign the
rownames of the table to be the same as the names of each sample in the directory and that hasn't helped either.
Any ideas what I am missing?
If I use the suggested code in the tutorial i.e. make a sample table from the names of the files in the directory the function works, but I have a lot of information I would like to include in an separate
library(DESeq2) ExonCountFiles <- "/Bigdata/Dropbox (Technion Dropbox)/Rina_Benel/Shared/CMV/CMV_sep19/htseq_6.5.21/exon_count" list.files(ExonCountFiles) TamisDesign <- read.table("/Bigdata/Dropbox (Technion Dropbox)/Rina_Benel/Home/Rina/CMV_Sep2019/data/sampleSheetTami.txt", sep = "\t", header = F, row.names = 1) head(TamisDesign) colnames(TamisDesign) <- c("sampleName", "infectionStatus", "placentaStatus", "NumWomen", "BioRep") TamisDesign <- TamisDesign[order(TamisDesign$sampleName), ] head(TamisDesign) TamisDesign$NumWomen <- factor(TamisDesign$NumWomen) TamisDesign$infectionStatus <- factor(TamisDesign$infectionStatus) TamisDesign$placentaStatus <- factor(TamisDesign$placentaStatus)
Error in file(file, "rt") : cannot open the connection
This however does work...
sampleFiles <- list.files(ExonCountFiles) sampleCondition <- gsub('exon_count_', "", sampleFiles) sampleTable <- data.frame(sampleName = sampleFiles, fileName = sampleFiles, condition = sampleCondition) sampleTable$condition <- factor(sampleTable$condition)