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

Assertion `op >= 0 && op <= 2' failed when -S tag passed #31

Closed
NatPRoach opened this issue Oct 4, 2017 · 7 comments
Closed

Assertion `op >= 0 && op <= 2' failed when -S tag passed #31

NatPRoach opened this issue Oct 4, 2017 · 7 comments

Comments

@NatPRoach
Copy link

Hello, I'm getting an error when passing the -S tag. I can't figure out what exactly is going wrong
My command:
minimap2 -x splice -S -k 14 -N 0 -t 24 ce11.fa 170206_celegans_wtadult_rna.111.fa > albacore_rna_MINIMAP2_ce11_genome_all_rna_k14.paf 2> albacore_rna_MINIMAP2_ce11_genome_all_rna_k14{kmer}.log
And the logfile:

[M::mm_idx_gen::5.1030.97] collected minimizers
[M::mm_idx_gen::5.809
1.72] sorted minimizers
[M::main::5.8091.72] loaded/built the index for 7 target sequence(s)
[M::mm_mapopt_update::6.452
1.65] mid_occ = 162; max_occ = 711
[M::mm_idx_stat] kmer size: 14; skip: 5; is_HPC: 0; #seq: 7
[M::mm_idx_stat::6.694*1.63] distinct minimizers: 16602221 (67.22% are singletons); average occurrences: 2.054; average spacing: 2.941
minimap2: format.c:148: write_cs: Assertion `op >= 0 && op <= 2' failed.

@lh3
Copy link
Owner

lh3 commented Oct 5, 2017

At present -S doesn't work in the splice mode. The next release will. The output will look like:

^gt278ag

where 278 is the total intron length, including gt-ag.

@lh3
Copy link
Owner

lh3 commented Oct 6, 2017

Please try the master branch from github with option --cs. You will see something like:

~gt278ag

This marks an intron in the cs tag.

@lh3
Copy link
Owner

lh3 commented Oct 7, 2017

I am closing this issue for now. Please feel free to reopen it if the change does not work. Thanks for reminding me of this.

@lh3 lh3 closed this as completed Oct 7, 2017
@NatPRoach
Copy link
Author

NatPRoach commented Oct 10, 2017

Hi again, I spoke a little too soon when I said the issue was resolved yesterday. Using the command:

minimap2 -x splice --cs -k 14 -N 0 -t 24 ce11.fa 170206_celegans_wtadult_rna.111.fa > albacore_rna_MINIMAP2_ce11_genome_all_rna_k14.paf 2> albacore_rna_MINIMAP2_ce11_genome_all_rna_k14{kmer}.log

The .paf file seems to be written to, but the command itself still throws an error in the log file below:

[M::mm_idx_gen::100.964*1.27] collected minimizers
[M::mm_idx_gen::116.743*2.12] sorted minimizers
[M::main::116.746*2.12] loaded/built the index for 7 target sequence(s)
[M::mm_mapopt_update::124.826*2.05] mid_occ = 162
[M::mm_idx_stat] kmer size: 14; skip: 5; is_HPC: 0; #seq: 7
[M::mm_idx_stat::130.588*2.00] distinct minimizers: 16602221 (67.22% are singletons); average occurrences: 2.054; average spacing: 2.941
minimap2: format.c:191: write_cs: Assertion `t_off == r->re - r->rs && q_off == r->qe - r->qs' failed.

In addition, when attempting to convert the .paf file to .maf format using the paf2aln.js program provided in the misc folder of source code, the resulting .maf alignments do not look to be the same as .sam alignments run with all the same settings except the --cs flag, or the same as the .paf file specifies. As a comparison between the .paf and .maf for one of my sequences:
.paf:

5159fbaf-0b97-4161-bab5-564012f88b46_Basecall_1D_template       236     0       234     +       chrIV   17493829        7240175 7240434 222     265     60      tp:A:P  cm:i:27 s1:i:131        s2:i:0  NM:i:43 ms:i:137        AS:i:137        nn:i:0  cs:Z::9*at:1+t:2+a*tc:8-c:3*ta:13+a:34+t:6*ct:2-tca:1*ct:2-tc:1-tcc:34-tct:2-c:18-ttc:48-t:7+c:2*ca:2-atttttt:1+g:3-c:4-tc:6-tctc:13

.maf:

a 137
s chrIV                                                        7240175        259 +   17493829 a--tct--ctcactctcctctcttct-catttttt-ctctctc
s 5159fbaf-0b97-4161-bab5-564012f88b46_Basecall_1D_template          0        234 +        236 ttac-aatt---t-------------ca-------g-------

As you can see the alignment depicted in the .maf is truncated significantly and of poor quality. In contrast the CIGAR from a sam alignment of this sequence run with the same parameters indicates a much higher quality alignment than is coming out in .maf format
.sam output from the same sequence:

5159fbaf-0b97-4161-bab5-564012f88b46_Basecall_1D_template       0       chrIV   7240176 60      11M1I2M1I9M1D17M1I34M1I9M3D4M2D1M3D34M3D2M1D18M3D48M1D7M1I5M7D1M1I3M1D4M2D6M4D13M2S     *       0       0

@lh3
Copy link
Owner

lh3 commented Oct 11, 2017

  1. Thanks a lot for reporting the issue! The assertion failure was caused by a bug introduced earlier today. This has just been fixed via ca632f9.

  2. I don't have plan to update paf2aln.js soon to make it work with spliced alignment for the time being. Sorry.

  3. Once you add a new comment to this thread, I will receive an email. You don't need to open a new issue. Anyway, thanks for reminding me!

@NatPRoach
Copy link
Author

Ah my apologies, relatively new to this. Thanks for all the help.

@lh3
Copy link
Owner

lh3 commented Oct 11, 2017

By the way, if you don't want to see secondary alignment, use --print-2nd=no to disable. -N 0 reduces alignment accuracy.

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

No branches or pull requests

2 participants