This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to read in count data from matrix of read counts into Deseq2

Hi, I was trying to analyze my RNA seq data with Deseq2. Now I have finished mapping step with HISAT2, generated a count matrix as input for Deseq2, from the manual of StringTie, I know that I should use "DESeqDataSetFromMatrix" to read. but how to use it, I am not sure. in the manual of Deseq2, it gave an example of how to read in the count matrix in a R package as follows:

library("pasilla")
pasCts <- system.file("extdata", "pasilla_gene_counts.tsv",
                 package="pasilla", mustWork=TRUE)
pasAnno <- system.file("extdata", "pasilla_sample_annotation.csv",
                       package="pasilla", mustWork=TRUE)
countData <- as.matrix(read.csv(pasCts,sep="\t",row.names="gene_id"))
colData <- read.csv(pasAnno, row.names=1)
colData <- colData[,c("condition","type")]

but I just to directly read "transcript_count_matrix.csv" in my current directory, How could I achieve that?

Thanks!

rna-seq r

1 answer

countData = read.csv("transcript_count_matrix.csv")

or some variant of it.

TKS! Devon.

looking at:

countData <- as.matrix(read.csv(pasCts,sep="\t",row.names="gene_id"))

I was imaging something much more complicated than you suggested.

Indeed. Could someone familiar with DEseq2 clarify this. Going to try, but I am guessing just countData = read.csv("transcript_count_matrix.csv") is not going to work.

Log in to answer this question.