Bug fix: when padding alleles in creating a Variant context from an indel, leave no-call alleles as no-call alleles.

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@3940 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
delangel 2010-08-04 19:51:10 +00:00
parent 38e65f6e1b
commit 86211b74e8
1 changed files with 8 additions and 2 deletions

View File

@ -539,8 +539,14 @@ public class VariantContextUtils {
List<Allele> inAlleles = g.getAlleles();
List<Allele> newGenotypeAlleles = new ArrayList<Allele>();
for (Allele a : inAlleles) {
String newBases = new String(new byte[]{refByte}) + new String(a.getBases());
newGenotypeAlleles.add(Allele.create(newBases,a.isReference()));
if (a.isCalled()) {
String newBases = new String(new byte[]{refByte}) + new String(a.getBases());
newGenotypeAlleles.add(Allele.create(newBases,a.isReference()));
}
else {
// add no-call allele
newGenotypeAlleles.add(Allele.NO_CALL);
}
}
genotypes.put(sample, new Genotype(sample, newGenotypeAlleles, g.getNegLog10PError(),
g.getFilters(),g.getAttributes(),g.genotypesArePhased()));