a) Misc fixes in Phase1 indel vqsr script,
b) More R-friendly VariantsToTable printing of AC in case of multiple alt alleles c) Rename FixPLOrderingWalker to FixGenotypesWalker and rewrote: no longer need older code, replaced with code to replace genotypes with all-zero PL's with a no-call.
This commit is contained in:
parent
782453235a
commit
8ae24912f4
|
|
@ -99,22 +99,24 @@ public class CountVariants extends VariantEvaluator implements StandardEval {
|
||||||
// This is really not correct. What we really want here is a polymorphic vs. monomorphic count (i.e. on the Genotypes).
|
// This is really not correct. What we really want here is a polymorphic vs. monomorphic count (i.e. on the Genotypes).
|
||||||
// So in order to maintain consistency with the previous implementation (and the intention of the original author), I've
|
// So in order to maintain consistency with the previous implementation (and the intention of the original author), I've
|
||||||
// added in a proxy check for monomorphic status here.
|
// added in a proxy check for monomorphic status here.
|
||||||
if ( !vc1.isVariant() || (vc1.hasGenotypes() && vc1.getHomRefCount() == vc1.getNSamples()) ) {
|
if ( !vc1.isVariant() || (vc1.hasGenotypes() && vc1.getHomRefCount() + vc1.getNoCallCount() == vc1.getNSamples()) ) {
|
||||||
nRefLoci++;
|
nRefLoci++;
|
||||||
} else {
|
} else {
|
||||||
nVariantLoci++;
|
switch (vc1.getType()) {
|
||||||
switch (vc1.getType()) {
|
|
||||||
case NO_VARIATION:
|
case NO_VARIATION:
|
||||||
break;
|
break;
|
||||||
case SNP:
|
case SNP:
|
||||||
|
nVariantLoci++;
|
||||||
nSNPs++;
|
nSNPs++;
|
||||||
if (vc1.getAttributeAsBoolean("ISSINGLETON")) nSingletons++;
|
if (vc1.getAttributeAsBoolean("ISSINGLETON")) nSingletons++;
|
||||||
break;
|
break;
|
||||||
case MNP:
|
case MNP:
|
||||||
|
nVariantLoci++;
|
||||||
nMNPs++;
|
nMNPs++;
|
||||||
if (vc1.getAttributeAsBoolean("ISSINGLETON")) nSingletons++;
|
if (vc1.getAttributeAsBoolean("ISSINGLETON")) nSingletons++;
|
||||||
break;
|
break;
|
||||||
case INDEL:
|
case INDEL:
|
||||||
|
nVariantLoci++;
|
||||||
if (vc1.isSimpleInsertion())
|
if (vc1.isSimpleInsertion())
|
||||||
nInsertions++;
|
nInsertions++;
|
||||||
else if (vc1.isSimpleDeletion())
|
else if (vc1.isSimpleDeletion())
|
||||||
|
|
@ -123,6 +125,7 @@ public class CountVariants extends VariantEvaluator implements StandardEval {
|
||||||
nComplex++;
|
nComplex++;
|
||||||
break;
|
break;
|
||||||
case MIXED:
|
case MIXED:
|
||||||
|
nVariantLoci++;
|
||||||
nMixed++;
|
nMixed++;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
|
|
@ -206,28 +206,12 @@ public class VariantsToTable extends RodWalker<Integer, Integer> {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (field.equals("AF") || field.equals("AC")) {
|
if (field.equals("AF") || field.equals("AC")) {
|
||||||
String afo = val;
|
if (val.contains(",")) {
|
||||||
|
// strip [,] and spaces
|
||||||
double af=0;
|
val = val.replace("[","");
|
||||||
if (afo.contains(",")) {
|
val = val.replace("]","");
|
||||||
String[] afs = afo.split(",");
|
val = val.replace(" ","");
|
||||||
afs[0] = afs[0].substring(1,afs[0].length());
|
}
|
||||||
afs[afs.length-1] = afs[afs.length-1].substring(0,afs[afs.length-1].length()-1);
|
|
||||||
|
|
||||||
double[] afd = new double[afs.length];
|
|
||||||
|
|
||||||
for (int k=0; k < afd.length; k++)
|
|
||||||
afd[k] = Double.valueOf(afs[k]);
|
|
||||||
|
|
||||||
af = MathUtils.arrayMax(afd);
|
|
||||||
//af = Double.valueOf(afs[0]);
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
if (!afo.equals("NA"))
|
|
||||||
af = Double.valueOf(afo);
|
|
||||||
|
|
||||||
val = Double.toString(af);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
vals.add(val);
|
vals.add(val);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue