Added convenience methods to check/get the ID of the VariantContext

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4578 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
ebanks 2010-10-27 01:56:58 +00:00
parent a7af1a164b
commit 52fc023d80
3 changed files with 4 additions and 4 deletions

View File

@ -403,8 +403,8 @@ public class VariantContextUtils {
//
if ( vc.hasAttribute(VCFConstants.DEPTH_KEY) )
depth += Integer.valueOf(vc.getAttributeAsString(VCFConstants.DEPTH_KEY));
if ( rsID == null && vc.hasAttribute(VariantContext.ID_KEY) )
rsID = vc.getAttributeAsString(VariantContext.ID_KEY);
if ( rsID == null && vc.hasID() )
rsID = vc.getID();
for ( Map.Entry<String, Object> p : vc.getAttributes().entrySet() ) {
String key = p.getKey();

View File

@ -86,7 +86,7 @@ public class AnnotationDataManager {
treeSet.add(datum);
}
final boolean isNovelVariant = !infoField.get(VariantContext.ID_KEY).toString().contains("rs");
final boolean isNovelVariant = !vc.hasID() || !vc.getID().contains("rs");
// Decide if the variant is a transition or transversion
if( VariantContextUtils.getSNPSubstitutionType(vc).compareTo(BaseUtils.BaseSubstitutionType.TRANSITION) == 0 ) {

View File

@ -402,7 +402,7 @@ public class VariantEvalWalker extends RodWalker<Integer, Integer> implements Tr
}
private boolean excludeComp(VariantContext vc) {
String id = vc != null && vc.hasAttribute(VariantContext.ID_KEY) ? vc.getAttributeAsString(VariantContext.ID_KEY) : null;
String id = vc != null && vc.hasID() ? vc.getID() : null;
boolean ex = rsIDsToExclude != null && id != null && rsIDsToExclude.contains(id);
//System.out.printf("Testing id %s ex=%b against %s%n", id, ex, vc);
return ex;