Bug fix for VariantsToVCF: old dbSNP files can have '-' as reference base and those records always need to be padded.
This commit is contained in:
parent
4cf34ee9da
commit
79bc818022
|
|
@ -194,17 +194,18 @@ public class VariantContextAdaptors {
|
||||||
return null; // we weren't given enough reference context to create the VariantContext
|
return null; // we weren't given enough reference context to create the VariantContext
|
||||||
|
|
||||||
final byte refBaseForIndel = ref.getBases()[index];
|
final byte refBaseForIndel = ref.getBases()[index];
|
||||||
|
final boolean refBaseIsDash = dbsnp.getNCBIRefBase().equals("-");
|
||||||
|
|
||||||
boolean addPaddingBase;
|
boolean addPaddingBase;
|
||||||
if ( isSNP(dbsnp) || isMNP(dbsnp) )
|
if ( isSNP(dbsnp) || isMNP(dbsnp) )
|
||||||
addPaddingBase = false;
|
addPaddingBase = false;
|
||||||
else if ( isIndel(dbsnp) || dbsnp.getVariantType().contains("mixed") )
|
else if ( isIndel(dbsnp) || dbsnp.getVariantType().contains("mixed") )
|
||||||
addPaddingBase = VariantContextUtils.requiresPaddingBase(stripNullDashes(getAlleleList(dbsnp)));
|
addPaddingBase = refBaseIsDash || VariantContextUtils.requiresPaddingBase(stripNullDashes(getAlleleList(dbsnp)));
|
||||||
else
|
else
|
||||||
return null; // can't handle anything else
|
return null; // can't handle anything else
|
||||||
|
|
||||||
Allele refAllele;
|
Allele refAllele;
|
||||||
if ( dbsnp.getNCBIRefBase().equals("-") )
|
if ( refBaseIsDash )
|
||||||
refAllele = Allele.create(refBaseForIndel, true);
|
refAllele = Allele.create(refBaseForIndel, true);
|
||||||
else if ( ! Allele.acceptableAlleleBases(dbsnp.getNCBIRefBase()) )
|
else if ( ! Allele.acceptableAlleleBases(dbsnp.getNCBIRefBase()) )
|
||||||
return null;
|
return null;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue