Skip to content

Commit 71aef3a

Browse files
committed
Fix tests and update documentation
1 parent ea6c74b commit 71aef3a

13 files changed

Lines changed: 77 additions & 269 deletions

README.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ BIOSERVICES: access to biological web services programmatically
2020
.. image:: https://static.pepy.tech/personalized-badge/bioservices?period=month&units=international_system&left_color=black&right_color=orange&left_text=Downloads
2121
:target: https://pepy.tech/project/bioservices
2222

23+
.. image:: https://anaconda.org/conda-forge/bioservices/badges/version.svg
24+
:target: https://anaconda.org/conda-forge/bioservices
25+
26+
2327
|Codacy-Grade|
2428

2529

doc/all_relations.png

15.9 KB
Loading

doc/external_references.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ References to BioServices on the Web
55
* Galaxy: See the Log Archive at `Galaxy log archive <http://wiki.galaxyproject.org/Community/Log/2013/UsingBioServicesWithGalaxy>`_
66
* EBI: See `EBI programming web services <http://www.ebi.ac.uk/Tools/webservices/tutorials/06_programming/python>`_
77
* WikiPathways: `references <http://wikipathways.tumblr.com/search/bioservices>`_
8-
* GeneProf: `example python <https://www.geneprof.org/GeneProf/webapi.jsp#example-python>`_
98
* http://www.scoop.it/t/bioinformatique
109
* http://bioinfo-fr.net/bioservices-module-python
1110
* http://devbio.eu/?p=resources&presel=bioinfo

doc/geneprof_tutorial.rst

Lines changed: 0 additions & 226 deletions
This file was deleted.

doc/pymol_app.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import __main__
2+
__main__.pymol_argv = [ 'pymol', '-qc'] # Quiet and no GUI
3+
4+
import os
5+
if os.path.isfile("bioservices_pdb.png"):
6+
os.remove("bioservices_pdb.png")
7+
8+
# BioServices 1: obtain the PDB ID from a given uniprot ID (P43403 i.e. ZAP70)
9+
from bioservices import *
10+
print("Retrieving PDB ID")
11+
u = UniProt(verbose=False)
12+
res = u.mapping(fr="UniProtKB_AC-ID", to="PDB", query="P43403")
13+
pdb_id = res['results']['P43403'][0] # e.g, "1FBV"
14+
15+
# BioServices 2: Download the PDB file from the PDB Web Service
16+
print("Fetching PDB file")
17+
p = pdbe.PDBe()
18+
res = p.get_files(pdb_id)
19+
20+
# General: save the fetched file in a temporary file
21+
import tempfile
22+
fh = tempfile.NamedTemporaryFile()
23+
fh.write(res)
24+
sname = fh.name
25+
26+
# THIS IS NOT BIOSERVICES ANYMORE but PYMOL
27+
import pymol
28+
pymol.finish_launching()
29+
pymol.cmd.load(sname)
30+
pymol.cmd.png("bioservices_pdb.png", width="15cm", height="15cm", dpi=140)
31+
#pymol.cmd.png("my_image.png")
32+
# Get out!
33+
pymol.cmd.quit()

doc/references.rst

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Services
2929
ArrayExpress
3030
===================
3131

32-
.. .. automodule:: bioservices.arrayexpress
32+
.. automodule:: bioservices.arrayexpress
3333
:members:
3434
:undoc-members:
3535
:synopsis:
@@ -130,10 +130,6 @@ GeneProf
130130
Currently removed from the main API from version 1.6.0 onwards. You can still get
131131
the code in earlier version or in the github repository in the attic/ directory
132132

133-
.. .. automodule:: bioservices.geneprof
134-
:members:
135-
:undoc-members:
136-
:synopsis:
137133

138134
QuickGO
139135
================

doc/tutorials.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,3 @@ welcomed.
2121
compound_tutorial.rst
2222
convertor_tutorial.rst
2323
biomart.rst
24-
geneprof_tutorial.rst

src/bioservices/chembl.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -694,15 +694,19 @@ def get_organism(self, query=None, limit=20, offset=0, filters=None):
694694
params = {"limit": limit, "offset": offset, "filters": filters}
695695
return self._get_this_service("organism", query, params=params)
696696

697+
"""
698+
# subservices removed apparatently (march 2023) hence the commented code
699+
697700
def search_protein_class(self, query, limit=20, offset=0):
698701
params = {"limit": limit, "offset": offset}
699702
return self._search("protein_class", query, params=params)
700703
701704
def get_protein_class(self, query=None, limit=20, offset=0, filters=None):
702-
"""Protein family classification of TargetComponents"""
705+
"Protein family classification of TargetComponents"
703706
params = {"limit": limit, "offset": offset, "filters": filters}
704707
return self._get_this_service("protein_class", query, params=params)
705708
709+
"""
706710
def get_substructure(self, structure, limit=20, offset=0, filters=None):
707711
"""Molecule substructure search
708712
@@ -906,10 +910,10 @@ def get_image(self, query, dimensions=500, format="png", save=True, view=True, e
906910
.. todo:: ignorecoords option
907911
"""
908912
# NOTE: not async requests here.
909-
self.devtools.check_range(dimensions, 1, 500)
910-
self.devtools.check_param_in_list(engine, ["rdkit", "indigo"])
911-
self.devtools.check_param_in_list(format, ["png", "svg"])
912-
queries = self.devtools.to_list(query)
913+
self.services.devtools.check_range(dimensions, 1, 500)
914+
self.services.devtools.check_param_in_list(engine, ["rdkit", "indigo"])
915+
self.services.devtools.check_param_in_list(format, ["png", "svg"])
916+
queries = self.services.devtools.to_list(query)
913917

914918
res = {"filenames": [], "images": [], "chemblids": []}
915919
for query in queries:

0 commit comments

Comments
 (0)