From 5b3160f08d48820fb10c2bb1edac12d82e0d6442 Mon Sep 17 00:00:00 2001 From: Thomas Cokelaer Date: Fri, 1 Jul 2022 15:54:22 +0200 Subject: [PATCH] Fix peptides.py to reflect new uniprot api --- src/bioservices/apps/peptides.py | 5 +++-- test/test_apps_peptides.py | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bioservices/apps/peptides.py b/src/bioservices/apps/peptides.py index 7566a123..3fc6aab9 100644 --- a/src/bioservices/apps/peptides.py +++ b/src/bioservices/apps/peptides.py @@ -8,7 +8,6 @@ class Peptides(object): :: >>> p = Peptides() - >>> p.get_fasta_sequence("Q8IYB3") >>> p.get_peptide_position("Q8IYB3", "VPKPEPIPEPKEPSPE") 189 @@ -25,9 +24,11 @@ def __init__(self, verbose=False): self.sequences = {} def get_fasta_sequence(self, uniprot_name): - seq = self.u.get_fasta_sequence(uniprot_name) + seq = self.u.get_fasta(uniprot_name) + seq = "".join(seq.split("\n")[1:]) return seq + def get_phosphosite_position(self, uniprot_name, peptide): if uniprot_name not in self.sequences.keys(): seq = self.get_fasta_sequence(uniprot_name) diff --git a/test/test_apps_peptides.py b/test/test_apps_peptides.py index 447528bd..c36071d8 100644 --- a/test/test_apps_peptides.py +++ b/test/test_apps_peptides.py @@ -6,5 +6,4 @@ def test_peptides(): p = Peptides() pos = p.get_phosphosite_position("Q8IYB3", "VPKPEPIPEPKEPSPE") assert pos == [740, 901] - p.get_fasta_sequence("Q8IYB3")