Tool: Converting MUMmer snps file to a real VCF file
3
gravatar for Macspider
14 months ago by
Macspider3.2k
Vienna - BOKU
Macspider3.2k wrote:

Hi all,

For my own necessity I have recently made this tool that, contrary to the original mummer-2-vcf.pl script, converts the snps output of the show-snps MUMmer tool to a real VCF file (with header and the like).

https://github.com/MatteoSchiavinato/Utilities/blob/master/my-mummer-2-vcf.py

EDIT: please use the --input-header option if your input *.snps file has a header. Otherwise you will have an IndexError somewhere in the code.

It worked with my data, and it should work with yours. Anyone interested in giving it a test run?

tool snp conversion mummer vcf • 1.2k views
ADD COMMENTlink modified 4 months ago • written 14 months ago by Macspider3.2k
1

I'll try it right now! thank you so much for your contribution! I was looking exactly for some way to convert the output of my mummer snps to vcf :D

ADD REPLYlink written 10 months ago by macielrodriguez230

This would be very useful but it's not quite working for me.

I'm trying to compare 2 viral (30k) genomes.

I used MUMmer's nucmer and show-snps commands:

nucmer --prefilx=1000-X70047 nc_045512_wg.fasta 1000-X70047.fasta
show-snps -T 1000-X70047.delta > 1000-X70047.snps

The snps file looks like this:

/Users/moduff/Desktop/SARS2/nc_045512_wg.fasta /Users/moduff/Desktop/SARS2/1000-X70047.fasta
NUCMER

[P1]    [SUB]   [SUB]   [P2]    [BUFF]  [DIST]  [R]     [Q]     [FRM]   [TAGS]
8782    C       T       8383    8369    8383    0       0       1       1       NC_045512        X70047_consensus
17747   C       T       17348   111     12155   0       0       1       1       NC_045512       X70047_consensus
17858   A       G       17459   111     12044   0       0       1       1       NC_045512       X70047_consensus
18060   C       T       17661   202     11842   0       0       1       1       NC_045512       X70047_consensus
27525   A       G       27126   187     2377    0       0       1       1       NC_045512        X70047_consensus
28144   T       C       27745   619     1758    0       0       1       1       NC_045512        X70047_consensus

When I fed this to mummer-2-vcf.pl via

my-mummer-2-vcf.py -s 1000-X70047.snps -n --output-header --reference nc_045512_wg.fasta

I get this error message:

Traceback (most recent call last):
  File "my-mummer-2-vcf.py", line 313, in <module>
    Vcf_lines = [ convert_snps_to_vcf(line) for line in Lines ]
  File "my-mummer-2-vcf.py", line 313, in <listcomp>
    Vcf_lines = [ convert_snps_to_vcf(line) for line in Lines ]
  File "my-mummer-2-vcf.py", line 56, in convert_snps_to_vcf
    scaffold = lst[10]
IndexError: list index out of range

Any suggestions?

ADD REPLYlink modified 5 months ago by RamRS30k • written 5 months ago by moduff0

Yes, please read through this github issue that I closed some weeks ago, I believe it's the same issue :)

https://github.com/MatteoSchiavinato/Utilities/issues/1

(to improve readability, could you wrap the code parts of your answer inside a code block?)

ADD REPLYlink written 5 months ago by Macspider3.2k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1295 users visited in the last hour