This is a test version of Biostars. For the public version, visit https://www.biostars.org.
'Invalid parameter' error to generate a count matrix using featurecounts

Hi,

I am trying to run a count matrix using featurecounts but it is showing me 'invalid parameter' error with the file path to my bam files. I have checked and the files exist along with executable permissions. Here is my code:

$feature_counts -p -T 8 -a $gene_ann -o $count_out/count_matrix.txt $bam_dir/*_aligned.bam
ERROR: invalid parameter

Could someone please help me with that?

rna-seq featurecounts

2 answers

Please check this link for the parameters settings. You have missed some of the parameters.

https://subread.sourceforge.net/featureCounts.html

Thank you for the link! I had a look and updated the script:

# Run featureCounts to generate a count matrix
$featurecounts -p -O -M -T 8 -a $gene_ann -F GTF -t exon -g gene_id -o $count_out/count_matrix.txt $bam_dir/*.bam

However, it is still showing as : ERROR: invalid parameter:/path/to/file/SRR7008461_aligned.bam'

If you are using -p for paired end data then you should also use

--countReadPairs    Count read pairs (fragments) instead of reads. This option
                      is only applicable for paired-end reads.

I always list the BAM files individually with a space in between names. As Gordon Smyth said below the wild card does not work (*.bam).

Make sure all your variables expand to generate correct paths. It is odd to use a variable for a program name.

One obvious issue is that the software is called featureCounts rather than feature_counts. Is feature_counts perhaps a customized script on your own system?

Yep, the path for featurecounts is addressed as a variable 'feature_counts'.

I don't see anything in the featureCounts documentation that it accepts wild characters in file names.

Sorry, I think there is a confusion. I declared the path to where the featurecounts software is and called that variable feature_counts earlier on in the script. So, I was just calling that in this part of the script. I hope this makes more sense :)

This is my first time doing rnaseq analysis so a bit confused.

Log in to answer this question.