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) {
|
final Map<String, PerReadAlleleLikelihoodMap> stratifiedPerReadAlleleLikelihoodMap) {
|
||||||
// Can only call from UnifiedGenotyper
|
// Can only call from UnifiedGenotyper
|
||||||
if ( !(walker instanceof UnifiedGenotyper) ) {
|
if ( !(walker instanceof UnifiedGenotyper) ) {
|
||||||
if ( !walkerIdentityCheckWarningLogged ) {
|
synchronized (this) {
|
||||||
if ( walker != null )
|
if (!walkerIdentityCheckWarningLogged) {
|
||||||
logger.warn("Annotation will not be calculated, must be called from UnifiedGenotyper, not " + walker.getClass().getName());
|
if (walker != null)
|
||||||
|
logger.warn("Annotation will not be calculated, must be called from UnifiedGenotyper, not " + walker.getClass().getSimpleName());
|
||||||
else
|
else
|
||||||
logger.warn("Annotation will not be calculated, must be called from UnifiedGenotyper");
|
logger.warn("Annotation will not be calculated, must be called from UnifiedGenotyper");
|
||||||
walkerIdentityCheckWarningLogged = true;
|
walkerIdentityCheckWarningLogged = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -109,13 +109,15 @@ public class MVLikelihoodRatio extends InfoFieldAnnotation implements RodRequiri
|
||||||
|
|
||||||
// Can only be called from VariantAnnotator
|
// Can only be called from VariantAnnotator
|
||||||
if ( !(walker instanceof VariantAnnotator) ) {
|
if ( !(walker instanceof VariantAnnotator) ) {
|
||||||
if ( !walkerIdentityCheckWarningLogged ) {
|
synchronized (this) {
|
||||||
if ( walker != null )
|
if (!walkerIdentityCheckWarningLogged) {
|
||||||
logger.warn("Annotation will not be calculated, must be called from VariantAnnotator, not " + walker.getClass().getName());
|
if (walker != null)
|
||||||
|
logger.warn("Annotation will not be calculated, must be called from VariantAnnotator, not " + walker.getClass().getSimpleName());
|
||||||
else
|
else
|
||||||
logger.warn("Annotation will not be calculated, must be called from VariantAnnotator");
|
logger.warn("Annotation will not be calculated, must be called from VariantAnnotator");
|
||||||
walkerIdentityCheckWarningLogged = true;
|
walkerIdentityCheckWarningLogged = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -123,10 +125,12 @@ public class MVLikelihoodRatio extends InfoFieldAnnotation implements RodRequiri
|
||||||
// Must have a pedigree file
|
// Must have a pedigree file
|
||||||
trios = ((Walker) walker).getSampleDB().getTrios();
|
trios = ((Walker) walker).getSampleDB().getTrios();
|
||||||
if ( trios.isEmpty() ) {
|
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.");
|
logger.warn("Annotation will not be calculated, mendelian violation annotation must provide a valid PED file (-ped) from the command line.");
|
||||||
pedigreeCheckWarningLogged = true;
|
pedigreeCheckWarningLogged = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
mendelianViolation = new MendelianViolation(((VariantAnnotator)walker).minGenotypeQualityP );
|
mendelianViolation = new MendelianViolation(((VariantAnnotator)walker).minGenotypeQualityP );
|
||||||
|
|
|
||||||
|
|
@ -112,13 +112,15 @@ public class PossibleDeNovo extends InfoFieldAnnotation implements RodRequiringA
|
||||||
final Map<String, PerReadAlleleLikelihoodMap> stratifiedPerReadAlleleLikelihoodMap) {
|
final Map<String, PerReadAlleleLikelihoodMap> stratifiedPerReadAlleleLikelihoodMap) {
|
||||||
|
|
||||||
if ( !(walker instanceof VariantAnnotator ) ) {
|
if ( !(walker instanceof VariantAnnotator ) ) {
|
||||||
if ( !walkerIdentityCheckWarningLogged ) {
|
synchronized (this) {
|
||||||
if ( walker != null )
|
if (!walkerIdentityCheckWarningLogged) {
|
||||||
logger.warn("Annotation will not be calculated, must be called from VariantAnnotator, not " + walker.getClass().getName());
|
if (walker != null)
|
||||||
|
logger.warn("Annotation will not be calculated, must be called from VariantAnnotator, not " + walker.getClass().getSimpleName());
|
||||||
else
|
else
|
||||||
logger.warn("Annotation will not be calculated, must be called from VariantAnnotator");
|
logger.warn("Annotation will not be calculated, must be called from VariantAnnotator");
|
||||||
walkerIdentityCheckWarningLogged = true;
|
walkerIdentityCheckWarningLogged = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -95,13 +95,15 @@ public class SpanningDeletions extends InfoFieldAnnotation implements StandardUG
|
||||||
final Map<String, PerReadAlleleLikelihoodMap> stratifiedPerReadAlleleLikelihoodMap) {
|
final Map<String, PerReadAlleleLikelihoodMap> stratifiedPerReadAlleleLikelihoodMap) {
|
||||||
// Can only call from UnifiedGenotyper
|
// Can only call from UnifiedGenotyper
|
||||||
if ( !(walker instanceof UnifiedGenotyper) ) {
|
if ( !(walker instanceof UnifiedGenotyper) ) {
|
||||||
if ( !walkerIdentityCheckWarningLogged ) {
|
synchronized (this) {
|
||||||
if ( walker != null )
|
if (!walkerIdentityCheckWarningLogged) {
|
||||||
logger.warn("Annotation will not be calculated, must be called from UnifiedGenotyper, not " + walker.getClass().getName());
|
if (walker != null)
|
||||||
|
logger.warn("Annotation will not be calculated, must be called from UnifiedGenotyper, not " + walker.getClass().getSimpleName());
|
||||||
else
|
else
|
||||||
logger.warn("Annotation will not be calculated, must be called from UnifiedGenotyper");
|
logger.warn("Annotation will not be calculated, must be called from UnifiedGenotyper");
|
||||||
walkerIdentityCheckWarningLogged = true;
|
walkerIdentityCheckWarningLogged = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,6 @@ import java.util.*;
|
||||||
*/
|
*/
|
||||||
public class TandemRepeatAnnotator extends InfoFieldAnnotation implements StandardUGAnnotation, ActiveRegionBasedAnnotation {
|
public class TandemRepeatAnnotator extends InfoFieldAnnotation implements StandardUGAnnotation, ActiveRegionBasedAnnotation {
|
||||||
private final static Logger logger = Logger.getLogger(TandemRepeatAnnotator.class);
|
private final static Logger logger = Logger.getLogger(TandemRepeatAnnotator.class);
|
||||||
private boolean walkerIdentityCheckWarningLogged = false;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> annotate(final RefMetaDataTracker tracker,
|
public Map<String, Object> annotate(final RefMetaDataTracker tracker,
|
||||||
|
|
|
||||||
|
|
@ -101,13 +101,15 @@ public class TransmissionDisequilibriumTest extends InfoFieldAnnotation implemen
|
||||||
|
|
||||||
// Can only be called from VariantAnnotator
|
// Can only be called from VariantAnnotator
|
||||||
if ( !(walker instanceof VariantAnnotator) ) {
|
if ( !(walker instanceof VariantAnnotator) ) {
|
||||||
if ( !walkerIdentityCheckWarningLogged ) {
|
synchronized (this) {
|
||||||
if ( walker != null )
|
if (!walkerIdentityCheckWarningLogged) {
|
||||||
logger.warn("Annotation will not be calculated, must be called from VariantAnnotator, not " + walker.getClass().getName());
|
if (walker != null)
|
||||||
|
logger.warn("Annotation will not be calculated, must be called from VariantAnnotator, not " + walker.getClass().getSimpleName());
|
||||||
else
|
else
|
||||||
logger.warn("Annotation will not be calculated, must be called from VariantAnnotator");
|
logger.warn("Annotation will not be calculated, must be called from VariantAnnotator");
|
||||||
walkerIdentityCheckWarningLogged = true;
|
walkerIdentityCheckWarningLogged = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -115,10 +117,12 @@ public class TransmissionDisequilibriumTest extends InfoFieldAnnotation implemen
|
||||||
if ( trios == null ) {
|
if ( trios == null ) {
|
||||||
trios = ((VariantAnnotator) walker).getSampleDB().getChildrenWithParents();
|
trios = ((VariantAnnotator) walker).getSampleDB().getChildrenWithParents();
|
||||||
if (trios == null || trios.isEmpty()) {
|
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.");
|
logger.warn("Transmission disequilibrium test annotation requires a valid ped file be passed in.");
|
||||||
pedigreeCheckWarningLogged = true;
|
pedigreeCheckWarningLogged = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -115,13 +115,15 @@ public class BaseQualitySumPerAlleleBySample extends GenotypeAnnotation implemen
|
||||||
|
|
||||||
// Can only call from MuTect2
|
// Can only call from MuTect2
|
||||||
if ( !(walker instanceof MuTect2) ) {
|
if ( !(walker instanceof MuTect2) ) {
|
||||||
if ( !walkerIdentityCheckWarningLogged ) {
|
synchronized (this) {
|
||||||
if ( walker != null )
|
if (!walkerIdentityCheckWarningLogged) {
|
||||||
logger.warn("Annotation will not be calculated, can only be called from MuTect2, not " + walker.getClass().getName());
|
if (walker != null)
|
||||||
|
logger.warn("Annotation will not be calculated, can only be called from MuTect2, not " + walker.getClass().getSimpleName());
|
||||||
else
|
else
|
||||||
logger.warn("Annotation will not be calculated, can only be called from MuTect2");
|
logger.warn("Annotation will not be calculated, can only be called from MuTect2");
|
||||||
walkerIdentityCheckWarningLogged = true;
|
walkerIdentityCheckWarningLogged = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -121,13 +121,15 @@ public class OxoGReadCounts extends GenotypeAnnotation {
|
||||||
|
|
||||||
// Can only call from MuTect2
|
// Can only call from MuTect2
|
||||||
if ( !(walker instanceof MuTect2) ) {
|
if ( !(walker instanceof MuTect2) ) {
|
||||||
if ( !walkerIdentityCheckWarningLogged ) {
|
synchronized (this) {
|
||||||
if ( walker != null )
|
if (!walkerIdentityCheckWarningLogged) {
|
||||||
logger.warn("Annotation will not be calculated, can only be called from MuTect2, not " + walker.getClass().getName());
|
if (walker != null)
|
||||||
|
logger.warn("Annotation will not be calculated, can only be called from MuTect2, not " + walker.getClass().getSimpleName());
|
||||||
else
|
else
|
||||||
logger.warn("Annotation will not be calculated, can only be called from MuTect2");
|
logger.warn("Annotation will not be calculated, can only be called from MuTect2");
|
||||||
walkerIdentityCheckWarningLogged = true;
|
walkerIdentityCheckWarningLogged = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue