From 11cdc39523e6e7efd264f0fa17973313048bca63 Mon Sep 17 00:00:00 2001 From: Yunfei Guo Date: Fri, 3 Mar 2017 06:49:04 -0800 Subject: [PATCH 1/2] prepare for v0.7.7 release;fix quickstart bug;disable illegal phase warning --- pom.xml | 2 +- quickstart.sh | 2 +- src/main/java/com/bina/varsim/util/VCFparser.java | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index c40ea47e..5385fb7e 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.bina.varsim varsim - 0.7.6 + 0.7.7 jar varsim diff --git a/quickstart.sh b/quickstart.sh index 5f635f3f..d07db869 100755 --- a/quickstart.sh +++ b/quickstart.sh @@ -4,7 +4,7 @@ set -x b37_source="ftp://ftp.1000genomes.ebi.ac.uk/vol1/ftp/technical/reference/phase2_reference_assembly_sequence/hs37d5.fa.gz" dbsnp_source="ftp://ftp.ncbi.nih.gov/snp/organisms/human_9606_b147_GRCh37p13/VCF/All_20160601.vcf.gz" -varsim_version="0.7.1" +varsim_version="0.7.7" samtools_version="1.3.1" # Download varsim diff --git a/src/main/java/com/bina/varsim/util/VCFparser.java b/src/main/java/com/bina/varsim/util/VCFparser.java index c99de778..af88df17 100644 --- a/src/main/java/com/bina/varsim/util/VCFparser.java +++ b/src/main/java/com/bina/varsim/util/VCFparser.java @@ -179,7 +179,6 @@ boolean isPhased(String geno, byte[] vals, ChrString chr) { } if (strangePhase) { - log.warn("Unrecognized phasing '" + geno + "'."); vals[0] = -1; vals[1] = -1; isPhased = false; From fb11d2c3ac07eff9017af09470ba6849c6a34f96 Mon Sep 17 00:00:00 2001 From: Yunfei Guo Date: Fri, 3 Mar 2017 15:49:50 -0800 Subject: [PATCH 2/2] limit warnings --- src/main/java/com/bina/varsim/constants/Constant.java | 1 + src/main/java/com/bina/varsim/util/VCFparser.java | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/src/main/java/com/bina/varsim/constants/Constant.java b/src/main/java/com/bina/varsim/constants/Constant.java index 9873628b..2ec272a7 100644 --- a/src/main/java/com/bina/varsim/constants/Constant.java +++ b/src/main/java/com/bina/varsim/constants/Constant.java @@ -5,4 +5,5 @@ */ public class Constant { public static final int SVLEN = 100; + public static final int MAX_WARNING_REPEAT = 100; } diff --git a/src/main/java/com/bina/varsim/util/VCFparser.java b/src/main/java/com/bina/varsim/util/VCFparser.java index af88df17..8722f980 100644 --- a/src/main/java/com/bina/varsim/util/VCFparser.java +++ b/src/main/java/com/bina/varsim/util/VCFparser.java @@ -16,6 +16,7 @@ import java.rmi.UnexpectedException; import java.util.*; +import static com.bina.varsim.constants.Constant.MAX_WARNING_REPEAT; import static com.bina.varsim.types.VCFInfo.getType; public class VCFparser extends GzFileParser { @@ -28,6 +29,7 @@ public class VCFparser extends GzFileParser { private String sampleId = null; private boolean isPassFilterRequired = false; private boolean chromLineSeen = false; + private int illegalPhasingWarningCount = 0; public VCFparser() { sampleIndex = 10; // the first sample @@ -179,6 +181,14 @@ boolean isPhased(String geno, byte[] vals, ChrString chr) { } if (strangePhase) { + if (illegalPhasingWarningCount < MAX_WARNING_REPEAT) { + log.warn("Unrecognized phasing '" + geno + "'."); + illegalPhasingWarningCount++; + if (illegalPhasingWarningCount == MAX_WARNING_REPEAT) { + log.warn("Reached max number of warnings (" + MAX_WARNING_REPEAT + + ") for unrecognized phasing. No more warnings."); + } + } vals[0] = -1; vals[1] = -1; isPhased = false;