Merged bug fix from Stable into Unstable
This commit is contained in:
commit
5451fbc2b2
|
|
@ -33,7 +33,7 @@ public class MVLikelihoodRatio extends InfoFieldAnnotation implements Experiment
|
||||||
|
|
||||||
public Map<String, Object> annotate(RefMetaDataTracker tracker, AnnotatorCompatibleWalker walker, ReferenceContext ref, Map<String, AlignmentContext> stratifiedContexts, VariantContext vc) {
|
public Map<String, Object> annotate(RefMetaDataTracker tracker, AnnotatorCompatibleWalker walker, ReferenceContext ref, Map<String, AlignmentContext> stratifiedContexts, VariantContext vc) {
|
||||||
if ( mendelianViolation == null ) {
|
if ( mendelianViolation == null ) {
|
||||||
if ( walker instanceof VariantAnnotator ) {
|
if ( walker instanceof VariantAnnotator && ((VariantAnnotator) walker).familyStr != null) {
|
||||||
mendelianViolation = new MendelianViolation(((VariantAnnotator)walker).familyStr, ((VariantAnnotator)walker).minGenotypeQualityP );
|
mendelianViolation = new MendelianViolation(((VariantAnnotator)walker).familyStr, ((VariantAnnotator)walker).minGenotypeQualityP );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -42,9 +42,9 @@ public class MVLikelihoodRatio extends InfoFieldAnnotation implements Experiment
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String,Object> toRet = new HashMap<String,Object>(1);
|
Map<String,Object> toRet = new HashMap<String,Object>(1);
|
||||||
boolean hasAppropriateGenotypes = vc.hasGenotype(mendelianViolation.getSampleChild()) &&
|
boolean hasAppropriateGenotypes = vc.hasGenotype(mendelianViolation.getSampleChild()) && vc.getGenotype(mendelianViolation.getSampleChild()).hasLikelihoods() &&
|
||||||
vc.hasGenotype(mendelianViolation.getSampleDad()) &&
|
vc.hasGenotype(mendelianViolation.getSampleDad()) && vc.getGenotype(mendelianViolation.getSampleDad()).hasLikelihoods() &&
|
||||||
vc.hasGenotype(mendelianViolation.getSampleMom());
|
vc.hasGenotype(mendelianViolation.getSampleMom()) && vc.getGenotype(mendelianViolation.getSampleMom()).hasLikelihoods();
|
||||||
if ( hasAppropriateGenotypes )
|
if ( hasAppropriateGenotypes )
|
||||||
toRet.put("MVLR",mendelianViolation.violationLikelihoodRatio(vc));
|
toRet.put("MVLR",mendelianViolation.violationLikelihoodRatio(vc));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,13 @@ public class TableCodec implements ReferenceDependentFeatureCodec {
|
||||||
public Object readHeader(LineReader reader) {
|
public Object readHeader(LineReader reader) {
|
||||||
String line = "";
|
String line = "";
|
||||||
try {
|
try {
|
||||||
|
boolean isFirst = true;
|
||||||
while ((line = reader.readLine()) != null) {
|
while ((line = reader.readLine()) != null) {
|
||||||
|
System.out.println(line);
|
||||||
|
if ( isFirst && ! line.startsWith(headerDelimiter) ) {
|
||||||
|
throw new UserException.MalformedFile("TableCodec file does not have a header");
|
||||||
|
}
|
||||||
|
isFirst &= false;
|
||||||
if (line.startsWith(headerDelimiter)) {
|
if (line.startsWith(headerDelimiter)) {
|
||||||
if (header.size() > 0) throw new IllegalStateException("Input table file seems to have two header lines. The second is = " + line);
|
if (header.size() > 0) throw new IllegalStateException("Input table file seems to have two header lines. The second is = " + line);
|
||||||
String spl[] = line.split(delimiterRegex);
|
String spl[] = line.split(delimiterRegex);
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
package org.broadinstitute.sting.utils.codecs.table;
|
package org.broadinstitute.sting.utils.codecs.table;
|
||||||
|
|
||||||
|
|
||||||
import org.broad.tribble.Feature;
|
import org.broad.tribble.Feature;
|
||||||
import org.broadinstitute.sting.utils.GenomeLoc;
|
import org.broadinstitute.sting.utils.GenomeLoc;
|
||||||
|
import org.broadinstitute.sting.utils.Utils;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -44,6 +46,10 @@ public class TableFeature implements Feature {
|
||||||
return values.get(columnPosition);
|
return values.get(columnPosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String toString() {
|
||||||
|
return String.format("%s\t%s",position.toString(), Utils.join("\t",values));
|
||||||
|
}
|
||||||
|
|
||||||
public String get(String columnName) {
|
public String get(String columnName) {
|
||||||
int position = keys.indexOf(columnName);
|
int position = keys.indexOf(columnName);
|
||||||
if (position < 0) throw new IllegalArgumentException("We don't have a column named " + columnName);
|
if (position < 0) throw new IllegalArgumentException("We don't have a column named " + columnName);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue