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,16 +193,32 @@ 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!
out.println(context.getLocation() + " " + upRef + " " + altAllele + if (bedOutput) {
" TScore:" + tumorLod + out.println(
" TRefSum: " + tumorQualitySums.get(ref) + context.getContig() + "\t" +
" TAltSum: " + tumorQualitySums.get(altAllele) + context.getPosition() + "\t" +
" NScore:" + normalLod + context.getPosition() + "\t" +
" NRefSum: " + normalQualitySums.get(ref) + "TScore:" + tumorLod +
" NAltSum: " + normalQualitySums.get(altAllele) + " " + "__TRefSum: " + tumorQualitySums.get(ref) +
tumorBases.toString() + " " + "__TAltSum: " + tumorQualitySums.get(altAllele) +
normalBases.toString() "__NScore:" + normalLod +
); "__NRefSum: " + normalQualitySums.get(ref) +
"__NAltSum: " + normalQualitySums.get(altAllele) +
(failedMidpointCheck?"__FAILED-MPCHECK":"")
);
} else {
out.println(context.getLocation() + " " + upRef + " " + altAllele +
" TScore:" + tumorLod +
" TRefSum: " + tumorQualitySums.get(ref) +
" TAltSum: " + tumorQualitySums.get(altAllele) +
" NScore:" + normalLod +
" NRefSum: " + normalQualitySums.get(ref) +
" NAltSum: " + normalQualitySums.get(altAllele) + " " +
tumorBases.toString() + " " +
normalBases.toString()
);
}
return 1; return 1;