Skip to content

Commit

Permalink
add pair killing
Browse files Browse the repository at this point in the history
  • Loading branch information
baltzell committed Oct 17, 2024
1 parent 90f57f1 commit 7b322fc
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,34 @@ protected final boolean analyze() {
return integrity && geninit;
}

private final int rejectPairs() {
int n = 0;
for (int ii=0; ii<this.states.size(); ii++) {
if (this.states.get(ii).getSwStatus()!=0 || this.states.get(ii).getHwStatus()!=0
|| this.states.get(ii).getHelicity() == HelicityBit.UDF) {
if (this.states.get(ii).getPairSync() == HelicityBit.PLUS) {
if (ii<this.states.size()-1) {
this.states.get(ii+1).addSwStatusMask(HelicityState.Mask.KILLPAIR);
this.states.get(ii).addSwStatusMask(HelicityState.Mask.KILLPAIR);
n++;
}
}
else if (ii>0) {
this.states.get(ii-1).addSwStatusMask(HelicityState.Mask.KILLPAIR);
this.states.get(ii).addSwStatusMask(HelicityState.Mask.KILLPAIR);
n++;
}
}
}
if (this.states.get(0).getPairSync() == HelicityBit.MINUS) {
this.states.get(0).addSwStatusMask(HelicityState.Mask.KILLPAIR);
}
if (this.states.get(this.states.size()-1).getPairSync() == HelicityBit.PLUS) {
this.states.get(this.states.size()-1).addSwStatusMask(HelicityState.Mask.KILLPAIR);
}
return n;
}

/**
* Perform integrity checking on the sequence.
* @return whether the integrity checking succeeded
Expand Down Expand Up @@ -461,7 +489,8 @@ else if (seconds > (1.0+0.5)/this.helicityClock) {
"\nQUARTET ERRORS: "+quartetErrors+
"\nBIGGAP ERRORS: "+bigGapErrors+
"\nSMALLGAP ERRORS: "+smallGapErrors+
"\nGENERATOR ERRORS: "+generatorErrors
"\nGENERATOR ERRORS: "+generatorErrors+
"\nKILLPAIR ERRORS: "+rejectPairs()
);

return (hwpErrors+syncErrors+quartetErrors+bigGapErrors+smallGapErrors+generatorErrors) == 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public static class Mask {
public static final int PATTERN =0x4;
public static final int BIGGAP =0x8;
public static final int SMALLGAP =0x10;
public static final int KILLPAIR =0x12;
}

// FIXME: these should go in CCDB
Expand Down

0 comments on commit 7b322fc

Please sign in to comment.