Skip to content

Commit

Permalink
Minor improvement.
Browse files Browse the repository at this point in the history
  • Loading branch information
fcyu committed Aug 22, 2017
1 parent a8f0947 commit 2e3e9b0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/main/java/proteomics/ECL2.java
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,8 @@ private static void saveTargetResult(List<FinalResultEntry> result, Map<String,
pro_2 = re.pro_id_2.split(";")[0];
}

String annotate_1 = pro_annotate_map.get(pro_1).replace(",", ";");
String annotate_2 = pro_annotate_map.get(pro_2).replace(",", ";");
String annotate_1 = pro_annotate_map.get(pro_1).replace(',', ';');
String annotate_2 = pro_annotate_map.get(pro_2).replace(',', ';');

if (dev) {
writer.write(re.scan_num + "," + re.spectrum_id + "," + re.spectrum_mz + "," + re.spectrum_mass + "," + re.peptide_mass + "," + re.rt + "," + re.C13_correction + "," + re.charge + "," + String.format(Locale.US, "%.4f", re.score) + "," + re.delta_c + "," + String.format(Locale.US, "%.2f", re.ppm) + "," + re.seq_1 + "-" + link_site_1 + "-" + re.seq_2 + "-" + link_site_2 + "," + re.pro_id_1 + "-" + re.pro_id_2 + ",\"" + annotate_1 + "\",\"" + annotate_2 + "\"," + (cal_evalue ? String.format(Locale.US, "%E", re.e_value) : "-") + "," + String.format(Locale.US, "%.4f", re.qvalue) + ",\"" + re.mgfTitle + "\",," + re.candidate_num + "," + re.point_count + "," + String.format(Locale.US, "%.4f", re.r_square) + "," + String.format(Locale.US, "%.4f", re.slope) + "," + String.format(Locale.US, "%.4f", re.intercept) + "," + re.start_idx + "," + re.end_idx + "," + String.format(Locale.US, "%.4f", re.chain_score_1) + "," + re.chain_rank_1 + "," + String.format(Locale.US, "%.4f", re.chain_score_2) + "," + re.chain_rank_2 + "\n");
Expand Down Expand Up @@ -277,12 +277,12 @@ private static void saveDecoyResult(List<FinalResultEntry> result, Map<String, S

if (!re.pro_id_1.startsWith("DECOY")) {
String pro_1 = re.pro_id_1.split(";")[0];
annotate_1 = pro_annotate_map.get(pro_1).replace(",", ";");
annotate_1 = pro_annotate_map.get(pro_1).replace(',', ';');
}

if (!re.pro_id_2.startsWith("DECOY")) {
String pro_2 = re.pro_id_2.split(";")[0];
annotate_2 = pro_annotate_map.get(pro_2).replace(",", ";");
annotate_2 = pro_annotate_map.get(pro_2).replace(',', ';');
}

if (dev) {
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/proteomics/Index/BuildIndex.java
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,9 @@ private Map<String, Set<String>> buildSeqProMap(Map<String, String> pro_seq_map,
Set<String> seq_set = mass_tool_obj.buildChainSet(pro_seq, linker_type);
for (String target_seq : seq_set) {
if ((target_seq.length() >= min_chain_length) && (target_seq.length() <= max_chain_length) && !target_seq.contains("B") && !target_seq.contains("J") && !target_seq.contains("X") && !target_seq.contains("Z")) {
if (!for_check_duplicate.contains(target_seq.replace("L", "I"))) {
if (!for_check_duplicate.contains(target_seq.replace('L', 'I'))) {
// Add the sequence to the check set for duplicate check
for_check_duplicate.add(target_seq.replace("L", "I")); // "L" and "I" have the same mass
for_check_duplicate.add(target_seq.replace('L', 'I')); // "L" and "I" have the same mass

boolean n_term = false;
boolean c_term = false;
Expand Down Expand Up @@ -276,8 +276,8 @@ private Map<String, Set<String>> buildSeqProMap(Map<String, String> pro_seq_map,
Set<String> decoy_seq_set = mass_tool_obj.buildChainSet(decoy_pro_seq, linker_type);
for (String decoy_seq : decoy_seq_set) {
if ((decoy_seq.length() >= min_chain_length) && (decoy_seq.length() <= max_chain_length) && !decoy_seq.contains("B") && !decoy_seq.contains("J") && !decoy_seq.contains("X") && !decoy_seq.contains("Z")) {
if (!for_check_duplicate.contains(decoy_seq.replace("L", "I"))) {
for_check_duplicate.add(decoy_seq.replace("L", "I"));
if (!for_check_duplicate.contains(decoy_seq.replace('L', 'I'))) {
for_check_duplicate.add(decoy_seq.replace('L', 'I'));

boolean n_term = false;
boolean c_term = false;
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/proteomics/Search/Search.java
Original file line number Diff line number Diff line change
Expand Up @@ -285,11 +285,14 @@ public FinalResultEntry convertResultEntry(int scanNum, ResultEntry result_entry
if (temp_2.startsWith("DECOY_")) {
temp_2 = temp_2.substring(6);
}
if (temp_1.contentEquals(temp_2)) {
if (temp_1.contentEquals(temp_2)) { // bias to intra protein cross-linking
keep = true;
break;
}
}
if (keep) {
break;
}
}

if (!keep) {
Expand Down

0 comments on commit 2e3e9b0

Please sign in to comment.