Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--junc-bonus option is ignored #513

Closed
mparker2 opened this issue Nov 7, 2019 · 2 comments
Closed

--junc-bonus option is ignored #513

mparker2 opened this issue Nov 7, 2019 · 2 comments
Labels

Comments

@mparker2
Copy link

mparker2 commented Nov 7, 2019

Thanks for writing minimap2. I have come to rely on it a lot for mapping nanopore direct RNA data. I was interested in trying some kind of two-pass alignment as mentioned in #348 so have been experimenting with the --junc-bed and --junc-bonus options. As far as I can tell, however, it seems like the --junc-bonus option is ignored. If the splice preset is used, --junc-bonus seems to get set as a positive number (according to the manual it is set to 9). Varying the --junc-bonus option does not seem to change the number (if spliced preset is used but --junc-bonus is set to zero the junctions in the bed file still seem to get used, whereas I would have expected the result to be the same as if no bed file was supplied). Furthermore if no presets are used the junction bonus seems to be set as zero regardless of whether --junc-bonus option is specified or not.

For example:

no splice preset, junc-bonus=0

# apart from the junc-bed related settings, these settings should be identical to -x splice preset

minimap2 -a -t12 -k15 -w5 --splice \
  -g2000 -G200k -A1 -B2 -O2,32 -E1,0 \
  -C9 -z200 -ub --splice-flank=yes \
  --cs=short --junc-bonus=0 --junc-bed juncs.bed \
  ref.fa test.fastq > aln_bonus_0.sam

paftools.js junceval annot.gtf aln_bonus_0.sam

# unmapped reads: 668070
# mapped reads: 979414
# primary alignments: 984638
# singletons: 246055
# predicted introns: 2896215
# non-overlapping introns: 4851
# correct introns: 2742705 (94.70%)

no splice preset, junc-bonus=9

minimap2 -a -t12 -k15 -w5 --splice \
  -g2000 -G200k -A1 -B2 -O2,32 -E1,0 \
  -C9 -z200 -ub --splice-flank=yes \
  --cs=short --junc-bonus=9 --junc-bed juncs.bed \
  ref.fa test.fastq > aln_bonus_9.sam

paftools.js junceval annot.gtf aln_bonus_9.sam

# unmapped reads: 668070
# mapped reads: 979414
# primary alignments: 984638
# singletons: 246055
# predicted introns: 2896215
# non-overlapping introns: 4851
# correct introns: 2742705 (94.70%)

splice preset, junc-bonus=0

minimap2 -x splice -a -t12 -k15 -w5 --splice \
  -g2000 -G200k -A1 -B2 -O2,32 -E1,0 \
  -C9 -z200 -ub --splice-flank=yes \
  --cs=short --junc-bonus=0 --junc-bed juncs.bed \
  ref.fa test.fastq > aln_bonus_0_splice.sam

paftools.js junceval annot.gtf aln_bonus_0_splice.sam

# unmapped reads: 666538
# mapped reads: 980946
# primary alignments: 986187
# singletons: 244051
# predicted introns: 2956054
# non-overlapping introns: 5016
# correct introns: 2932327 (99.20%)

splice preset, junc-bonus=9

minimap2 -x splice -a -t12 -k15 -w5 --splice \
  -g2000 -G200k -A1 -B2 -O2,32 -E1,0 \
  -C9 -z200 -ub --splice-flank=yes \
  --cs=short --junc-bonus=9 --junc-bed juncs.bed \
  ref.fa test.fastq > aln_bonus_9_splice.sam

paftools.js junceval annot.gtf aln_bonus_9_splice.sam

# unmapped reads: 666538
# mapped reads: 980946
# primary alignments: 986187
# singletons: 244051
# predicted introns: 2956054
# non-overlapping introns: 5016
# correct introns: 2932327 (99.20%)

I'm using minimap version 2.17-r941 from bioconda.

I've also attached a markdown file with some more examples that I tried:
junc_bed_test.txt

Thanks
Matt

@mparker2
Copy link
Author

mparker2 commented Nov 7, 2019

I'm not really a C programmer but I think that this can be solved by adding:

else if (c == 341) opt.junc_bonus = atoi(o.arg); // --junc-bonus

at or near line 212 in main.c?

@lh3 lh3 added the bug label Jan 7, 2020
@lh3 lh3 closed this as completed in cdb7857 Jan 7, 2020
@lh3
Copy link
Owner

lh3 commented Jan 7, 2020

Sorry for the late response. I think I have just fixed this issue. Let me know if it still doesn't work. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants