Tool:Converting MUMmer snps file to a real VCF file
0
4
Entering edit mode
21 months ago
Macspider ★ 3.4k

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?

VCF mummer conversion SNP Tool • 2.1k views
ADD COMMENT
1
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

Thank you for your practical code!

ADD REPLY

Login before adding your answer.

Traffic: 1648 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6