Skip to content

Commit

Permalink
Add flanking peak.
Browse files Browse the repository at this point in the history
  • Loading branch information
fcyu committed May 21, 2017
1 parent e86ee1e commit a4ef245
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/main/java/proteomics/ECL2.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public class ECL2 {
public static final double delta_c_t = 0;
public static final int score_point_t = 15000;
public static final int random_score_point_t = 2;
public static final boolean flankingPeaks = true;

private static final Logger logger = LoggerFactory.getLogger(ECL2.class);
private static final String version = "2.1.3";
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/proteomics/Spectrum/PreSpectrum.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@ private SparseVector prepareXcorr(double[] pl_array) {

for (int i = 1; i < pl_array.length; ++i) {
double temp = pl_array[i] - tempArray[i];

if (ECL2.flankingPeaks) {
temp += (pl_array[i - 1] - tempArray[i - 1]) * 0.5;
if (i + 1 < pl_array.length) {
temp += (pl_array[i + 1] - tempArray[i + 1]) * 0.5;
}
}

if (Math.abs(temp) > 1e-6) {
xcorr_pl.put(i, (float) temp);
}
Expand Down

0 comments on commit a4ef245

Please sign in to comment.