We were never clipping the VCF-provided ref base off the left end of the alleles for insertions, so the reference allele was never null (and downstream walkers would fail). Didn't this get tested with insertions at some point?
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@3738 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
9a81f1d7ef
commit
ada8c9931f
|
|
@ -387,11 +387,11 @@ public class VCF4Codec implements FeatureCodec, NameAwareCodec {
|
|||
|
||||
// find out our current location, and clip the alleles down to their minimum length
|
||||
Pair<GenomeLoc, List<Allele>> locAndAlleles;
|
||||
if (ref.length() > 1) {
|
||||
attributes.put(ORIGINAL_ALLELE_LIST,alleles);
|
||||
locAndAlleles = clipAlleles(contig, pos, ref, alleles);
|
||||
if ( hasIndel(alleles) ) {
|
||||
attributes.put(ORIGINAL_ALLELE_LIST,alleles);
|
||||
locAndAlleles = clipAlleles(contig, pos, ref, alleles);
|
||||
} else {
|
||||
locAndAlleles = new Pair<GenomeLoc, List<Allele>>(GenomeLocParser.createGenomeLoc(contig, pos), alleles);
|
||||
locAndAlleles = new Pair<GenomeLoc, List<Allele>>(GenomeLocParser.createGenomeLoc(contig, pos), alleles);
|
||||
}
|
||||
|
||||
// a map to store our genotypes
|
||||
|
|
@ -405,6 +405,15 @@ public class VCF4Codec implements FeatureCodec, NameAwareCodec {
|
|||
return new VariantContext(name, locAndAlleles.first, locAndAlleles.second, genotypes, qual, filters, attributes);
|
||||
}
|
||||
|
||||
private boolean hasIndel(List<Allele> alleles) {
|
||||
int lengthOfFirstEntry = alleles.get(0).length();
|
||||
for ( int i = 1; i < alleles.size(); i++ ) {
|
||||
if ( alleles.get(i).length() != lengthOfFirstEntry )
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
class VCFParserException extends StingException {
|
||||
public VCFParserException(String msg) {
|
||||
super("Line " + lineNo + " generated parser exception " + msg);
|
||||
|
|
|
|||
Loading…
Reference in New Issue