When I tried to read in the sample sheet (txt file) as a table using DESeqDataSetFromHTSeqCount, I got an error message: Error in file(file, "rt") : cannot open the connection.
# Read in sample sheet and append sample name as row labels
# Args:
# input.file: a .txt samplesheet
#
# Returns:
# table: a data table
ReadTable <- function(input.file) {
table <- read.table(input.file, header=T, sep="\t")
rownames(table) <- table$SampleName
return(table)
}
sampleTable <- ReadTable("sample_sheet_copy.txt")
sampletable_med <- subset(sampleTable, Tissue == "med")
sampletable_cerv <- subset(sampleTable, Tissue == "cerv")
# load in the count data to produce a count matrix
# directory is path to directory where the counts are stored (one per sample)
# design is how we wish to model the data: here we are measuring differences by genotype
ddsHTSeq <- DESeqDataSetFromHTSeqCount(sampleTable = sampleTable,
directory = "counts_4thcol",
design = ~ 1)
counts_4thcol is a folder containing reads per gene in out.tab format, for example:
Xkr4 944
Gm39585 1
Gm38717 2
Rp1 0
Sox17 338 ...
Sample sheet is in a txt file like the following:
SampleName FileName Genotype Age Tissue
E1061-med_S4_merged E1061-med_S4_merged_counts.txt mdx 12m med ...
Thank you very much!