use of htsjdk.variant.vcf.VCF3Codec in project jvarkit by lindenb.
the class VCFUtils method findCodecFromLines.
/**
* find a codec from the lines header. if not found, return default codec
*/
public static AbstractVCFCodec findCodecFromLines(final List<String> list) {
for (final String line : list) {
String formatString = line;
if (formatString.startsWith("##")) {
formatString = formatString.substring(2);
}
int eq = formatString.indexOf('=');
if (eq == -1)
continue;
if (!VCFHeaderVersion.isFormatString(formatString.substring(0, eq)))
continue;
VCFHeaderVersion version = VCFHeaderVersion.getHeaderVersion(line);
if (version == null)
continue;
switch(version) {
case VCF3_2:
case VCF3_3:
return new VCF3Codec();
case VCF4_0:
case VCF4_1:
case VCF4_2:
return new VCFCodec();
}
}
return createDefaultVCFCodec();
}
Aggregations