Skip to content

Commit

Permalink
Fix a bug that doesn't record multiple proteins for one sequence.
Browse files Browse the repository at this point in the history
  • Loading branch information
fcyu committed Aug 22, 2017
1 parent 50fd06f commit a8f0947
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/main/java/proteomics/Index/BuildIndex.java
Original file line number Diff line number Diff line change
Expand Up @@ -256,13 +256,14 @@ private Map<String, Set<String>> buildSeqProMap(Map<String, String> pro_seq_map,
}
seq_term_map.put(target_seq, new boolean[]{n_term, c_term});

if (seq_pro_map.containsKey(target_seq)) {
seq_pro_map.get(target_seq).add(pro_id);
} else {
Set<String> pro_list = new HashSet<>(5, 1);
pro_list.add(pro_id);
seq_pro_map.put(target_seq, pro_list);
}
Set<String> pro_set = new HashSet<>(5, 1);
pro_set.add(pro_id);
seq_pro_map.put(target_seq, pro_set);
}

// considering the case that the sequence has multiple proteins. In the above if clock, such a protein wasn't recorded.
if (seq_pro_map.containsKey(target_seq)) {
seq_pro_map.get(target_seq).add(pro_id);
}
}
}
Expand All @@ -288,13 +289,12 @@ private Map<String, Set<String>> buildSeqProMap(Map<String, String> pro_seq_map,
}
seq_term_map.put(decoy_seq, new boolean[]{n_term, c_term});

if (seq_pro_map.containsKey(decoy_seq)) {
seq_pro_map.get(decoy_seq).add("DECOY_" + pro_id);
} else {
Set<String> pro_list = new HashSet<>(5, 1);
pro_list.add("DECOY_" + pro_id);
seq_pro_map.put(decoy_seq, pro_list);
}
Set<String> pro_set = new HashSet<>(5, 1);
pro_set.add("DECOY_" + pro_id);
seq_pro_map.put(decoy_seq, pro_set);
}
if (seq_pro_map.containsKey(decoy_seq)) {
seq_pro_map.get(decoy_seq).add("DECOY_" + pro_id);
}
}
}
Expand Down

0 comments on commit a8f0947

Please sign in to comment.