Fixes for IndelLengthHistogram for someone on GS. This evaluator apparently doesn't have an integration test. I'll fix that tonight.

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@5166 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
kiran 2011-02-01 19:48:09 +00:00
parent 06b63d8336
commit dac83d21bc
2 changed files with 16 additions and 6 deletions

View File

@ -762,7 +762,14 @@ public class VariantEvalWalker extends RodWalker<Integer, Integer> implements Tr
}
for ( Object o : t.getColumnKeys() ) {
String c = (String) o;
String c;
if (o instanceof String) {
c = (String) o;
} else {
c = o.toString();
}
table.addColumn(c, 0.0);
}
} else {
@ -779,7 +786,12 @@ public class VariantEvalWalker extends RodWalker<Integer, Integer> implements Tr
}
for (int col = 0; col < t.getColumnKeys().length; col++) {
String c = (String) t.getColumnKeys()[col];
String c;
if (t.getColumnKeys()[col] instanceof String) {
c = (String) t.getColumnKeys()[col];
} else {
c = t.getColumnKeys()[col].toString();
}
String newStateKey = stateKey.toString() + r;
table.set(newStateKey, c, t.getCell(row, col));

View File

@ -17,7 +17,7 @@ import org.broadinstitute.sting.utils.report.utils.TableType;
*/
@Analysis(name = "Indel length histograms", description = "Shows the distrbution of insertion/deletion event lengths (negative for deletion, positive for insertion)")
public class IndelLengthHistogram extends VariantEvaluator {
private static final int SIZE_LIMIT = 50;
private static final int SIZE_LIMIT = 100;
@DataPoint(description="Histogram of indel lengths")
IndelHistogram indelHistogram = new IndelHistogram(SIZE_LIMIT);
@ -83,21 +83,19 @@ public class IndelLengthHistogram extends VariantEvaluator {
}
}
public boolean enabled() { return false; }
public boolean enabled() { return true; }
public String getName() { return "IndelLengthHistogram"; }
public int getComparisonOrder() { return 1; } // need only the evals
public String update1(VariantContext vc1, RefMetaDataTracker tracker, ReferenceContext ref, AlignmentContext context) {
//System.out.println("Update1 called");
if ( ! vc1.isBiallelic() && vc1.isIndel() ) {
//veWalker.getLogger().warn("[IndelLengthHistogram] Non-biallelic indel at "+ref.getLocus()+" ignored.");
return vc1.toString(); // biallelic sites are output
}
if ( vc1.isIndel() ) {
//System.out.println("Is indel");
if ( vc1.isInsertion() ) {
indelHistogram.update(vc1.getAlternateAllele(0).length());
} else if ( vc1.isDeletion() ) {