Quick fix for HC refactoring: when copying over Haplotype objects, make sure to copy over the artificial allele used to create it too.

This commit is contained in:
Eric Banks 2012-11-19 09:57:55 -05:00
parent ff180a8e02
commit f0b8a0228f
2 changed files with 6 additions and 0 deletions

View File

@ -369,6 +369,8 @@ public class SimpleDeBruijnAssembler extends LocalAssemblyEngine {
h.setAlignmentStartHapwrtRef( swConsensus2.getAlignmentStart2wrt1() );
h.setCigar( AlignmentUtils.leftAlignIndel(swConsensus2.getCigar(), ref, h.getBases(), swConsensus2.getAlignmentStart2wrt1(), 0) );
if ( haplotype.isArtificialHaplotype() )
h.setArtificialAllele(haplotype.getArtificialAllele());
h.leftBreakPoint = leftBreakPoint;
h.rightBreakPoint = rightBreakPoint;
if( swConsensus2.getCigar().toString().contains("S") || swConsensus2.getCigar().getReferenceLength() != activeRegionStop - activeRegionStart ) { // protect against SW failures

View File

@ -185,6 +185,10 @@ public class Haplotype {
return artificialAllele;
}
public void setArtificialAllele(final Allele artificialAllele) {
this.artificialAllele = artificialAllele;
}
@Requires({"refInsertLocation >= 0"})
public Haplotype insertAllele( final Allele refAllele, final Allele altAllele, final int refInsertLocation ) {
// refInsertLocation is in ref haplotype offset coordinates NOT genomic coordinates