diff --git a/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/cancer/contamination/ContEst.java b/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/cancer/contamination/ContEst.java index 75e7c9fde..ebe1ef044 100755 --- a/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/cancer/contamination/ContEst.java +++ b/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/cancer/contamination/ContEst.java @@ -264,14 +264,14 @@ public class ContEst extends RodWalker 0) { + if (!results.isEmpty()) { countResults++; stats.put(namePair.getKey(), results); } @@ -498,7 +498,7 @@ public class ContEst extends RodWalker genotypes, boolean verifiedSampleName, boolean verifySample, String sampleName) { // get the truthForSample and the hapmap information for this site; if either are null we can't move forward Collection truths = tracker.getValues(genotypes); - if (truths == null || truths.size() == 0) return null; + if (truths == null || truths.isEmpty()) return null; VariantContext truthForSample = truths.iterator().next(); @@ -506,7 +506,7 @@ public class ContEst extends RodWalker 0.5) { throw new RuntimeException("Minor allele frequency is greater than 0.5, this is an error; we saw AF of " + alleleFreq); @@ -708,7 +711,7 @@ public class ContEst extends RodWalker 0) + if (!newMap.isEmpty()) cleanedMap.put(entry.getKey(), newMap); else out.println("Warning: We're throwing out lane " + entry.getKey() + " since it has fewer than " + minBaseCount + diff --git a/protected/gatk-tools-protected/src/test/java/org/broadinstitute/gatk/tools/walkers/cancer/contamination/ContEstIntegrationTest.java b/protected/gatk-tools-protected/src/test/java/org/broadinstitute/gatk/tools/walkers/cancer/contamination/ContEstIntegrationTest.java index ac1edfaa9..aaa312879 100644 --- a/protected/gatk-tools-protected/src/test/java/org/broadinstitute/gatk/tools/walkers/cancer/contamination/ContEstIntegrationTest.java +++ b/protected/gatk-tools-protected/src/test/java/org/broadinstitute/gatk/tools/walkers/cancer/contamination/ContEstIntegrationTest.java @@ -52,6 +52,7 @@ package org.broadinstitute.gatk.tools.walkers.cancer.contamination; import org.broadinstitute.gatk.engine.walkers.WalkerTest; +import org.broadinstitute.gatk.utils.exceptions.UserException; import org.testng.annotations.Test; import java.util.Arrays; @@ -100,4 +101,17 @@ public class ContEstIntegrationTest extends WalkerTest { " -isr INTERSECTION",md5sums); executeTest("testArrayFree",spec); } + + @Test(enabled = true) + public void testArrayNoPop(){ + WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec( + "-T ContEst" + + " -I:eval " + ContaminatedBamsDirectory + "HCC1143_BL.small.0.05.contaminated.with.SM-612V3.small.0.95.bam" + + " -I:genotype " + NormalBamsDirectory + "SM-612V4.bam" + + " -R " + b37KGReference + + " --popfile " + validationDataLocation + "hg19_population_stratified_af_hapmap_3.3.fixed_no_pop.vcf", + 0, + UserException.class); + executeTest("testArrayNoPop",spec); + } } diff --git a/public/gatk-tools-public/src/main/java/org/broadinstitute/gatk/tools/walkers/rnaseq/ASEReadCounter.java b/public/gatk-tools-public/src/main/java/org/broadinstitute/gatk/tools/walkers/rnaseq/ASEReadCounter.java index 1e151adb4..782a6da35 100644 --- a/public/gatk-tools-public/src/main/java/org/broadinstitute/gatk/tools/walkers/rnaseq/ASEReadCounter.java +++ b/public/gatk-tools-public/src/main/java/org/broadinstitute/gatk/tools/walkers/rnaseq/ASEReadCounter.java @@ -202,7 +202,7 @@ public class ASEReadCounter extends LocusWalker { final List VCs = tracker.getValues(sites, context.getLocation()); if(VCs != null && VCs.size() > 1) throw new UserException("More then one variant context at position: "+contig+":"+position); - if(VCs == null || VCs.size() == 0) + if(VCs == null || VCs.isEmpty()) return null; final VariantContext vc = VCs.get(0); @@ -211,7 +211,11 @@ public class ASEReadCounter extends LocusWalker { return null; } + if ( vc.getNAlleles() == 1 || vc.getAlternateAllele(0).getBases().length == 0 ) + throw new UserException("The file of variant sites must contain heterozygous sites and cannot be a GVCF file containing alleles."); + final char altAllele = (char)vc.getAlternateAllele(0).getBases()[0]; + final String siteID = vc.getID(); final ReadBackedPileup pileup = filterPileup(context.getBasePileup(), countType, includeReadsWithDeletionAtLoci()); diff --git a/public/gatk-tools-public/src/main/java/org/broadinstitute/gatk/tools/walkers/variantutils/SelectVariants.java b/public/gatk-tools-public/src/main/java/org/broadinstitute/gatk/tools/walkers/variantutils/SelectVariants.java index 62918c4f9..bd33c2cae 100644 --- a/public/gatk-tools-public/src/main/java/org/broadinstitute/gatk/tools/walkers/variantutils/SelectVariants.java +++ b/public/gatk-tools-public/src/main/java/org/broadinstitute/gatk/tools/walkers/variantutils/SelectVariants.java @@ -664,7 +664,7 @@ public class SelectVariants extends RodWalker implements TreeR "Samples entered on command line (through -sf or -sn) that are not present in the VCF.", "A list of these samples:", Utils.join(",", commandLineUniqueSamples), - "To ignore these samples, run with --allowNonOverlappingCommandLineSamples")); + "To ignore these samples, run with --ALLOW_NONOVERLAPPING_COMMAND_LINE_SAMPLES")); } } diff --git a/public/gatk-tools-public/src/test/java/org/broadinstitute/gatk/tools/walkers/rnaseq/ASEReadCounterIntegrationTest.java b/public/gatk-tools-public/src/test/java/org/broadinstitute/gatk/tools/walkers/rnaseq/ASEReadCounterIntegrationTest.java index d656abae7..7af19c538 100644 --- a/public/gatk-tools-public/src/test/java/org/broadinstitute/gatk/tools/walkers/rnaseq/ASEReadCounterIntegrationTest.java +++ b/public/gatk-tools-public/src/test/java/org/broadinstitute/gatk/tools/walkers/rnaseq/ASEReadCounterIntegrationTest.java @@ -26,6 +26,7 @@ package org.broadinstitute.gatk.tools.walkers.rnaseq; import org.broadinstitute.gatk.engine.walkers.WalkerTest; +import org.broadinstitute.gatk.utils.exceptions.UserException; import org.testng.annotations.Test; import java.util.Arrays; @@ -100,6 +101,14 @@ public class ASEReadCounterIntegrationTest extends WalkerTest { executeTest("test high mq with no read passing", spec); } + @Test + public void testASEReadCounterNonRef() { + WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec( + "-T ASEReadCounter -R " + b37KGReference + " -I " + privateTestDir + "NA12878.RNAseq.bam -sites "+privateTestDir +"NA12878.chr20_2444518_2637800.RNAseq.NonRef.vcf -U ALLOW_N_CIGAR_READS", 0, + UserException.class); + executeTest("test sites VCF file", spec); + } + diff --git a/public/gatk-utils/src/main/java/org/broadinstitute/gatk/utils/exceptions/UserException.java b/public/gatk-utils/src/main/java/org/broadinstitute/gatk/utils/exceptions/UserException.java index ceb1d0f4f..e9c9a0777 100644 --- a/public/gatk-utils/src/main/java/org/broadinstitute/gatk/utils/exceptions/UserException.java +++ b/public/gatk-utils/src/main/java/org/broadinstitute/gatk/utils/exceptions/UserException.java @@ -373,7 +373,7 @@ public class UserException extends ReviewedGATKException { public static class LexicographicallySortedSequenceDictionary extends UserException { public LexicographicallySortedSequenceDictionary(String name, SAMSequenceDictionary dict) { - super(String.format("Lexicographically sorted human genome sequence detected in %s. Please see " + HelpConstants.forumPost("discussion/58/companion-utilities-reordersam") + "for more information. Error details: %s contigs = %s", + super(String.format("Lexicographically sorted human genome sequence detected in %s. Please see " + HelpConstants.articlePost("1328") + "for more information. Error details: %s contigs = %s", name, name, ReadUtils.prettyPrintSequenceRecords(dict))); } } diff --git a/public/gatk-utils/src/main/java/org/broadinstitute/gatk/utils/help/HelpConstants.java b/public/gatk-utils/src/main/java/org/broadinstitute/gatk/utils/help/HelpConstants.java index 707cc8f5e..60aec0139 100644 --- a/public/gatk-utils/src/main/java/org/broadinstitute/gatk/utils/help/HelpConstants.java +++ b/public/gatk-utils/src/main/java/org/broadinstitute/gatk/utils/help/HelpConstants.java @@ -29,6 +29,7 @@ public class HelpConstants { public final static String BASE_GATK_URL = "http://www.broadinstitute.org/gatk"; public final static String GATK_DOCS_URL = BASE_GATK_URL + "/guide/tooldocs/"; + public final static String GATK_ARTICLE_URL = BASE_GATK_URL + "/guide/article"; public final static String GATK_FORUM_URL = "http://gatkforums.broadinstitute.org/"; public final static String GATK_FORUM_API_URL = "https://gatkforums.broadinstitute.org/api/v1/"; @@ -61,6 +62,10 @@ public class HelpConstants { return GATK_FORUM_URL + post; } + public static String articlePost(String id) { + return GATK_ARTICLE_URL + "?id=" + id; + } + /** * Go-to developer name codes for tracking and display purposes. Only current team members should be in this list. * When someone leaves, their charges should be redistributed. The actual string should be closest to the dev's diff --git a/public/gatk-utils/src/main/java/org/broadinstitute/gatk/utils/pairhmm/PairHMM.java b/public/gatk-utils/src/main/java/org/broadinstitute/gatk/utils/pairhmm/PairHMM.java index 9f57779ae..dd1a41c1c 100644 --- a/public/gatk-utils/src/main/java/org/broadinstitute/gatk/utils/pairhmm/PairHMM.java +++ b/public/gatk-utils/src/main/java/org/broadinstitute/gatk/utils/pairhmm/PairHMM.java @@ -372,7 +372,7 @@ public abstract class PairHMM { { doProfiling = (numThreads == 1); if(numThreads > 1) - logger.info("Performance profiling for PairHMM is disabled because HaplotypeCaller is being run with multiple threads (-nct>1) option\nProfiling is enabled only when running in single thread mode\n"); + logger.info("Performance profiling for PairHMM is disabled because the program is being run with multiple threads (-nct>1) option\nProfiling is enabled only when running in single thread mode\n"); } /**