This is a test version of Biostars. For the public version, visit https://www.biostars.org.
featureCounts for aligned reads

Hi everyone,

I have paired-end RNAseq data, and I used STAR aligner to do alignment, so basically for each paired-end fastq files I ended-up creating one alignment file (bam). Now I would like to create a count matrix to do DE analysis. I would like to use featureCounts tool. I was wondering what are the optimal flags to use? I am not sure if I have to use -p flag, since my reads are already aligned to the reference.

Thanks!

featurecounts rnaseq differential expression de

1 answer

You should use -p flag so as to count fragments. Don't use -M flag since you don't want to count multi-mapped reads. Use -t to count at exon level but summarize the counts per gene identifier using -g. If your library was stranded you will want to use appropriate -s option (most likely 2). Provide all BAM files (in the order that you want the columns to be in) in a single command to get read matrix. Your BAM files can be sorted or unsorted. If they are unsorted then featureCounts will sort them on the fly.

Here is a summary of possible command lines.

In future, you could use STAR itself to generate the counts.

Works perfectly thank you very much!

One more question, is having this warning normal? I get it with -p option

WARNING: reads from the same pair were found not adjacent to each || || other in the input (due to read sorting by location or || || reporting of multi-mapping read pairs).

Were your BAM files sorted? featureCounts should sort the files as needed. You could always pre-sort them with samtools.

should allowMultiOverlap be used or not?

Log in to answer this question.