use of htsjdk.variant.vcf.VCFContigHeaderLine in project jvarkit by lindenb.
the class VCFUtils method samSequenceDictToVCFContigHeaderLine.
public static SortedSet<VCFContigHeaderLine> samSequenceDictToVCFContigHeaderLine(SAMSequenceDictionary dict) {
SortedSet<VCFContigHeaderLine> meta2 = new TreeSet<VCFContigHeaderLine>();
for (SAMSequenceRecord ssr : dict.getSequences()) {
Map<String, String> mapping = new HashMap<String, String>();
mapping.put("ID", ssr.getSequenceName());
mapping.put("length", String.valueOf(ssr.getSequenceLength()));
String as = ssr.getAssembly();
if (as != null && !as.trim().isEmpty())
mapping.put("assembly", as);
VCFContigHeaderLine h = new VCFContigHeaderLine(mapping, ssr.getSequenceIndex());
meta2.add(h);
}
return meta2;
}
Aggregations