Bug fix in AnalyzeAnnotations. Be sure the site is a biallelic, unfiltered SNP.

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4400 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
rpoplin 2010-10-01 13:09:46 +00:00
parent 7639692e5b
commit b83fdf8a17
2 changed files with 16 additions and 13 deletions

View File

@ -107,15 +107,19 @@ public class AnalyzeAnnotationsWalker extends RodWalker<Integer, Integer> {
boolean isInTruthSet = false; boolean isInTruthSet = false;
boolean isTrueVariant = false; boolean isTrueVariant = false;
for ( VariantContext vc : VCs ) { for ( VariantContext vc : VCs ) {
if( vc != null && vc.isSNP() && !vc.isFiltered() ) {
if( vc.getName().toUpperCase().startsWith("TRUTH") ) { if( vc.getName().toUpperCase().startsWith("TRUTH") ) {
isInTruthSet = true; isInTruthSet = true;
if (vc.isVariant()) if( vc.isBiallelic() && vc.isVariant() ) {
isTrueVariant = true; isTrueVariant = true;
} }
} }
}
}
// Add each annotation in this VCF Record to the dataManager // Add each annotation in this VCF Record to the dataManager
for ( VariantContext vc : VCs ) { for ( VariantContext vc : VCs ) {
if( vc != null && vc.isSNP() && vc.isBiallelic() && !vc.isFiltered() ) {
if( !vc.getName().toUpperCase().startsWith("TRUTH") ) { if( !vc.getName().toUpperCase().startsWith("TRUTH") ) {
if( vc.isVariant() ) { if( vc.isVariant() ) {
dataManager.addAnnotations( vc, SAMPLE_NAME, isInTruthSet, isTrueVariant ); dataManager.addAnnotations( vc, SAMPLE_NAME, isInTruthSet, isTrueVariant );
@ -123,6 +127,7 @@ public class AnalyzeAnnotationsWalker extends RodWalker<Integer, Integer> {
} }
} }
} }
}
return 1; // This value isn't actually used for anything return 1; // This value isn't actually used for anything
} }

View File

@ -89,7 +89,6 @@ public class AnnotationDataManager {
final boolean isNovelVariant = !infoField.get(VariantContext.ID_KEY).toString().contains("rs"); final boolean isNovelVariant = !infoField.get(VariantContext.ID_KEY).toString().contains("rs");
// Decide if the variant is a transition or transversion // Decide if the variant is a transition or transversion
if ( vc.isSNP() ) {
if( VariantContextUtils.getSNPSubstitutionType(vc).compareTo(BaseUtils.BaseSubstitutionType.TRANSITION) == 0 ) { if( VariantContextUtils.getSNPSubstitutionType(vc).compareTo(BaseUtils.BaseSubstitutionType.TRANSITION) == 0 ) {
datum.incrementTi( isNovelVariant, isInTruthSet, isTrueVariant ); datum.incrementTi( isNovelVariant, isInTruthSet, isTrueVariant );
} else { } else {
@ -97,7 +96,6 @@ public class AnnotationDataManager {
} }
} }
} }
}
public void plotCumulativeTables( final String PATH_TO_RSCRIPT, final String PATH_TO_RESOURCES, final String OUTPUT_PREFIX, public void plotCumulativeTables( final String PATH_TO_RSCRIPT, final String PATH_TO_RESOURCES, final String OUTPUT_PREFIX,
final int MIN_VARIANTS_PER_BIN, final int MAX_VARIANTS_PER_BIN ) { final int MIN_VARIANTS_PER_BIN, final int MAX_VARIANTS_PER_BIN ) {