public String getID() { return variantContext.getID(); }
public boolean hasID() { return getID() != VCFConstants.EMPTY_ID_FIELD; }
public boolean hasID() { return getID() != VCFConstants.EMPTY_ID_FIELD; }
public boolean hasID() { return getID() != VCFConstants.EMPTY_ID_FIELD; }
public void run(final VariantContext vc) { vc.getID(); } };
private void buildID( VariantContext vc ) throws IOException { encoder.encodeTypedString(vc.getID()); }
private void buildID( VariantContext vc ) throws IOException { encoder.encodeTypedString(vc.getID()); }
private String getBreakendPairId(VariantContext variantContext) { // The id for the breakend pair will be the two BND Ids alphabetically sorted and concatenated by a '_' List<String> ids = Arrays.asList(variantContext.getID(), (String) variantContext.getCommonInfo().getAttributes().get(MATEID)); Collections.sort(ids); return StringUtils.join(ids, "_"); }
public void validateRSIDs(Set<String> rsIDs) { if ( rsIDs != null && hasID() ) { for ( String id : getID().split(VCFConstants.ID_FIELD_SEPARATOR) ) { if ( id.startsWith("rs") && !rsIDs.contains(id) ) throw new TribbleException.InternalCodecException(String.format("the rsID %s for the record at position %s:%d is not in dbSNP", id, getChr(), getStart())); } } }
public void validateRSIDs(Set<String> rsIDs) { if ( rsIDs != null && hasID() ) { for ( String id : getID().split(VCFConstants.ID_FIELD_SEPARATOR) ) { if ( id.startsWith("rs") && !rsIDs.contains(id) ) throw new TribbleException.InternalCodecException(String.format("the rsID %s for the record at position %s:%d is not in dbSNP", id, getContig(), getStart())); } } }
public void validateRSIDs(Set<String> rsIDs) { if ( rsIDs != null && hasID() ) { for ( String id : getID().split(VCFConstants.ID_FIELD_SEPARATOR) ) { if ( id.startsWith("rs") && !rsIDs.contains(id) ) throw new TribbleException.InternalCodecException(String.format("the rsID %s for the record at position %s:%d is not in dbSNP", id, getContig(), getStart())); } } }
public int compare(VariantContext o1, VariantContext o2) { return ComparisonChain.start() .compare(dictionary.getSequenceIndex(o1.getContig()), dictionary.getSequenceIndex(o2.getContig())) .compare(o1.getEnd(), o2.getEnd()) .compare(o1.getStart(), o2.getStart()) .compare(o1.getID(), o2.getID()) .result(); } };
private static String getID(VariantContext v) { if ( v.hasID() ) { return v.getID(); } else { return String.format("Var-%s-%d",v.getChr(),v.getStart()); } }
@Test(dataProvider = "AnnotateRsIDData") public void testAnnotateRsID(final VariantContext toAnnotate, final List<VariantContext> dbSNPRecords, final String expectedID, final boolean expectOverlap) throws Exception { final VariantOverlapAnnotator annotator = makeAnnotator("dbnsp"); final VariantContext annotated = annotator.annotateRsID(dbSNPRecords, toAnnotate); Assert.assertNotNull(annotated); Assert.assertEquals(annotated.getID(), expectedID); }
@Test(dataProvider = "AnnotateRsIDData") public void testAnnotateOverlaps(final VariantContext toAnnotate, final List<VariantContext> records, final String expectedID, final boolean expectOverlap) throws Exception { final String name = "binding"; final VariantOverlapAnnotator annotator = makeAnnotator(null, name); final VariantContext annotated = annotator.annotateOverlap(records, name, toAnnotate); Assert.assertNotNull(annotated); Assert.assertEquals(annotated.getID(), toAnnotate.getID(), "Shouldn't modify annotation"); Assert.assertEquals(annotated.hasAttribute(name), expectOverlap); if ( expectOverlap ) { Assert.assertEquals(annotated.getAttribute(name), true); } } }
@Test(enabled = !DEBUG, dataProvider = "simplemergersiddata") public void testRSIDMerge(SimpleMergeRSIDTest cfg) { VariantContext snpVC1 = makeVC("snpvc1", Arrays.asList(Aref, T)); final List<VariantContext> inputs = new ArrayList<VariantContext>(); for ( final String id : cfg.inputs ) { inputs.add(new VariantContextBuilder(snpVC1).id(id).make()); } final VariantContext merged = GATKVariantContextUtils.simpleMerge( inputs, null, GATKVariantContextUtils.FilteredRecordMergeType.KEEP_IF_ANY_UNFILTERED, GATKVariantContextUtils.GenotypeMergeType.UNSORTED, false, false, "set", false, false); Assert.assertEquals(merged.getID(), cfg.expected); }
/** * Copy constructor * * @param other the VariantContext to copy */ protected VariantContext(VariantContext other) { this(other.getSource(), other.getID(), other.getContig(), other.getStart(), other.getEnd(), other.getAlleles(), other.getGenotypes(), other.getLog10PError(), other.getFiltersMaybeNull(), other.getAttributes(), other.fullyDecoded, NO_VALIDATION); }
/** * Copy constructor * * @param other the VariantContext to copy */ protected VariantContext(VariantContext other) { this(other.getSource(), other.getID(), other.getChr(), other.getStart(), other.getEnd(), other.getAlleles(), other.getGenotypes(), other.getLog10PError(), other.getFiltersMaybeNull(), other.getAttributes(), other.fullyDecoded, NO_VALIDATION); }
/** * Copy constructor * * @param other the VariantContext to copy */ protected VariantContext(VariantContext other) { this(other.getSource(), other.getID(), other.getContig(), other.getStart(), other.getEnd(), other.getAlleles(), other.getGenotypes(), other.getLog10PError(), other.getFiltersMaybeNull(), other.getAttributes(), other.fullyDecoded, NO_VALIDATION); }