From fa87dd386dc07518e55ff0abe144fffa8fa89046 Mon Sep 17 00:00:00 2001 From: asivache Date: Wed, 23 Sep 2009 18:19:36 +0000 Subject: [PATCH] Now uses rodRefSeq in its new reincarnation git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@1698 348d0f76-0448-11de-a6fe-93d51630548a --- .../walkers/indels/IndelGenotyperWalker.java | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/java/src/org/broadinstitute/sting/playground/gatk/walkers/indels/IndelGenotyperWalker.java b/java/src/org/broadinstitute/sting/playground/gatk/walkers/indels/IndelGenotyperWalker.java index 81965dd6b..3eec98397 100644 --- a/java/src/org/broadinstitute/sting/playground/gatk/walkers/indels/IndelGenotyperWalker.java +++ b/java/src/org/broadinstitute/sting/playground/gatk/walkers/indels/IndelGenotyperWalker.java @@ -73,7 +73,7 @@ public class IndelGenotyperWalker extends ReadWalker { private java.io.Writer output = null; private GenomeLoc location = null; - private SeekableRODIterator refseqIterator=null; + private SeekableRODIterator refseqIterator=null; private Set normalReadGroups; private Set tumorReadGroups ; @@ -99,7 +99,7 @@ public class IndelGenotyperWalker extends ReadWalker { if ( RefseqFileName != null ) { ReferenceOrderedData refseq = new ReferenceOrderedData("refseq", - new java.io.File(RefseqFileName),rodRefSeq.class); + new java.io.File(RefseqFileName), rodRefSeq.class); refseqIterator = refseq.iterator(); System.out.println("Using RefSeq annotations from "+RefseqFileName); @@ -416,11 +416,11 @@ public class IndelGenotyperWalker extends ReadWalker { location = GenomeLocParser.setStart(location,pos); location = GenomeLocParser.setStop(location,pos); // retrieve annotation data RODRecordList annotationList = (refseqIterator == null ? null : refseqIterator.seekForward(location)); - rodRefSeq annotation = ( annotationList == null ? null : annotationList.getRecords().get(0) ) ; + Pair p = findConsensus(variants); if ( isCall(p,cov) ) { String message = makeBedLine(p,cov,pos,output); - String annotationString = (refseqIterator == null ? "" : getAnnotationString(annotation)); + String annotationString = (refseqIterator == null ? "" : getAnnotationString(annotationList)); if ( verbose ) out.println(message + "\t"+ annotationString); } @@ -517,12 +517,11 @@ public class IndelGenotyperWalker extends ReadWalker { } location = GenomeLocParser.setStart(location,pos); location = GenomeLocParser.setStop(location,pos); // retrieve annotation data RODRecordList annotationList = (refseqIterator == null ? null : refseqIterator.seekForward(location)); - rodRefSeq annotation = ( annotationList == null ? null : annotationList.getRecords().get(0) ) ; Pair p_tumor = findConsensus(tumor_variants); if ( isCall(p_tumor,tumor_cov) ) { String message = makeBedLine(p_tumor,tumor_cov,pos); - String annotationString = (refseqIterator == null ? "" : getAnnotationString(annotation)); + String annotationString = (refseqIterator == null ? "" : getAnnotationString(annotationList)); if ( normal_variants.size() == 0 ) { @@ -560,20 +559,20 @@ public class IndelGenotyperWalker extends ReadWalker { } - private String getAnnotationString(rodRefSeq ann) { + private String getAnnotationString(RODRecordList ann) { if ( ann == null ) return annGenomic; else { StringBuilder b = new StringBuilder(); - if ( ann.isExon() ) { - if ( ann.isCoding() ) b.append(annCoding); - else b.append(annUTR); + + if ( rodRefSeq.isExon(ann) ) { + if ( rodRefSeq.isCoding(ann) ) b.append(annCoding); // both exon and coding = coding exon sequence + else b.append(annUTR); // exon but not coding = UTR } else { - if ( ann.isCoding() ) b.append(annIntron); - else b.append(annUnknown); + if ( rodRefSeq.isCoding(ann) ) b.append(annIntron); // not in exon, but within the coding region = intron + else b.append(annUnknown); // we have no idea what this is. this may actually happen when we have a fully non-coding exon... } b.append('\t'); - Iterator it = ann.getTranscripts().iterator(); - b.append(it.next().getGeneName()); // there is at least one transcript in the list, guaranteed + b.append(((Transcript)ann.getRecords().get(0)).getGeneName()); // there is at least one transcript in the list, guaranteed // while ( it.hasNext() ) { // // t.getGeneName() // }