bed-style output for IGV

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@721 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
kcibul 2009-05-15 17:58:44 +00:00
parent 36db44620b
commit d1f3000afa
1 changed files with 33 additions and 14 deletions

View File

@ -57,6 +57,8 @@ public class SomaticMutationWalker extends LocusWalker<Integer, Integer> {
@Argument(fullName = "normal_sample_name", shortName = "s2", required = true, doc="Name of the normal sample") @Argument(fullName = "normal_sample_name", shortName = "s2", required = true, doc="Name of the normal sample")
public String normalSampleName; public String normalSampleName;
public boolean bedOutput = true;
public void initialize() { public void initialize() {
} }
@ -174,10 +176,11 @@ public class SomaticMutationWalker extends LocusWalker<Integer, Integer> {
} }
// make sure we've seen at least 1 obs of the alternate allele within 20bp of the read-middle // make sure we've seen at least 1 obs of the alternate allele within 20bp of the read-middle
if (midp.get(altAllele) > 20) { boolean failedMidpointCheck = midp.get(altAllele) > 20;
out.println("Rejecting due to midpoint check!"); // if (failedMidpointCheck) {
return 0; // out.println("Rejecting due to midpoint check!");
} // return 0;
// }
double[] refAlt = extractRefAlt(normalGL, ref, altAllele); double[] refAlt = extractRefAlt(normalGL, ref, altAllele);
double normalLod = refAlt[0] - Math.log10(refAlt[1] + refAlt[2]); double normalLod = refAlt[0] - Math.log10(refAlt[1] + refAlt[2]);
@ -190,6 +193,21 @@ public class SomaticMutationWalker extends LocusWalker<Integer, Integer> {
// if we're still here... we've got a somatic mutation! Output the results // if we're still here... we've got a somatic mutation! Output the results
// and stop looking for mutants! // and stop looking for mutants!
if (bedOutput) {
out.println(
context.getContig() + "\t" +
context.getPosition() + "\t" +
context.getPosition() + "\t" +
"TScore:" + tumorLod +
"__TRefSum: " + tumorQualitySums.get(ref) +
"__TAltSum: " + tumorQualitySums.get(altAllele) +
"__NScore:" + normalLod +
"__NRefSum: " + normalQualitySums.get(ref) +
"__NAltSum: " + normalQualitySums.get(altAllele) +
(failedMidpointCheck?"__FAILED-MPCHECK":"")
);
} else {
out.println(context.getLocation() + " " + upRef + " " + altAllele + out.println(context.getLocation() + " " + upRef + " " + altAllele +
" TScore:" + tumorLod + " TScore:" + tumorLod +
" TRefSum: " + tumorQualitySums.get(ref) + " TRefSum: " + tumorQualitySums.get(ref) +
@ -200,6 +218,7 @@ public class SomaticMutationWalker extends LocusWalker<Integer, Integer> {
tumorBases.toString() + " " + tumorBases.toString() + " " +
normalBases.toString() normalBases.toString()
); );
}
return 1; return 1;