Skip to content

Commit

Permalink
Remove automatic change from I to L
Browse files Browse the repository at this point in the history
  • Loading branch information
pverscha committed Jun 13, 2023
1 parent 72e9984 commit baf8ae9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/logic/communication/peptide/Pept2DataCommunicator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default class Pept2DataCommunicator {
try {
const response = await NetworkUtils.postJson(this.apiBaseUrl + "/mpa/pept2data", requestData);

for(const peptide of response.peptides) {
for (const peptide of response.peptides) {
result.set(peptide.sequence, PeptideData.createFromPeptideDataResponse(peptide));
}

Expand All @@ -72,7 +72,7 @@ export default class Pept2DataCommunicator {

try {
// Perform the actual requests in parallel. (await cannot be removed!!)
await parallelLimit(requests, this.parallelRequests);
await parallelLimit(requests, this.parallelRequests);

const trustProcessor = new PeptideTrustProcessor();
const trust = trustProcessor.getPeptideTrust(countTable, result);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ import Peptide from "../../../logic/ontology/peptide/Peptide";

function filter(peptides: Peptide[], enableMissingCleavageHandling: boolean, equateIl: boolean): Peptide[] {
let out = cleavePeptides(peptides, enableMissingCleavageHandling);
out = filterShortPeptides(out);
return equateIL(out, equateIl);
return filterShortPeptides(out);
}

/**
Expand All @@ -68,13 +67,3 @@ function cleavePeptides(peptides: Peptide[], advancedMissedCleavageHandling: boo
function filterShortPeptides(peptides: Peptide[]): Peptide[] {
return peptides.filter(p => p.length >= 5);
}

/**
* Replaces every I with an L if equateIL is set to true.
*/
function equateIL(peptides: Peptide[], equateIL: boolean): Peptide[] {
if (equateIL) {
return peptides.map(p => p.replace(/I/g, "L"));
}
return peptides;
}

0 comments on commit baf8ae9

Please sign in to comment.