/** * are we a valid version string of some type * @param version the version string * @return true if we're valid of some type, false otherwise */ public static boolean isVersionString(String version){ return toHeaderVersion(version) != null; }
/** * are we a valid version string of some type * @param version the version string * @return true if we're valid of some type, false otherwise */ public static boolean isVersionString(String version){ return toHeaderVersion(version) != null; }
/** * are we a valid version string of some type * @param version the version string * @return true if we're valid of some type, false otherwise */ public static boolean isVersionString(String version){ return toHeaderVersion(version) != null; }
public static VCFHeaderVersion getVCFHeaderVersion(VCFHeader vcfHeader){ Iterator<VCFHeaderLine> iter = vcfHeader.getMetaDataInInputOrder().iterator(); while(iter.hasNext()){ VCFHeaderLine hl = iter.next(); if(hl.getKey().equals("fileformat")){ return VCFHeaderVersion.toHeaderVersion(hl.getValue()); } } return null; }
public static VCFHeaderVersion getHeaderVersion(String versionLine) { String[] lineFields = versionLine.split("="); if ( lineFields.length != 2 || !isFormatString(lineFields[0].substring(2)) ) throw new TribbleException.InvalidHeader(versionLine + " is not a valid VCF version line"); if ( !isVersionString(lineFields[1]) ) throw new TribbleException.InvalidHeader(lineFields[1] + " is not a supported version"); return toHeaderVersion(lineFields[1]); }
public static VCFHeaderVersion getHeaderVersion(String versionLine) { String[] lineFields = versionLine.split("="); if ( lineFields.length != 2 || !isFormatString(lineFields[0].substring(2)) ) throw new TribbleException.InvalidHeader(versionLine + " is not a valid VCF version line"); if ( !isVersionString(lineFields[1]) ) throw new TribbleException.InvalidHeader(lineFields[1] + " is not a supported version"); return toHeaderVersion(lineFields[1]); }
public static VCFHeaderVersion getHeaderVersion(String versionLine) { String[] lineFields = versionLine.split("="); if ( lineFields.length != 2 || !isFormatString(lineFields[0].substring(2)) ) throw new TribbleException.InvalidHeader(versionLine + " is not a valid VCF version line"); if ( !isVersionString(lineFields[1]) ) throw new TribbleException.InvalidHeader(lineFields[1] + " is not a supported version"); return toHeaderVersion(lineFields[1]); }
@Override public void setHeader(VCFHeader header) { VCFHeaderVersion version = null; // Normally AbstractVCFCodec parses the header and thereby sets the // version field. It gets used later on so we need to set it. for (final VCFHeaderLine line : header.getMetaDataInInputOrder()) { if (VCFHeaderVersion.isFormatString(line.getKey())) { version = VCFHeaderVersion.toHeaderVersion(line.getValue()); break; } } codec.setHeaderAndVersion(header, version); }
@Override public void setHeader(VCFHeader header) { VCFHeaderVersion version = null; // Normally AbstractVCFCodec parses the header and thereby sets the // version field. It gets used later on so we need to set it. for (final VCFHeaderLine line : header.getMetaDataInInputOrder()) { if (VCFHeaderVersion.isFormatString(line.getKey())) { version = VCFHeaderVersion.toHeaderVersion(line.getValue()); break; } } codec.setHeaderAndVersion(header, version); }
@Override public void setHeader(VCFHeader header) { VCFHeaderVersion version = null; // Normally AbstractVCFCodec parses the header and thereby sets the // version field. It gets used later on so we need to set it. for (final VCFHeaderLine line : header.getMetaDataInInputOrder()) { if (VCFHeaderVersion.isFormatString(line.getKey())) { version = VCFHeaderVersion.toHeaderVersion(line.getValue()); break; } } codec.setHeaderAndVersion(header, version); }
hasSource = true; } else if (line.getKey().equals("fileformat")) { version = VCFHeaderVersion.toHeaderVersion(line.getValue()); if (version == null) { throw new IllegalArgumentException("malformed version: " + line.getValue());
throw new TribbleException.InvalidHeader(lineFields[1] + " is not a supported version"); foundHeaderVersion = true; version = VCFHeaderVersion.toHeaderVersion(lineFields[1]); if ( version != VCFHeaderVersion.VCF3_3 && version != VCFHeaderVersion.VCF3_2 ) throw new TribbleException.InvalidHeader("This codec is strictly for VCFv3 and does not support " + lineFields[1]);
throw new TribbleException.InvalidHeader(lineFields[1] + " is not a supported version"); foundHeaderVersion = true; version = VCFHeaderVersion.toHeaderVersion(lineFields[1]); if ( version != VCFHeaderVersion.VCF3_3 && version != VCFHeaderVersion.VCF3_2 ) throw new TribbleException.InvalidHeader("This codec is strictly for VCFv3 and does not support " + lineFields[1]);
throw new TribbleException.InvalidHeader(lineFields[1] + " is not a supported version"); foundHeaderVersion = true; version = VCFHeaderVersion.toHeaderVersion(lineFields[1]); if ( version != VCFHeaderVersion.VCF3_3 && version != VCFHeaderVersion.VCF3_2 ) throw new TribbleException.InvalidHeader("This codec is strictly for VCFv3 and does not support " + lineFields[1]);
throw new TribbleException.InvalidHeader(lineFields[1] + " is not a supported version"); foundHeaderVersion = true; version = VCFHeaderVersion.toHeaderVersion(lineFields[1]); if ( ! version.isAtLeastAsRecentAs(VCFHeaderVersion.VCF4_0) ) throw new TribbleException.InvalidHeader("This codec is strictly for VCFv4; please use the VCF3 codec for " + lineFields[1]);
throw new TribbleException.InvalidHeader(lineFields[1] + " is not a supported version"); foundHeaderVersion = true; version = VCFHeaderVersion.toHeaderVersion(lineFields[1]); if ( ! version.isAtLeastAsRecentAs(VCFHeaderVersion.VCF4_0) ) throw new TribbleException.InvalidHeader("This codec is strictly for VCFv4; please use the VCF3 codec for " + lineFields[1]);
throw new TribbleException.InvalidHeader(lineFields[1] + " is not a supported version"); foundHeaderVersion = true; version = VCFHeaderVersion.toHeaderVersion(lineFields[1]); if ( ! version.isAtLeastAsRecentAs(VCFHeaderVersion.VCF4_0) ) throw new TribbleException.InvalidHeader("This codec is strictly for VCFv4; please use the VCF3 codec for " + lineFields[1]);