From d45c90b1669f9dc0817606154861686196487fc8 Mon Sep 17 00:00:00 2001 From: ebanks Date: Fri, 17 Jul 2009 14:36:12 +0000 Subject: [PATCH] ROD to represent simple output from IndelGenotyper git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@1274 348d0f76-0448-11de-a6fe-93d51630548a --- .../sting/gatk/refdata/SimpleIndelROD.java | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100755 java/src/org/broadinstitute/sting/gatk/refdata/SimpleIndelROD.java diff --git a/java/src/org/broadinstitute/sting/gatk/refdata/SimpleIndelROD.java b/java/src/org/broadinstitute/sting/gatk/refdata/SimpleIndelROD.java new file mode 100755 index 000000000..6cb8c7cda --- /dev/null +++ b/java/src/org/broadinstitute/sting/gatk/refdata/SimpleIndelROD.java @@ -0,0 +1,43 @@ +package org.broadinstitute.sting.gatk.refdata; + +import org.broadinstitute.sting.utils.GenomeLoc; +import org.broadinstitute.sting.utils.GenomeLocParser; + +import java.util.*; + +public class SimpleIndelROD extends TabularROD implements Genotype { + + public SimpleIndelROD(String name) { + super(name); + } + + public GenomeLoc getLocation() { + return GenomeLocParser.createGenomeLoc(this.get("0"), Long.parseLong(this.get("1"))); + } + + public List getFWDAlleles() { + String str = this.get("3"); + return Arrays.asList(str.substring(0, str.indexOf(":"))); + } + + public String getFWDRefBases() { return ""; } + public char getRef() { return 'N'; } + public boolean isPointGenotype() { return false; } + public boolean isIndelGenotype() { return true; } + public boolean isSNP() { return false; } + public boolean isReference() { return false; } + public boolean isInsertion() { return this.get("3").charAt(0) == '+'; } + public boolean isDeletion() { return this.get("3").charAt(0) == '-'; } + public boolean isIndel() { return false; } + public double getVariantConfidence() { return 0.0; } + public double getConsensusConfidence() { return 0.0; } + public boolean isBiallelic() { return true; } + public boolean isHom() { return false; } + public boolean isHet() { return false; } + + public String toString() { + StringBuffer sb = new StringBuffer(); + sb.append(getLocation() + "\t" + getFWDAlleles().get(0)); + return sb.toString(); + } + } \ No newline at end of file