Input for DESEQ2 (after featurecounts)
1
0
Entering edit mode
5.0 years ago

hi everyone, im pretty new with R and RNA -seq. I have been reading but i get confused about the input for DEseq2...in the featurecounts, do i have to print one table for every samples or is it possible to have one table per sample?

i performed this with each sample (for example for my file/sample called "H1_sorted.bam")

> H1_1sorted = featureCounts(files=c("H1_1sorted.bam"), annot.ext="GCF_000524195.1_ASM52419v1_genomic.gff",
> isGTFAnnotationFile=TRUE, isPairedEnd=TRUE, GTF.attrType="ID")
> write.table(x=data.frame(H1_1sorted$annotation[,c("GeneID","Length")],H1_1sorted$counts,stringsAsFactors=FALSE),file="H1_1sorted.txt",quote=FALSE,sep="\t",row.names=FALSE)

this command created this file (The file has been shortened because is too big for this post)

GeneID  Length  H1.1sorted.bam id4  57  0 id5   63  0 id7   858 0 id11  144 248 id12    24  8 id15  315 275 id43    204 6 id44  174 10 (...) id76211    141 26 id76212  95  1 id76213   164 8 id76214   22  0 id76215   119 9 id76216   444 42 id76217  341 21 id76218  86  4 id76219   273 25 id76220  221 27

Now i should go to DEseq2, but do i need one file with all my samples, or is it possible to go to DEseq2 with each sample separated?

thank you so much

rna-seq R • 1.0k views
ADD COMMENT
1
Entering edit mode
5.0 years ago

Now i should go to DEseq2, but do i need one file with all my samples, or is it possible to go to DEseq2 with each sample separated?

Both are possible, but the easiest is to run featureCounts on all your samples at the same time:

all_sample_counts = featureCounts(files=c("H1_1sorted.bam", "file2.bam","file3.bam","file4.bam","file5.bam"), annot.ext="GCF_000524195.1_ASM52419v1_genomic.gff", isGTFAnnotationFile=TRUE, isPairedEnd=TRUE, GTF.attrType="ID")
ADD COMMENT
0
Entering edit mode

thank you Carlo! ive performed this

CONTEOMERGED = featureCounts(files=c("H1_1sorted.bam", "H1_2sorted.bam", "H1_4sorted.bam", "H3_1sorted.bam", "H282sorted.bam", "H303sorted.bam", "P1_5sorted.bam", "P1_6sorted.bam", "P1_7sorted.bam", "P2_2sorted.bam", "P284sorted.bam", "P374sorted.bam"), annot.ext="GCF_000524195.1_ASM52419v1_genomic.gff", isGTFAnnotationFile=TRUE, isPairedEnd=TRUE, GTF.attrType="ID")

and i got a matrix with every samples in one file, thank you so much!

ADD REPLY

Login before adding your answer.

Traffic: 2598 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