diff --git a/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/annotator/HaplotypeScore.java b/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/annotator/HaplotypeScore.java index 385d8e4f5..9f64cefbc 100644 --- a/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/annotator/HaplotypeScore.java +++ b/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/annotator/HaplotypeScore.java @@ -105,12 +105,14 @@ public class HaplotypeScore extends InfoFieldAnnotation implements StandardAnnot final Map stratifiedPerReadAlleleLikelihoodMap) { // Can only call from UnifiedGenotyper if ( !(walker instanceof UnifiedGenotyper) ) { - if ( !walkerIdentityCheckWarningLogged ) { - if ( walker != null ) - logger.warn("Annotation will not be calculated, must be called from UnifiedGenotyper, not " + walker.getClass().getName()); - else - logger.warn("Annotation will not be calculated, must be called from UnifiedGenotyper"); - walkerIdentityCheckWarningLogged = true; + synchronized (this) { + if (!walkerIdentityCheckWarningLogged) { + if (walker != null) + logger.warn("Annotation will not be calculated, must be called from UnifiedGenotyper, not " + walker.getClass().getSimpleName()); + else + logger.warn("Annotation will not be calculated, must be called from UnifiedGenotyper"); + walkerIdentityCheckWarningLogged = true; + } } return null; } diff --git a/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/annotator/MVLikelihoodRatio.java b/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/annotator/MVLikelihoodRatio.java index 24b393155..709e266ab 100644 --- a/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/annotator/MVLikelihoodRatio.java +++ b/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/annotator/MVLikelihoodRatio.java @@ -109,12 +109,14 @@ public class MVLikelihoodRatio extends InfoFieldAnnotation implements RodRequiri // Can only be called from VariantAnnotator if ( !(walker instanceof VariantAnnotator) ) { - if ( !walkerIdentityCheckWarningLogged ) { - if ( walker != null ) - logger.warn("Annotation will not be calculated, must be called from VariantAnnotator, not " + walker.getClass().getName()); - else - logger.warn("Annotation will not be calculated, must be called from VariantAnnotator"); - walkerIdentityCheckWarningLogged = true; + synchronized (this) { + if (!walkerIdentityCheckWarningLogged) { + if (walker != null) + logger.warn("Annotation will not be calculated, must be called from VariantAnnotator, not " + walker.getClass().getSimpleName()); + else + logger.warn("Annotation will not be calculated, must be called from VariantAnnotator"); + walkerIdentityCheckWarningLogged = true; + } } return null; } @@ -123,9 +125,11 @@ public class MVLikelihoodRatio extends InfoFieldAnnotation implements RodRequiri // Must have a pedigree file trios = ((Walker) walker).getSampleDB().getTrios(); if ( trios.isEmpty() ) { - if ( !pedigreeCheckWarningLogged ) { - logger.warn("Annotation will not be calculated, mendelian violation annotation must provide a valid PED file (-ped) from the command line."); - pedigreeCheckWarningLogged = true; + synchronized (this) { + if (!pedigreeCheckWarningLogged) { + logger.warn("Annotation will not be calculated, mendelian violation annotation must provide a valid PED file (-ped) from the command line."); + pedigreeCheckWarningLogged = true; + } } return null; } diff --git a/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/annotator/PossibleDeNovo.java b/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/annotator/PossibleDeNovo.java index a56ba0dea..908e7c86d 100644 --- a/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/annotator/PossibleDeNovo.java +++ b/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/annotator/PossibleDeNovo.java @@ -112,12 +112,14 @@ public class PossibleDeNovo extends InfoFieldAnnotation implements RodRequiringA final Map stratifiedPerReadAlleleLikelihoodMap) { if ( !(walker instanceof VariantAnnotator ) ) { - if ( !walkerIdentityCheckWarningLogged ) { - if ( walker != null ) - logger.warn("Annotation will not be calculated, must be called from VariantAnnotator, not " + walker.getClass().getName()); - else - logger.warn("Annotation will not be calculated, must be called from VariantAnnotator"); - walkerIdentityCheckWarningLogged = true; + synchronized (this) { + if (!walkerIdentityCheckWarningLogged) { + if (walker != null) + logger.warn("Annotation will not be calculated, must be called from VariantAnnotator, not " + walker.getClass().getSimpleName()); + else + logger.warn("Annotation will not be calculated, must be called from VariantAnnotator"); + walkerIdentityCheckWarningLogged = true; + } } return null; } diff --git a/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/annotator/SpanningDeletions.java b/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/annotator/SpanningDeletions.java index 672f28460..962addd53 100644 --- a/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/annotator/SpanningDeletions.java +++ b/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/annotator/SpanningDeletions.java @@ -95,12 +95,14 @@ public class SpanningDeletions extends InfoFieldAnnotation implements StandardUG final Map stratifiedPerReadAlleleLikelihoodMap) { // Can only call from UnifiedGenotyper if ( !(walker instanceof UnifiedGenotyper) ) { - if ( !walkerIdentityCheckWarningLogged ) { - if ( walker != null ) - logger.warn("Annotation will not be calculated, must be called from UnifiedGenotyper, not " + walker.getClass().getName()); - else - logger.warn("Annotation will not be calculated, must be called from UnifiedGenotyper"); - walkerIdentityCheckWarningLogged = true; + synchronized (this) { + if (!walkerIdentityCheckWarningLogged) { + if (walker != null) + logger.warn("Annotation will not be calculated, must be called from UnifiedGenotyper, not " + walker.getClass().getSimpleName()); + else + logger.warn("Annotation will not be calculated, must be called from UnifiedGenotyper"); + walkerIdentityCheckWarningLogged = true; + } } return null; } diff --git a/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/annotator/TandemRepeatAnnotator.java b/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/annotator/TandemRepeatAnnotator.java index db7932330..7eca78775 100644 --- a/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/annotator/TandemRepeatAnnotator.java +++ b/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/annotator/TandemRepeatAnnotator.java @@ -79,7 +79,6 @@ import java.util.*; */ public class TandemRepeatAnnotator extends InfoFieldAnnotation implements StandardUGAnnotation, ActiveRegionBasedAnnotation { private final static Logger logger = Logger.getLogger(TandemRepeatAnnotator.class); - private boolean walkerIdentityCheckWarningLogged = false; @Override public Map annotate(final RefMetaDataTracker tracker, diff --git a/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/annotator/TransmissionDisequilibriumTest.java b/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/annotator/TransmissionDisequilibriumTest.java index 1c5f02bf3..6542d18a9 100644 --- a/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/annotator/TransmissionDisequilibriumTest.java +++ b/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/annotator/TransmissionDisequilibriumTest.java @@ -101,12 +101,14 @@ public class TransmissionDisequilibriumTest extends InfoFieldAnnotation implemen // Can only be called from VariantAnnotator if ( !(walker instanceof VariantAnnotator) ) { - if ( !walkerIdentityCheckWarningLogged ) { - if ( walker != null ) - logger.warn("Annotation will not be calculated, must be called from VariantAnnotator, not " + walker.getClass().getName()); - else - logger.warn("Annotation will not be calculated, must be called from VariantAnnotator"); - walkerIdentityCheckWarningLogged = true; + synchronized (this) { + if (!walkerIdentityCheckWarningLogged) { + if (walker != null) + logger.warn("Annotation will not be calculated, must be called from VariantAnnotator, not " + walker.getClass().getSimpleName()); + else + logger.warn("Annotation will not be calculated, must be called from VariantAnnotator"); + walkerIdentityCheckWarningLogged = true; + } } return null; } @@ -115,9 +117,11 @@ public class TransmissionDisequilibriumTest extends InfoFieldAnnotation implemen if ( trios == null ) { trios = ((VariantAnnotator) walker).getSampleDB().getChildrenWithParents(); if (trios == null || trios.isEmpty()) { - if ( !pedigreeCheckWarningLogged ) { - logger.warn("Transmission disequilibrium test annotation requires a valid ped file be passed in."); - pedigreeCheckWarningLogged = true; + synchronized (this) { + if (!pedigreeCheckWarningLogged) { + logger.warn("Transmission disequilibrium test annotation requires a valid ped file be passed in."); + pedigreeCheckWarningLogged = true; + } } return null; } diff --git a/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/cancer/BaseQualitySumPerAlleleBySample.java b/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/cancer/BaseQualitySumPerAlleleBySample.java index 00e16a49a..8829e6a05 100644 --- a/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/cancer/BaseQualitySumPerAlleleBySample.java +++ b/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/cancer/BaseQualitySumPerAlleleBySample.java @@ -115,12 +115,14 @@ public class BaseQualitySumPerAlleleBySample extends GenotypeAnnotation implemen // Can only call from MuTect2 if ( !(walker instanceof MuTect2) ) { - if ( !walkerIdentityCheckWarningLogged ) { - if ( walker != null ) - logger.warn("Annotation will not be calculated, can only be called from MuTect2, not " + walker.getClass().getName()); - else - logger.warn("Annotation will not be calculated, can only be called from MuTect2"); - walkerIdentityCheckWarningLogged = true; + synchronized (this) { + if (!walkerIdentityCheckWarningLogged) { + if (walker != null) + logger.warn("Annotation will not be calculated, can only be called from MuTect2, not " + walker.getClass().getSimpleName()); + else + logger.warn("Annotation will not be calculated, can only be called from MuTect2"); + walkerIdentityCheckWarningLogged = true; + } } return; } diff --git a/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/cancer/OxoGReadCounts.java b/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/cancer/OxoGReadCounts.java index b12eedc4c..089e79276 100644 --- a/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/cancer/OxoGReadCounts.java +++ b/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/cancer/OxoGReadCounts.java @@ -121,12 +121,14 @@ public class OxoGReadCounts extends GenotypeAnnotation { // Can only call from MuTect2 if ( !(walker instanceof MuTect2) ) { - if ( !walkerIdentityCheckWarningLogged ) { - if ( walker != null ) - logger.warn("Annotation will not be calculated, can only be called from MuTect2, not " + walker.getClass().getName()); - else - logger.warn("Annotation will not be calculated, can only be called from MuTect2"); - walkerIdentityCheckWarningLogged = true; + synchronized (this) { + if (!walkerIdentityCheckWarningLogged) { + if (walker != null) + logger.warn("Annotation will not be calculated, can only be called from MuTect2, not " + walker.getClass().getSimpleName()); + else + logger.warn("Annotation will not be calculated, can only be called from MuTect2"); + walkerIdentityCheckWarningLogged = true; + } } return; }