FelixKrueger / SNPsplit

Allele-specific alignment sorting
http://felixkrueger.github.io/SNPsplit/
GNU General Public License v3.0
52 stars 20 forks source link

The awk script makes me confused #5

Closed lyhonk closed 7 years ago

lyhonk commented 7 years ago

I think the awk script you given has some mistakes awk '{if($1 ~ "^#") {gsub("contig=<ID=", "contig=<ID=chr"); gsub("contig=<ID=chrMT", "contig=<ID=chrM"); print} else gsub("^MT", "M"); print "chr"$0}' mgp.v5.merged.snps_all.dbSNP142.vcf I think this script should be this awk '{if($1 ~ "^#") {gsub("contig=<ID=", "contig=<ID=chr"); gsub("contig=<ID=chrMT", "contig=<ID=chrM"); print} else {gsub("^MT", "M"); print "chr"$0}}' mgp.v5.merged.snps_all.dbSNP142.vcf my system is centos 7

FelixKrueger commented 7 years ago

Thanks for the pointer, I've added the squiggly brackets.