Merge pull request #1546 from broadinstitute/rhl_annot_warn_1540
Log annotation warning once if using multithreads
This commit is contained in:
commit
bb87730ddc
|
|
@ -105,12 +105,14 @@ public class HaplotypeScore extends InfoFieldAnnotation implements StandardAnnot
|
|||
final Map<String, PerReadAlleleLikelihoodMap> 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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -112,12 +112,14 @@ public class PossibleDeNovo extends InfoFieldAnnotation implements RodRequiringA
|
|||
final Map<String, PerReadAlleleLikelihoodMap> 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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -95,12 +95,14 @@ public class SpanningDeletions extends InfoFieldAnnotation implements StandardUG
|
|||
final Map<String, PerReadAlleleLikelihoodMap> 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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<String, Object> annotate(final RefMetaDataTracker tracker,
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue