featureCounts (subread v2.0.2) ERROR: invalid parameter: '−−countReadPairs'
1
0
Entering edit mode
s.muroy ▴ 10
@5289631e
Last seen 2.8 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


$ 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
subread featureCounts • 4.7k views
ADD COMMENT
0
Entering edit mode
Yang Liao ▴ 380
@yang-liao-6075
Last seen 4 weeks ago
Australia

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 --countReadPairs option worked as expected.

Your command line seems correct.

Can you try this command:

featureCounts -v

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 --countReadPairs option.

Cheers, Yang

ADD COMMENT
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 featureCounts -v and got

[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):

featureCounts -p -a annotation.gtf -t exon -g gene id
-o counts.txt mapping results PE.bam

Could you include the --countReadPairs for clarity?

Thanks again! Sandra

ADD REPLY
0
Entering edit mode

Thank you. We will have the relevant commands updated in the users guide.

ADD REPLY
0
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

featureCounts -p -F SAF -a output.saf --fracOverlap 0.2 -o output.counts input.bam

It gives me an error

ERROR: invalid parameter: 'input.bam'

I tried the above in 2 different ways

  1. bioconda install of subread 2.0.6
  2. docker - https://quay.io/repository/biocontainers/subread?tab=tags - docker pull quay.io/biocontainers/subread:2.0.6--he4a0461_0

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?

featureCounts -p -F SAF -a output.saf --fracOverlap 0.2 -o output.counts

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
0
Entering edit mode

I don't think that featureCounts has this bug.

Your first command for running 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.

Your second command is also correct. 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.

ADD REPLY

Login before adding your answer.

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