leafcutter
leafcutter copied to clipboard
Error parsing inputs with example data for .bam to .junc conversion (regtools)
Hello,
I just downloaded leafcutter and I am using the example data. I got to the step to convert the example_geuvadis .bam files to .junc files using regtools, but I keep getting the following error: Error parsing inputs!(2)
There is the message that pops up:
Converting run/geuvadis/RNA.NA06985_CEU.chr1.bam to run/geuvadis/RNA.NA06985_CEU.chr1.bam.junc Program: regtools Version: 0.5.2 Usage: regtools junctions extract [options] indexed_alignments.bam Options: -a INT Minimum anchor length. Junctions which satisfy a minimum anchor length on both sides are reported. [8] -m INT Minimum intron length. [70] -M INT Maximum intron length. [500000] -o FILE The file to write output to. [STDOUT] -r STR The region to identify junctions in "chr:start-end" format. Entire BAM by default. -s INT Strand specificity of RNA library preparation (0 = unstranded, 1 = first-strand/RF, 2, = second-strand/FR). REQUIRED -t STR Tag used in bam to label strand. [XS]
Error parsing inputs!(2)
This is the code that I am running (provided by your differential splicing website):
for bamfile in ls run/geuvadis/*chr1.bam
; do
echo Converting $bamfile to $bamfile.junc
samtools index $bamfile
regtools junctions extract -s 0 -a 8 -m 50 -M 500000 $bamfile -o $bamfile.junc
echo $bamfile.junc >> test_juncfiles.txt
done
Update: It seems like the error is in the -o step. If i remove the -o $bamfile.junc , it seems to work but it outputs it to my terminal window and not to a file. How do I fix this?
The samtools bam --> bam.bai conversion seems to be working great. It seems like the issue is in the regtools junctions extract step. I downloaded regtools via conda.
What could be going wrong? I would appreciate any insight. Thank you!
It seems that you did not specify -s 0
in regtools
, which is required for regtools, as is shown in the message that you pasted above:
-s INT Strand specificity of RNA library preparation
(0 = unstranded, 1 = first-strand/RF, 2, = second-strand/FR). REQUIRED
In this post, I copied the code provided by the leafcutter instructions for the example data (which I am using), which does not have the -s
Either way, I have tried adding the -s option before, but I still get the same error!
Oh, I see that you specified -s
above. But related to what you wrote above, the bam file may be a positional argument
, so you should put it after -o
. It may need to be the last argument as suggested here Usage: regtools junctions extract [options] indexed_alignments.bam
. I think Error parsing inputs!(2)
suggest the bam is missing or in the wrong place. Maybe you can try this.
But I do not have any error when running the code you pasted above, so I'm not sure why regtools works differently for us.
I had the same problem on Big Sur.
Running it with sudo and placing the input bam at the end of the command worked for me. I have added the strandedness info as well.
Try to indicate the working directory with -o ./out.junc ./bamfile.bam
Hope it solves the problem.