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:
- java -jar picard.jar UpdateVcfSequenceDictionary I=<in.vcf> O=<updated.vcf> SD=<dict>
- 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