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

minimap2 output bam is not working with sniffles #58

Closed
amrita1983 opened this issue Feb 20, 2018 · 21 comments
Closed

minimap2 output bam is not working with sniffles #58

amrita1983 opened this issue Feb 20, 2018 · 21 comments

Comments

@amrita1983
Copy link

Hello,

I am using nanopore (1D) human data, I have aligned using ngmlr and minimap2. Sniffles for SV calling, but ngmlr bam of the same sample is giving straucrtual variant vcf but minimap2 bam is not giving any variant output.
Do yo have any idea about it?
One more question, can I use Illumina bam to extract structural variants using Sniffles.

@fritzsedlazeck
Copy link
Owner

Hi,
you probably have to look in IGV what is going on. I assume you ran minimap2 but did not recompute the MD string so some e.g. smaller deletions or insertions are not visible to Sniffles.

@amrita1983
Copy link
Author

"recompute the MD string" how can I do that? Can you please just help me to know that.

@fritzsedlazeck
Copy link
Owner

Check out samtools. There is an option for that

@wdecoster
Copy link
Contributor

Which is samtools calmd

@wangyugui
Copy link

@fritzsedlazeck @lh3

In my test case, both CIGAR and MD seems OK, but no vcf is reported from the bam generated from minimap2 with the MD flag.

the minimap2 version: lh3/minimap2#118

but it works well for the bam from ngmlr

sniffles --report_BND --skip_parameter_estimation --min_support 1 -m del.sort.bam -v del.vcf

del.sort.bam.zip

@fritzsedlazeck
Copy link
Owner

Can you share the bam file from minimap2?

@wangyugui
Copy link

It is already shared as del.sort.bam.zip in the last message.

# samtools view -H del.sort.bam |grep PG
@PG     ID:minimap2     PN:minimap2     VN:2.9-r751-dirty       CL:minimap2 -a -x asm5 --MD /usr/bio-ref/GRCh38.p0.dnaref/dnaref.fa.asm5.mmi -

@fritzsedlazeck
Copy link
Owner

Ah sorry.
I will take a look tomorrow.
Cheers
Fritz

@fritzsedlazeck
Copy link
Owner

The problem is that the bam file reports only 3 reads and each of them have a different size deletion:
499M99D137075M -> 99bp del
1000M999D135674M -> 999bp del
1999M1999D133675M -> 1999bp del.

So please increase the coverage and Sniffles wont call things if they are so diverse above each other since this is 100% an artifact if we see something like this in real data.

Might be interesting to check with @IH3 to see what minimap2 is doing.

Thanks
Fritz

@wangyugui
Copy link

@fritzsedlazeck

but the same fasta reads works well when ngmlr. so there should be a diff between ngmlr and minimap2.

This is the bam of ngmlr.
ngmlr.del.sort.bam.zip

please check the diff between them.

@wangyugui
Copy link

the param of Sniffles

--report_BND --skip_parameter_estimation --min_support 1

@fritzsedlazeck
Copy link
Owner

Ok I found the issue. Minimap2 reports the alignment score but not like BWA mem the second best score. Sniffles tries to interpret the reliability of the alignment given the two parameters. Since it could see the one but not the other plus did not get a chance to calibrate for your data set it ignored the reads.
I have uploaded a fix on the code.
Thanks
Fritz

@wangyugui
Copy link

wangyugui commented Mar 23, 2018

Thanks. It works now.

Although it report only 1 record in vcf for the bam from minimap2, but it report 3 record in for the bam from ngmlr. But this is not a real data.
the param of Sniffles

--report_BND --skip_parameter_estimation --min_support 1

@fritzsedlazeck
Copy link
Owner

yeah its tricky with 3 reads each for a different del that overlaps.

@wangyugui
Copy link

A same result will be perfect.
Is there more info about the 'the second best score' of BWA mem?

And can we add a '--somatic' option to the enhancement list?

@fritzsedlazeck
Copy link
Owner

yeah its defined in the sam/bam file format. Mappers may or may not support it.

what do you have in mind with the somatic option?

@wangyugui
Copy link

A option like '--min-alternate-fraction 0.10' of freebayes will be good for somatic support.

For this test bam, if we consider it as a somatic sample with '--min-alternate-fraction 0.10 --min_support 1' param, Should we output all the 3 record to the vcf file?

@fritzsedlazeck
Copy link
Owner

there is the "--allelefreq" parameter. That sounds like similar to what the alternate-fraction does.
so setting -s 1 and --allelefreq 0.1 should be a similar concept.

I dont have much experience with that parameter combination, but let me know if that works.

@wangyugui
Copy link

What is the tag name of 'the second best score' of BWA mem? I failed to find out it from samtag.pdf.

--allelefreq 0.05 --min_support 1 for bam of minimap2 still report 1 record only. The vcf result should not diff by the SAM tag?

@fritzsedlazeck
Copy link
Owner

XS is the tag. And Sniffles is not ment to be running on 3 reads one per deletion. That is why this test set is not performing.

@anduin0909
Copy link

Is the file output by ngmlr a bam file? Why is my sniffles unable to operate on the output file? If the output is a sam file, how can I change it to bam? I have tried the samtools change method, but always report errors, display read errors, and close errors.

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

No branches or pull requests

5 participants