Picard UpdateVcfSequenceDictionary and SortVcf

So if you have a VCF that isn’t sorted according to chromosome, you may want to fix that.  One would think that you could just do that by using SortVcf in Picard with a sequence dictionary.  But, no.  Instead you have to do two steps:

  1. java -jar picard.jar UpdateVcfSequenceDictionary I=<in.vcf> O=<updated.vcf> SD=<dict>
  2. java -jar picard.jar SortVcf I=<updated.vcf> O=<out.vcf> SD=<dict>

You can’t pipe them either, so you’ll just have to delete updated.vcf after you’ve finished generating out.vcf

Leave a comment