print output as a GFF line.

still need to add printing GFF intervals for stretches of confident reference calls.

does the GFF ROD class handle intervals?? We'll find out. >:)


git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@225 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
jmaguire 2009-03-30 17:47:35 +00:00
parent b752960586
commit 875802e8fc
3 changed files with 17 additions and 2 deletions

View File

@ -174,7 +174,8 @@ public class AlleleFrequencyMetricsWalker extends LocusWalker<AlleleFrequencyEst
{
// Print RESULT data for confident calls
//if ((alleleFreq.lodVsRef >= 5) || (alleleFreq.lodVsRef <= -5)) { System.out.print(alleleFreq.asTabularString()); }
out.print(alleleFreq.asTabularString());
//out.print(alleleFreq.asTabularString());
if ((alleleFreq.lodVsRef >= 5) || (alleleFreq.lodVsRef <= -5)) { System.out.print(alleleFreq.asGFFString()); }
if (this.num_loci_total % 1000 == 0) { printMetrics(); }

View File

@ -353,7 +353,7 @@ public class AlleleFrequencyWalker extends LocusWalker<AlleleFrequencyEstimate,
public Integer reduce(AlleleFrequencyEstimate alleleFreq, Integer sum)
{
// Print RESULT data for confident calls
if ((alleleFreq.lodVsRef >= 5) || (alleleFreq.lodVsRef <= -5)) { System.out.print(alleleFreq.asTabularString()); }
if ((alleleFreq.lodVsRef >= 5) || (alleleFreq.lodVsRef <= -5)) { System.out.print(alleleFreq.asGFFString()); }
return 0;
}

View File

@ -29,6 +29,20 @@ public class AlleleFrequencyEstimate {
this.notes = "";
}
public String asGFFString()
{
String[] tokens;
tokens = location.split(":");
return String.format("%s\tCALLER\tVARIANT\t%s\t%s\t%f\t.\t.\tREF \"%c\"\t;\tALT \"%c\"\t;\tFREQ %f\n",
tokens[0],
tokens[1],
tokens[1],
lodVsRef,
ref,
alt,
qhat);
}
public String asTabularString() {
return String.format("RESULT %s %c %c %f %f %f %f %d %s\n",
location,