Remove RefSeq INFO from MNPs since annotating them properly

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4784 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
fromer 2010-12-03 19:03:35 +00:00
parent 4719bbc772
commit 6d4ec7f9e7
2 changed files with 14 additions and 1 deletions

View File

@ -190,7 +190,7 @@ public class AnnotateMNPsWalker extends RodWalker<Integer, Integer> {
logger.debug("Current list of per-locus features\n" + locusToRefSeqFeatures);
Map<String, Object> MNPannotations = annotateMNP(vc);
MNPannotations.putAll(vc.getAttributes());
MNPannotations.putAll(RefSeqDataParser.removeRefSeqAttributes(vc.getAttributes())); // remove any RefSeq INFO, since adding it in more thoroughly here
vc = VariantContext.modifyAttributes(vc, MNPannotations);
writeVCF(vc);

View File

@ -132,6 +132,19 @@ public class RefSeqDataParser {
return refSeqNameAttribs;
}
public static Map<String, Object> removeRefSeqAttributes(Map<String, Object> attributes) {
Map<String, Object> removedRefSeqAttributes = new HashMap<String, Object>(attributes);
Iterator<Map.Entry<String, Object>> attrIt = removedRefSeqAttributes.entrySet().iterator();
while (attrIt.hasNext()) {
String key = attrIt.next().getKey();
if (key.startsWith(REFSEQ_PREFIX))
attrIt.remove();
}
return removedRefSeqAttributes;
}
private static Map<String, RefSeqEntry> getAllRefSeqEntriesByName(VariantContext vc) {
Map<String, RefSeqEntry> nameToEntries = new TreeMap<String, RefSeqEntry>();