<p>Hey guys,</p>

<p>I'm having a problem when using a mouse dbsnp vcf file for variant annotations with GATK's VariantAnnotator. 
This dbsnp vcf file has chromosomes notated as chr1, chr2 .... but my reference follows a different notation 1, 2, 3 ... This produces an error when running GATK, like the following:</p>

<p>Input files dbSNP.vcf and reference have incompatible contigs: No overlapping contigs found.</p>

<h5>ERROR  dbSNP.vcf contigs = [chr1, chr10, chr11, chr12, chr13, chr13<em>random, chr14, chr15, chr16, chr17, chr17</em>random, chr18, chr19, chr1<em>random, chr2, chr3, chr3</em>random, chr4, chr4<em>random, chr5, chr5</em>random, chr6, chr7, chr7<em>random, chr8, chr8</em>random, chr9, chr9<em>random, chrM, chrUn</em>random, chrX, chrX<em>random, chrY, chrY</em>random]</h5>

<h5>ERROR   reference contigs = [1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 2, 3, 4, 5, 6, 7, 8, 9, MT, X, Y, NT<em>166325, NT</em>166464, NT<em>166452, NT</em>166480, NT<em>166448, NT</em>166458, NT<em>166443, NT</em>166466, NT<em>166476, NT</em>166479, NT<em>166478, NT</em>166474, NT<em>166471, NT</em>166445, NT<em>166465, NT</em>166457, NT<em>166470, NT</em>166454, NT<em>166472, NT</em>166449, NT<em>166481, NT</em>166337, NT<em>166459, NT</em>166456, NT<em>166473, NT</em>166461, NT<em>166475, NT</em>166462, NT<em>166444, NT</em>166453, NT<em>166446, NT</em>166469, NT<em>072868, NT</em>166335, NT<em>166467, NT</em>166283, NT<em>166338, NT</em>166340, NT<em>166442, NT</em>166334, NT<em>166286, NT</em>166451, NT<em>166336, NT</em>166339, NT<em>166290, NT</em>053651, NT<em>166450, NT</em>166447, NT<em>166468, NT</em>166460, NT<em>166477, NT</em>166455, NT<em>166291, NT</em>166463, NT<em>166433, NT</em>166402, NT<em>166327, NT</em>166308, NT<em>166309, NT</em>109319, NT<em>166282, NT</em>166314, NT<em>166303, NT</em>112000, NT<em>110857, NT</em>166280, NT<em>166375, NT</em>166311, NT<em>166307, NT</em>166310, NT<em>166323, NT</em>166437, NT<em>166374, NT</em>166364, NT<em>166439, NT</em>166328, NT<em>166438, NT</em>166389, NT<em>162750, NT</em>166436, NT<em>166372, NT</em>166440, NT<em>166326, NT</em>166342, NT<em>166333, NT</em>166435, NT<em>166434, NT</em>166341, NT<em>166376, NT</em>166387, NT<em>166281, NT</em>166313, NT<em>166380, NT</em>166360, NT<em>166441, NT</em>166359, NT<em>166386, NT</em>166356, NT<em>166357, NT</em>166423, NT<em>166384, NT</em>161879, NT<em>161928, NT</em>166388, NT<em>161919, NT</em>166381, NT<em>166367, NT</em>166392, NT<em>166406, NT</em>166365, NT<em>166379, NT</em>166358, NT<em>161913, NT</em>166378, NT<em>166382, NT</em>161926, NT<em>166345, NT</em>166385, NT<em>165789, NT</em>166368, NT<em>166405, NT</em>166390, NT<em>166373, NT</em>166361, NT<em>166348, NT</em>166369, NT<em>161898, NT</em>166417, NT<em>166410, NT</em>166383, NT<em>166362, NT</em>165754, NT<em>166366, NT</em>166363, NT<em>161868, NT</em>166407, NT<em>165793, NT</em>166352, NT<em>161925, NT</em>166412, NT<em>165792, NT</em>161924, NT<em>166422, NT</em>165795, NT<em>166354, NT</em>166350, NT<em>165796, NT</em>161904, NT<em>166370, NT</em>165798, NT<em>165791, NT</em>161885, NT<em>166424, NT</em>166346, NT<em>165794, NT</em>166377, NT<em>166418, NT</em>161877, NT<em>166351, NT</em>166408, NT<em>166349, NT</em>161906, NT<em>166391, NT</em>161892, NT<em>166415, NT</em>165790, NT<em>166420, NT</em>166353, NT<em>166344, NT</em>166371, NT<em>161895, NT</em>166404, NT<em>166413, NT</em>166419, NT<em>161916, NT</em>166347, NT<em>161875, NT</em>161911, NT<em>161897, NT</em>161866, NT<em>166409, NT</em>161872, NT<em>166403, NT</em>161902, NT<em>166414, NT</em>166416, NT<em>166421, NT</em>161923, NT_161937]</h5>

<p>Is there any simple way/script that would allow me to change the chromosome notation on the dbsnp file to the same provided on the reference? </p>

<p>Thanks</p>

Probably:

    perl -pe 's/^([^#])/chr\1/'

