htseq counts to make matrix in Rstudio
0
0
Entering edit mode
3.7 years ago

Hi all,

I am very new to bioinformatics and just learning how to do RNA-seq analysis.

I have 63 samples, for which I have the htseq count files that I need to create a matrix with each column as a sample. How do I go about doing this in RStudio? Please give me some tips and pointers since i Have no idea where to start in making a table with so many samples and extracting the data from each one !

RNA-Seq • 2.4k views
ADD COMMENT
3
Entering edit mode

EDIT: tximport does not work with HTSeq (as stated by Mike Love here as HTSeq provides gene-level and not transcript-level counts. DESeq2 has a HTSeq import function built into its workflow (DESeqDataSetFromHTSeqCount) that handles HTSeq.


Have you looked at the tximport vignette? It is created precisely for this purpose of importing RNAseq quantification from multiple files and combining relevant data into a single matrix.

ADD REPLY
0
Entering edit mode

I would like to do this in a simple way using basic R functions

ADD REPLY
0
Entering edit mode

You can use list.files, lapply, read.table and cbind to do it. There could be several edge cases and problems that tximport would address, so I would recommend against reinventing the wheel.

ADD REPLY
0
Entering edit mode

Thank you. If my file format is .htseq can I still use the tximport method? I looked at the tximport but I am still confused how I would do this...can you please guide me?

ADD REPLY
0
Entering edit mode

It looks like tximport doesn't do htseq - but you can use DESeq2 to read htseq output and then get counts() as a matrix from that. Check out this post: How to input data for DESeq2 from individual HTSeq count?

BTW, please don't add an answer unless it answers the top level question. Use Add Comment or Add Reply instead.

ADD REPLY

Login before adding your answer.

Traffic: 1804 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6