improvements to VCF and variant eval support of VCF -- now listens to the filter field

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@1963 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
depristo 2009-11-03 12:09:30 +00:00
parent c313abf0be
commit 5d5dc989e7
2 changed files with 15 additions and 2 deletions

View File

@ -232,6 +232,11 @@ public class VariantEvalWalker extends RodWalker<Integer, Integer> {
if (eval != null)
if (eval.getNegLog10PError() < minConfidenceScore) eval = null;
if ( eval != null && (eval instanceof RodVCF) && ((RodVCF)eval).mCurrentRecord.isFiltered() ) {
//System.out.printf("Rejecting filtered record %s%n", eval);
eval = null;
}
// update stats about all of the SNPs
updateAnalysisSet(ANALYSIS_TYPE.ALL_SNPS, eval, tracker, ref.getBase(), context);

View File

@ -212,15 +212,23 @@ public class VCFRecord {
/**
* get the filter criteria
*
* @return an array of strings representing the filtering criteria, or null if none were applied
* @return an array of strings representing the filtering criteria, or 0 is none are applied
*/
public String[] getFilteringCodes() {
if (mFilterString == null) return new String[]{"0"};
return this.mFilterString.split(FILTER_CODE_SEPERATOR);
}
public boolean isFiltered() {
String[] codes = getFilteringCodes();
if ( codes.length > 1 ) return true;
else if ( codes[0].equals(".") || codes[0].equals("0") ) return false;
else return true;
}
public boolean hasFilteringCodes() {
return getAlternateAlleles() != null;
// todo --- currently always returns true
return getFilteringCodes() != null;
}
/**