A new ROD type that allows one to input a geli.calls file back into a walker.
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@1036 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
9ef391706c
commit
ab2a80f3ea
|
|
@ -0,0 +1,78 @@
|
|||
package org.broadinstitute.sting.gatk.refdata;
|
||||
|
||||
import org.broadinstitute.sting.utils.GenomeLoc;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class rodVariants extends BasicReferenceOrderedDatum {
|
||||
private GenomeLoc loc;
|
||||
private char refBase = 'N';
|
||||
private int depth;
|
||||
private int maxMappingQuality;
|
||||
private String bestGenotype = "NN";
|
||||
private float lodBtr;
|
||||
private float lodBtnb;
|
||||
private float[] genotypeLikelihoods = new float[10];
|
||||
|
||||
public rodVariants(final String name) { super(name); }
|
||||
|
||||
public String delimiterRegex() { return "\\s+"; }
|
||||
|
||||
public boolean parseLine(Object header, String[] parts) throws IOException {
|
||||
if (!parts[0].startsWith("#")) {
|
||||
loc = new GenomeLoc(parts[0], Long.valueOf(parts[1]));
|
||||
refBase = parts[2].charAt(0);
|
||||
depth = Integer.valueOf(parts[3]);
|
||||
maxMappingQuality = Integer.valueOf(parts[4]);
|
||||
bestGenotype = parts[5];
|
||||
lodBtr = Float.valueOf(parts[6]);
|
||||
lodBtnb = Float.valueOf(parts[7]);
|
||||
|
||||
for (int pieceIndex = 8, offset = 0; pieceIndex < 18; pieceIndex++, offset++) {
|
||||
genotypeLikelihoods[offset] = Float.valueOf(parts[pieceIndex]);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return String.format("%s %c %d %d %s %4.4f %4.4f %f %f %f %f %f %f %f %f %f %f",
|
||||
loc,
|
||||
refBase,
|
||||
depth,
|
||||
maxMappingQuality,
|
||||
bestGenotype,
|
||||
lodBtr,
|
||||
lodBtnb,
|
||||
genotypeLikelihoods[0],
|
||||
genotypeLikelihoods[1],
|
||||
genotypeLikelihoods[2],
|
||||
genotypeLikelihoods[3],
|
||||
genotypeLikelihoods[4],
|
||||
genotypeLikelihoods[5],
|
||||
genotypeLikelihoods[6],
|
||||
genotypeLikelihoods[7],
|
||||
genotypeLikelihoods[8],
|
||||
genotypeLikelihoods[9]
|
||||
);
|
||||
}
|
||||
|
||||
public GenomeLoc getLocation() { return loc; }
|
||||
|
||||
public char getReferenceBase() { return refBase; }
|
||||
|
||||
public int getPileupDepth() { return depth; }
|
||||
|
||||
public int getMaxMappingQuality() { return maxMappingQuality; }
|
||||
|
||||
public String getBestGenotype() { return bestGenotype; }
|
||||
|
||||
public float getLodBtr() { return lodBtr; }
|
||||
|
||||
public float getLodBtnb() { return lodBtnb; }
|
||||
|
||||
public float[] getGenotypeLikelihoods() { return genotypeLikelihoods; }
|
||||
}
|
||||
Loading…
Reference in New Issue