featureCounts (subread v2.0.2) ERROR: invalid parameter: '−−countReadPairs' Entering edit mode s.muroy ▴ 10 @5289631e Last seen 2.9 years ago Peru Hi, I'm using featureCounts (subread v2.0.2) to generate a count matrix for an RNAseq experiment. I have aligned paired-end .sam files sorted by read name and have specified the -p flag and the −−countReadPairs parameter (please see code below). When I run the command, I get ERROR: invalid parameter: '−−countReadPairs'.featureCounts will work just fine if the −−countReadPairs is not included but as I understand it, in version 2.0.2, −−countReadPairs must be included in order to get counts by fragments (as opposed to earlier versions where -p took care of 1) specifying if reads were paired-end & 2) that read pairs were to be counted).A note on the code below: I changed the path names to the .gtf, output .txt and sorted.sam files in this post for privacy reasons. Thank you so much for your help!Sandra subread featureCounts • 4.8k views ADD COMMENT • link updated 10 months ago by Yang Liao ▴ 380 • written 2.9 years ago by s.muroy ▴ 10 Entering edit mode Hi Sandra, I tested the source code version, the macOS version and Linux version of subread-2.0.2 using the same command as yours, and I didn't get this error message. The Your command line seems correct. Can you try this command: to see the version of featureCounts? Also, "−" and "-" are different symbols, and I saw you used the unicode "−" symbol in your post. Please be aware that some PDF files replace the ASCII symbol of "-" with the unicode symbol of "−". When you copy some options from the PDF file to your command, there is a chance that you actually copied the unicode "−" symbol, which isn't recognised by featureCounts as the prefix of options. So please make sure your command included the ASCII "-" symbol instead of the unicode "−" symbol as the prefix of the Cheers,Yang ADD COMMENT • link 2.9 years ago Yang Liao ▴ 380 1 Entering edit mode Hi Yang, Thank you so much for your quick response. It was the ASCII/unicode difference. I ran featureCounts with no problems last nite. I thought I'd checked this before but clearly did not. I'm sorry to have sent you on a semi-wild goose chase testing the source code! I also ran the command [smuroy@ln003 ~]$ featureCounts -v featureCounts v2.0.2 If I may add a small suggestion. In the Subread users guide (Subread v2.0.2; 17 Jun 2021) Section 6.3, the example command line for paired-end reads is given as: Summarize paired-end reads and count fragments (instead of reads): Could you include the Thanks again!Sandra ADD REPLY • link 2.9 years ago s.muroy ▴ 10 Entering edit mode Thank you. We will have the relevant commands updated in the users guide. ADD REPLY • link 2.9 years ago Wei Shi ★ 3.6k Entering edit mode Hi Yang, There seems to a bug with subread when it comes to reading bam files from command line I am using subread featureCounts 2.0.6 and I am trying this on command line It gives me an error I tried the above in 2 different ways Please also note: If I have only 1 bam file in my directory and I do this below, i.e. not supplying the bam file on command line, then the program starts with creation of temp-core.sam files but nothing happens. Am I missing something? It would be ideal to fix the above such that explicit bam files can be provided as input on the command line. Thanks in advance. NOTE: I tried to post this as a new post - however, the UI keeps preventing it without notifying what is wrong ADD REPLY • link 10 months ago tamu.anand • 0 Entering edit mode I don't think that Your first command for running Your second command is also correct. ADD REPLY • link 10 months ago Yang Liao ▴ 380 $ featureCounts -T 4 -s 2 -p \--countReadPairs \-a /path/to/genes.gtf \-t exon \-g gene_id \-o /path/to/featurecountsPE.txt /path/to/aligned/*.sorted.sam \2> /path/to/aligned/results/counts/featurecountsPE.screen-output1.log
--countReadPairs
option worked as expected.featureCounts -v
--countReadPairs
option.featureCounts -v
and gotfeatureCounts -p -a annotation.gtf -t exon -g gene id-o counts.txt mapping results PE.bam
--countReadPairs
for clarity?featureCounts -p -F SAF -a output.saf --fracOverlap 0.2 -o output.counts input.bam
ERROR: invalid parameter: 'input.bam'
featureCounts -p -F SAF -a output.saf --fracOverlap 0.2 -o output.counts
featureCounts
has this bug.featureCounts
is correct. FeatureCounts
v2.0.6 ran without errors when I tested the same command in my computer. Can you please make sure that input.bam
is in the current directory? You can also use the SAMtools view
command to see if this BAM file has the correct format.FeatureCounts
will run on the STDIN mode when no input files are given to it. On this mode, featureCounts
will receive SAM-format input from STDIN. But if there is no input fed from STDIN, it will hang forever. It also creates a file named temp-core-xxxxxx-xxxxxx.sam
(xxxxxx are random strings) for temporarily storing the input.
Login before adding your answer.