Skip to content

Commit

Permalink
change to retrieve the protein accession instead of protein names.
Browse files Browse the repository at this point in the history
  • Loading branch information
ypriverol committed Aug 14, 2023
1 parent 2432672 commit 6d2da52
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ibaq/ibaqpy_commons.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,15 +254,15 @@ def get_mbr_hit(scan: str):
def parse_uniprot_accession(uniprot_id: str) -> str:
"""
Parse the uniprot accession from the uniprot id in the form of
tr|CONTAMINANT_Q3SX28|CONTAMINANT_TPM2_BOVIN and convert to CONTAMINANT_TPM2_BOVIN
tr|CONTAMINANT_Q3SX28|CONTAMINANT_TPM2_BOVIN and convert to CONTAMINANT_Q3SX28
:param uniprot_id: uniprot id
:return: uniprot accession
"""
uniprot_list = uniprot_id.split(";")
result_uniprot_list = []
for accession in uniprot_list:
if accession.count("|") == 2:
accession = accession.split("|")[2]
accession = accession.split("|")[1]
result_uniprot_list.append(accession)
return ";".join(result_uniprot_list)

Expand Down

0 comments on commit 6d2da52

Please sign in to comment.