From baf8ae90872443ef85c92d5913541bb4e1be5834 Mon Sep 17 00:00:00 2001 From: Pieter Verschaffelt Date: Tue, 13 Jun 2023 11:38:10 +0200 Subject: [PATCH] Remove automatic change from I to L --- .../communication/peptide/Pept2DataCommunicator.ts | 4 ++-- .../PeptideCountTableProcessor.workerSource.ts | 13 +------------ 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/logic/communication/peptide/Pept2DataCommunicator.ts b/src/logic/communication/peptide/Pept2DataCommunicator.ts index 9e203fa4..546bac05 100644 --- a/src/logic/communication/peptide/Pept2DataCommunicator.ts +++ b/src/logic/communication/peptide/Pept2DataCommunicator.ts @@ -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)); } @@ -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); diff --git a/src/logic/processing/peptide/PeptideCountTableProcessor.workerSource.ts b/src/logic/processing/peptide/PeptideCountTableProcessor.workerSource.ts index fe14e2df..6c904da8 100644 --- a/src/logic/processing/peptide/PeptideCountTableProcessor.workerSource.ts +++ b/src/logic/processing/peptide/PeptideCountTableProcessor.workerSource.ts @@ -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); } /** @@ -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; -}