Skip to content

Commit

Permalink
Always consider first "M" situation.
Browse files Browse the repository at this point in the history
  • Loading branch information
fcyu committed Mar 15, 2018
1 parent c3c6c20 commit e275b43
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions src/main/java/proteomics/Index/BuildIndex.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ public BuildIndex(Map<String, String> parameter_map) throws Exception {
double one_minus_bin_offset = 1 - Double.valueOf(parameter_map.get("mz_bin_offset"));
ms1_bin_size = Double.valueOf(parameter_map.get("ms1_bin_size"));
inverseMs1BinSize = 1 / ms1_bin_size;
boolean cutNTermM = parameter_map.get("cut_nterm_methionine").contentEquals("1");

// Read fix modification
fix_mod_map.put('G', Double.valueOf(parameter_map.get("G")));
Expand Down Expand Up @@ -104,7 +103,7 @@ public BuildIndex(Map<String, String> parameter_map) throws Exception {

// generate seq_pro_map
Map<String, boolean[]> seq_term_map = new HashMap<>();
seqProMap = buildSeqProMap(pro_seq_map, seq_term_map, min_chain_length, max_chain_length, cutNTermM);
seqProMap = buildSeqProMap(pro_seq_map, seq_term_map, min_chain_length, max_chain_length);

// read var mods
Set<VarModParam> varModParamSet = new HashSet<>(30, 1);
Expand Down Expand Up @@ -220,7 +219,7 @@ public int massToBin(double mass) {
return (int) Math.floor(mass * inverseMs1BinSize);
}

private Map<String, Set<String>> buildSeqProMap(Map<String, String> pro_seq_map, Map<String, boolean[]> seq_term_map, int min_chain_length, int max_chain_length, boolean cutNTermM) {
private Map<String, Set<String>> buildSeqProMap(Map<String, String> pro_seq_map, Map<String, boolean[]> seq_term_map, int min_chain_length, int max_chain_length) {
Map<String, Set<String>> seq_pro_map = new HashMap<>(pro_seq_map.size() * 150, 1);
Set<String> for_check_duplicate = new HashSet<>();
for (String pro_id : pro_seq_map.keySet()) {
Expand All @@ -237,7 +236,7 @@ private Map<String, Set<String>> buildSeqProMap(Map<String, String> pro_seq_map,
if (pro_seq.startsWith(target_seq.substring(1, target_seq.length() - 1))) {
n_term = true;
}
if (cutNTermM && pro_seq.startsWith("M") && pro_seq.substring(1).startsWith(target_seq.substring(1, target_seq.length() - 1))) { // consider the first "M" being cut situation.
if (pro_seq.startsWith("M") && pro_seq.substring(1).startsWith(target_seq.substring(1, target_seq.length() - 1))) { // consider the first "M" being cut situation.
n_term = true;
}
if (pro_seq.endsWith(target_seq.substring(1, target_seq.length() - 1))) {
Expand All @@ -261,7 +260,7 @@ private Map<String, Set<String>> buildSeqProMap(Map<String, String> pro_seq_map,
String pro_seq = pro_seq_map.get(pro_id);
String decoy_pro_seq = (new StringBuilder(pro_seq)).reverse().toString();
Set<String> decoy_seq_set = mass_tool_obj.buildChainSet(decoy_pro_seq, linker_type);
if (cutNTermM && pro_seq.startsWith("M")) {
if (pro_seq.startsWith("M")) {
decoy_seq_set.addAll(mass_tool_obj.buildChainSet((new StringBuilder(pro_seq.substring(1))).reverse().toString(), linker_type));
}
for (String decoy_seq : decoy_seq_set) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/parameter.def
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ cal_evalue = 1 # 1 = calculate e-value; 0 = not.
ms1_bin_size = 0.001
delta_c_t = 0.00 # DeltaC threshold.
flanking_peaks = 0 # 1 = use flanking peaks; 0 = not.
append_contaminants = 0 # 1 = append contaminant proteins to the database; 0 = not
append_contaminants = 1 # 1 = append contaminant proteins to the database; 0 = not

# For debug.
# Put interested scan numbers below. One number each line.

0 comments on commit e275b43

Please sign in to comment.