[go: nahoru, domu]

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

XA tag #147

Closed
brentp opened this issue Apr 10, 2018 · 4 comments
Closed

XA tag #147

brentp opened this issue Apr 10, 2018 · 4 comments

Comments

@brentp
Copy link
brentp commented Apr 10, 2018

Is there an equivalent of the XA tag from bwa mem? Or another way to get the alternative mappings? Also, there are a lot of tags I'm not familiar with, e.g.:

 AS:i:116        nn:i:3  tp:A:P  cm:i:1  s1:i:49 s2:i:0  
  MQ:i:1  ms:i:3767       mc:i:10436 

did I miss where these are documented?
thanks!

@lh3
Copy link
Owner
lh3 commented Apr 10, 2018

There is no XA equivalent in minimap2. I could add it, but this will take some time. For now, you can use --secondary=yes. It outputs secondary alignments. However, because the format is different, you can't simply adapt XA-aware tools to work with --secondary=yes output.

For tags, see the man page.

@brentp
Copy link
Author
brentp commented Apr 10, 2018

thank you. I missed the man page. XA would be useful, but it is not necessary. I'll leave this open, but feel free to close if you feel it's not of general interest.

@wangyugui
Copy link
wangyugui commented Oct 7, 2018

@lh3 @brentp

test.zip

There are 2 alignment position in ref.3bp.in.fa for query_SE_150.fq.
one is full match. and another is with 3bp insert.

command line

# minimap2 --version
2.12-r847-dirty
#minimap2 -a -x sr --MD -t 40 -k15 -w1 -d ref.3bp.in.fa.sr.mmi ref.3bp.in.fa
#minimap2 -a -x sr --MD -t 40 -k15 -w1 --secondary=yes ref.3bp.in.fa.sr.mmi query_SE_150.fq

when 'default kmer size: 21; skip: 11', the score value is 141 vs 138.(OK)
when '-k15 -w3', the score value is 147 vs 143.(OK)
when '-k15 -w2', the score value is 148 vs 146.(OK)
when '-k15 -w1', the score value is 150 vs 150.(bug?)

checking score value by mm_select_sub function:

diff --git a/hit.c b/hit.c
index 92aa6b7..189b231 100644
--- a/hit.c
+++ b/hit.c
@@ -244,6 +244,7 @@ void mm_select_sub(void *km, float pri_ratio, int min_diff, int best_n, int *n_,
                        if (p == i || r[i].inv) { // primary or inversion
                                r[k++] = r[i];
                        } else if ((r[i].score >= r[p].score * pri_ratio || r[i].score + min_diff >= r[p].score) && n_2nd < best_n) {
+                               fprintf(stderr,"DEBUG:%d\t%d\t%d\t%f\n",r[p].score,r[i].score,min_diff,pri_ratio);
                                if (!(r[i].qs == r[p].qs && r[i].qe == r[p].qe && r[i].rid == r[p].rid && r[i].rs == r[p].rs && r[i].re == r[p].re)) // not identical hits
                                        r[k++] = r[i], ++n_2nd;
                                else if (r[i].p) free(r[i].p);

@lh3
Copy link
Owner
lh3 commented Jun 7, 2019

@wangyugui Sorry that I have missed your question. Please create a new issue if you still have troubles.

@brentp I am afraid that I will decline this feature request. It seems not much needed by other users. Thanks for this anyway.

@lh3 lh3 closed this as completed Jun 7, 2019
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

3 participants