Support for --assume-single-sample in UG, better malformated bam exceptions, and ignoring out of order contigs in seqdictutils. All for the CG bam file
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4323 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
3938d53738
commit
522830fb01
|
|
@ -113,7 +113,7 @@ public class StratifiedAlignmentContext<RBP extends ReadBackedPileup> {
|
||||||
contexts.put(sampleName,new StratifiedAlignmentContext<RBP>(loc,pileupBySample));
|
contexts.put(sampleName,new StratifiedAlignmentContext<RBP>(loc,pileupBySample));
|
||||||
else {
|
else {
|
||||||
if(assumedSingleSample == null) {
|
if(assumedSingleSample == null) {
|
||||||
throw new UserException.MalformedBam(pileupBySample.iterator().next().getRead(), "Missing read group for read");
|
throw new UserException.ReadMissingReadGroup(pileupBySample.iterator().next().getRead());
|
||||||
}
|
}
|
||||||
contexts.put(assumedSingleSample,new StratifiedAlignmentContext<RBP>(loc,pileupBySample));
|
contexts.put(assumedSingleSample,new StratifiedAlignmentContext<RBP>(loc,pileupBySample));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -187,7 +187,7 @@ public class UnifiedGenotyperEngine {
|
||||||
// annotate the call, if possible
|
// annotate the call, if possible
|
||||||
if ( call != null && call.vc != null && annotationEngine != null ) {
|
if ( call != null && call.vc != null && annotationEngine != null ) {
|
||||||
// first off, we want to use the *unfiltered* context for the annotations
|
// first off, we want to use the *unfiltered* context for the annotations
|
||||||
stratifiedContexts = StratifiedAlignmentContext.splitContextBySample(rawContext.getBasePileup());
|
stratifiedContexts = StratifiedAlignmentContext.splitContextBySample(rawContext.getBasePileup(), UAC.ASSUME_SINGLE_SAMPLE);
|
||||||
|
|
||||||
Collection<VariantContext> variantContexts = annotationEngine.annotateContext(tracker, refContext, stratifiedContexts, call.vc);
|
Collection<VariantContext> variantContexts = annotationEngine.annotateContext(tracker, refContext, stratifiedContexts, call.vc);
|
||||||
call.vc = variantContexts.iterator().next(); //We know the collection will always have exactly 1 element.
|
call.vc = variantContexts.iterator().next(); //We know the collection will always have exactly 1 element.
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,8 @@ public class SequenceDictionaryUtils {
|
||||||
* @param dict2 the sequence dictionary dict2
|
* @param dict2 the sequence dictionary dict2
|
||||||
*/
|
*/
|
||||||
public static void validateDictionaries(Logger logger, String name1, SAMSequenceDictionary dict1, String name2, SAMSequenceDictionary dict2) {
|
public static void validateDictionaries(Logger logger, String name1, SAMSequenceDictionary dict1, String name2, SAMSequenceDictionary dict2) {
|
||||||
switch ( compareDictionaries(dict1, dict2) ) {
|
SequenceDictionaryCompatability type = compareDictionaries(dict1, dict2);
|
||||||
|
switch ( type ) {
|
||||||
case IDENTICAL:
|
case IDENTICAL:
|
||||||
return;
|
return;
|
||||||
case COMMON_SUBSET:
|
case COMMON_SUBSET:
|
||||||
|
|
@ -104,7 +105,7 @@ public class SequenceDictionaryUtils {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case NON_CANONICAL_HUMAN_ORDER:
|
case NON_CANONICAL_HUMAN_ORDER: {
|
||||||
UserException ex = new UserException.IncompatibleSequenceDictionaries("Human genome sequence provided in non-canonical ordering. For safety's sake the GATK requires contigs in karyotypic order: 1, 2, ..., 10, 11, ..., 20, 21, 22, X, Y with M either leading or trailing these contigs",
|
UserException ex = new UserException.IncompatibleSequenceDictionaries("Human genome sequence provided in non-canonical ordering. For safety's sake the GATK requires contigs in karyotypic order: 1, 2, ..., 10, 11, ..., 20, 21, 22, X, Y with M either leading or trailing these contigs",
|
||||||
name1, dict1, name2, dict2);
|
name1, dict1, name2, dict2);
|
||||||
|
|
||||||
|
|
@ -112,11 +113,17 @@ public class SequenceDictionaryUtils {
|
||||||
logger.warn(ex.getMessage());
|
logger.warn(ex.getMessage());
|
||||||
else
|
else
|
||||||
throw ex;
|
throw ex;
|
||||||
|
}
|
||||||
|
|
||||||
case OUT_OF_ORDER:
|
case OUT_OF_ORDER: {
|
||||||
throw new UserException.IncompatibleSequenceDictionaries("Order of contigs differences, which is unsafe", name1, dict1, name2, dict2);
|
UserException ex = new UserException.IncompatibleSequenceDictionaries("Order of contigs differences, which is unsafe", name1, dict1, name2, dict2);
|
||||||
|
if ( allowNonFatalIncompabilities() )
|
||||||
|
logger.warn(ex.getMessage());
|
||||||
|
else
|
||||||
|
throw ex;
|
||||||
|
} break;
|
||||||
default:
|
default:
|
||||||
throw new ReviewedStingException("Unexpected SequenceDictionaryComparison type");
|
throw new ReviewedStingException("Unexpected SequenceDictionaryComparison type: " + type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,7 @@ public class UserException extends ReviewedStingException {
|
||||||
|
|
||||||
public static class MalformedBam extends UserException {
|
public static class MalformedBam extends UserException {
|
||||||
public MalformedBam(SAMRecord read, String message) {
|
public MalformedBam(SAMRecord read, String message) {
|
||||||
super(String.format("SAM/BAM file %s is malformed: %s", read.getFileSource(), message));
|
super(String.format("SAM/BAM file %s is malformed: %s", read.getFileSource().getReader(), message));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -133,7 +133,7 @@ public class UserException extends ReviewedStingException {
|
||||||
|
|
||||||
public MissortedBAM(SAMFileHeader.SortOrder order, SAMRecord read, String message) {
|
public MissortedBAM(SAMFileHeader.SortOrder order, SAMRecord read, String message) {
|
||||||
super(String.format("Missorted Input SAM/BAM file %s: file sorted in %s order but %s is required; %s",
|
super(String.format("Missorted Input SAM/BAM file %s: file sorted in %s order but %s is required; %s",
|
||||||
read.getFileSource(), read.getHeader().getSortOrder(), order, message));
|
read.getFileSource().getReader(), read.getHeader().getSortOrder(), order, message));
|
||||||
}
|
}
|
||||||
|
|
||||||
public MissortedBAM(String message) {
|
public MissortedBAM(String message) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue