VariantAnnotator now adds dbsnp id if a dbsnp rod is supplied and it's not already set for a record

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@2100 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
ebanks 2009-11-20 03:26:09 +00:00
parent b434c1c240
commit 2a5349d886
1 changed files with 6 additions and 0 deletions

View File

@ -215,6 +215,12 @@ public class VariantAnnotator extends RodWalker<Integer, Integer> {
VCFRecord rec = getVCFRecord(tracker, ref, context, variant);
if ( rec != null ) {
rec.addInfoFields(annotations);
// also, annotate dbsnp id if available and not already there
if ( rec.getID() == null || rec.getID().equals(".") ) {
rodDbSNP dbsnp = rodDbSNP.getFirstRealSNP(tracker.getTrackData("dbsnp", null));
if ( dbsnp != null )
rec.setID(dbsnp.getRS_ID());
}
vcfWriter.addRecord(rec);
}
}