Only 'pad' the cycle covariate for indels, not substitutions

This commit is contained in:
Eric Banks 2012-07-03 23:47:01 -04:00
parent 17efbbf8b1
commit 7d30558e6f
1 changed files with 5 additions and 4 deletions

View File

@ -48,6 +48,7 @@ import java.util.EnumSet;
public class CycleCovariate implements StandardCovariate {
private static final int MAXIMUM_CYCLE_VALUE = 1000;
private static final int CUSHION_FOR_INDELS = 4;
private static final EnumSet<NGSPlatform> DISCRETE_CYCLE_PLATFORMS = EnumSet.of(NGSPlatform.ILLUMINA, NGSPlatform.SOLID, NGSPlatform.PACBIO, NGSPlatform.COMPLETE_GENOMICS);
private static final EnumSet<NGSPlatform> FLOW_CYCLE_PLATFORMS = EnumSet.of(NGSPlatform.LS454, NGSPlatform.ION_TORRENT);
@ -79,11 +80,11 @@ public class CycleCovariate implements StandardCovariate {
increment = readOrderFactor;
}
final int CUSHION = 4;
final int MAX_CYCLE = readLength - CUSHION - 1;
final int MAX_CYCLE_FOR_INDELS = readLength - CUSHION_FOR_INDELS - 1;
for (int i = 0; i < readLength; i++) {
final int key = (i<CUSHION || i>MAX_CYCLE) ? -1 : keyFromCycle(cycle);
values.addCovariate(key, key, key, i);
final int substitutionKey = keyFromCycle(cycle);
final int indelKey = (i < CUSHION_FOR_INDELS || i > MAX_CYCLE_FOR_INDELS) ? -1 : substitutionKey;
values.addCovariate(substitutionKey, indelKey, indelKey, i);
cycle += increment;
}
}