Log annotation warning once if using multithreads
This commit is contained in:
parent
c5df90b598
commit
44c0609418
|
|
@ -105,13 +105,15 @@ 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());
|
||||
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,13 +109,15 @@ 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());
|
||||
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,10 +125,12 @@ public class MVLikelihoodRatio extends InfoFieldAnnotation implements RodRequiri
|
|||
// Must have a pedigree file
|
||||
trios = ((Walker) walker).getSampleDB().getTrios();
|
||||
if ( trios.isEmpty() ) {
|
||||
if ( !pedigreeCheckWarningLogged ) {
|
||||
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;
|
||||
}
|
||||
mendelianViolation = new MendelianViolation(((VariantAnnotator)walker).minGenotypeQualityP );
|
||||
|
|
|
|||
|
|
@ -112,13 +112,15 @@ 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());
|
||||
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,13 +95,15 @@ 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());
|
||||
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,13 +101,15 @@ 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());
|
||||
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,10 +117,12 @@ public class TransmissionDisequilibriumTest extends InfoFieldAnnotation implemen
|
|||
if ( trios == null ) {
|
||||
trios = ((VariantAnnotator) walker).getSampleDB().getChildrenWithParents();
|
||||
if (trios == null || trios.isEmpty()) {
|
||||
if ( !pedigreeCheckWarningLogged ) {
|
||||
synchronized (this) {
|
||||
if (!pedigreeCheckWarningLogged) {
|
||||
logger.warn("Transmission disequilibrium test annotation requires a valid ped file be passed in.");
|
||||
pedigreeCheckWarningLogged = true;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -115,13 +115,15 @@ 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());
|
||||
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,13 +121,15 @@ 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());
|
||||
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