Question: convert STAR ReadsPerGene.out.tab to Deseq2 count table
0
gravatar for jonessara770
2.5 years ago by
jonessara770170
jonessara770170 wrote:

Hello,

How can I format STAR ReadsPerGene.out.tab for stranded RNA to Deseq2 count matrix format?

N_unmapped 663817 663817 663817

N_multimapping 1232697 1232697 1232697

N_noFeature 5408215 8176752 5438049

N_ambiguous 108068 315 106321

NM_214429 0 0 0

NM_214220 0 0 0

NM_001143697 51 0 51

NM_001164649 1 0 1

NM_001044603 2 0 2

NM_001244242 479 1 478

NM_001244241 286 1 285

NM_001177907 428 0 428

thanks

rna-seq • 2.3k views
ADD COMMENTlink modified 2.5 years ago by h.mon27k • written 2.5 years ago by jonessara770170
6
gravatar for h.mon
2.5 years ago by
h.mon27k
Brazil
h.mon27k wrote:

I use the following code snippet:

ff <- list.files( path = "./counts", pattern = "*ReadsPerGene.out.tab$", full.names = TRUE )
counts.files <- lapply( ff, read.table, skip = 4 )
counts <- as.data.frame( sapply( counts.files, function(x) x[ , number ] ) )
ff <- gsub( "[.]ReadsPerGene[.]out[.]tab", "", ff )
ff <- gsub( "[.]/counts/", "", ff )
colnames(counts) <- ff
row.names(counts) <- counts.files[[1]]$V1

Depending on the strandedness of you library, number may be 2,3 or 4.

ADD COMMENTlink written 2.5 years ago by h.mon27k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1135 users visited in the last hour