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
This commit is contained in:
parent
bf7cd66d53
commit
fa87dd386d
|
|
@ -73,7 +73,7 @@ public class IndelGenotyperWalker extends ReadWalker<Integer,Integer> {
|
||||||
private java.io.Writer output = null;
|
private java.io.Writer output = null;
|
||||||
private GenomeLoc location = null;
|
private GenomeLoc location = null;
|
||||||
|
|
||||||
private SeekableRODIterator<rodRefSeq> refseqIterator=null;
|
private SeekableRODIterator<rodRefSeq> refseqIterator=null;
|
||||||
|
|
||||||
private Set<String> normalReadGroups;
|
private Set<String> normalReadGroups;
|
||||||
private Set<String> tumorReadGroups ;
|
private Set<String> tumorReadGroups ;
|
||||||
|
|
@ -99,7 +99,7 @@ public class IndelGenotyperWalker extends ReadWalker<Integer,Integer> {
|
||||||
|
|
||||||
if ( RefseqFileName != null ) {
|
if ( RefseqFileName != null ) {
|
||||||
ReferenceOrderedData<rodRefSeq> refseq = new ReferenceOrderedData<rodRefSeq>("refseq",
|
ReferenceOrderedData<rodRefSeq> refseq = new ReferenceOrderedData<rodRefSeq>("refseq",
|
||||||
new java.io.File(RefseqFileName),rodRefSeq.class);
|
new java.io.File(RefseqFileName), rodRefSeq.class);
|
||||||
|
|
||||||
refseqIterator = refseq.iterator();
|
refseqIterator = refseq.iterator();
|
||||||
System.out.println("Using RefSeq annotations from "+RefseqFileName);
|
System.out.println("Using RefSeq annotations from "+RefseqFileName);
|
||||||
|
|
@ -416,11 +416,11 @@ public class IndelGenotyperWalker extends ReadWalker<Integer,Integer> {
|
||||||
|
|
||||||
location = GenomeLocParser.setStart(location,pos); location = GenomeLocParser.setStop(location,pos); // retrieve annotation data
|
location = GenomeLocParser.setStart(location,pos); location = GenomeLocParser.setStop(location,pos); // retrieve annotation data
|
||||||
RODRecordList<rodRefSeq> annotationList = (refseqIterator == null ? null : refseqIterator.seekForward(location));
|
RODRecordList<rodRefSeq> annotationList = (refseqIterator == null ? null : refseqIterator.seekForward(location));
|
||||||
rodRefSeq annotation = ( annotationList == null ? null : annotationList.getRecords().get(0) ) ;
|
|
||||||
Pair<IndelVariant,Integer> p = findConsensus(variants);
|
Pair<IndelVariant,Integer> p = findConsensus(variants);
|
||||||
if ( isCall(p,cov) ) {
|
if ( isCall(p,cov) ) {
|
||||||
String message = makeBedLine(p,cov,pos,output);
|
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);
|
if ( verbose ) out.println(message + "\t"+ annotationString);
|
||||||
}
|
}
|
||||||
|
|
@ -517,12 +517,11 @@ public class IndelGenotyperWalker extends ReadWalker<Integer,Integer> {
|
||||||
}
|
}
|
||||||
location = GenomeLocParser.setStart(location,pos); location = GenomeLocParser.setStop(location,pos); // retrieve annotation data
|
location = GenomeLocParser.setStart(location,pos); location = GenomeLocParser.setStop(location,pos); // retrieve annotation data
|
||||||
RODRecordList<rodRefSeq> annotationList = (refseqIterator == null ? null : refseqIterator.seekForward(location));
|
RODRecordList<rodRefSeq> annotationList = (refseqIterator == null ? null : refseqIterator.seekForward(location));
|
||||||
rodRefSeq annotation = ( annotationList == null ? null : annotationList.getRecords().get(0) ) ;
|
|
||||||
|
|
||||||
Pair<IndelVariant,Integer> p_tumor = findConsensus(tumor_variants);
|
Pair<IndelVariant,Integer> p_tumor = findConsensus(tumor_variants);
|
||||||
if ( isCall(p_tumor,tumor_cov) ) {
|
if ( isCall(p_tumor,tumor_cov) ) {
|
||||||
String message = makeBedLine(p_tumor,tumor_cov,pos);
|
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 ) {
|
if ( normal_variants.size() == 0 ) {
|
||||||
|
|
@ -560,20 +559,20 @@ public class IndelGenotyperWalker extends ReadWalker<Integer,Integer> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private String getAnnotationString(rodRefSeq ann) {
|
private String getAnnotationString(RODRecordList<rodRefSeq> ann) {
|
||||||
if ( ann == null ) return annGenomic;
|
if ( ann == null ) return annGenomic;
|
||||||
else {
|
else {
|
||||||
StringBuilder b = new StringBuilder();
|
StringBuilder b = new StringBuilder();
|
||||||
if ( ann.isExon() ) {
|
|
||||||
if ( ann.isCoding() ) b.append(annCoding);
|
if ( rodRefSeq.isExon(ann) ) {
|
||||||
else b.append(annUTR);
|
if ( rodRefSeq.isCoding(ann) ) b.append(annCoding); // both exon and coding = coding exon sequence
|
||||||
|
else b.append(annUTR); // exon but not coding = UTR
|
||||||
} else {
|
} else {
|
||||||
if ( ann.isCoding() ) b.append(annIntron);
|
if ( rodRefSeq.isCoding(ann) ) b.append(annIntron); // not in exon, but within the coding region = intron
|
||||||
else b.append(annUnknown);
|
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');
|
b.append('\t');
|
||||||
Iterator<Transcript> it = ann.getTranscripts().iterator();
|
b.append(((Transcript)ann.getRecords().get(0)).getGeneName()); // there is at least one transcript in the list, guaranteed
|
||||||
b.append(it.next().getGeneName()); // there is at least one transcript in the list, guaranteed
|
|
||||||
// while ( it.hasNext() ) { //
|
// while ( it.hasNext() ) { //
|
||||||
// t.getGeneName()
|
// t.getGeneName()
|
||||||
// }
|
// }
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue