Skip to content

Commit

Permalink
Fix tests and update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
cokelaer committed Mar 8, 2023
1 parent ea6c74b commit 71aef3a
Show file tree
Hide file tree
Showing 13 changed files with 77 additions and 269 deletions.
4 changes: 4 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ BIOSERVICES: access to biological web services programmatically
.. image:: https://static.pepy.tech/personalized-badge/bioservices?period=month&units=international_system&left_color=black&right_color=orange&left_text=Downloads
:target: https://pepy.tech/project/bioservices

.. image:: https://anaconda.org/conda-forge/bioservices/badges/version.svg
:target: https://anaconda.org/conda-forge/bioservices


|Codacy-Grade|


Expand Down
Binary file added doc/all_relations.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion doc/external_references.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ References to BioServices on the Web
* Galaxy: See the Log Archive at `Galaxy log archive <http://wiki.galaxyproject.org/Community/Log/2013/UsingBioServicesWithGalaxy>`_
* EBI: See `EBI programming web services <http://www.ebi.ac.uk/Tools/webservices/tutorials/06_programming/python>`_
* WikiPathways: `references <http://wikipathways.tumblr.com/search/bioservices>`_
* GeneProf: `example python <https://www.geneprof.org/GeneProf/webapi.jsp#example-python>`_
* http://www.scoop.it/t/bioinformatique
* http://bioinfo-fr.net/bioservices-module-python
* http://devbio.eu/?p=resources&presel=bioinfo
Expand Down
226 changes: 0 additions & 226 deletions doc/geneprof_tutorial.rst

This file was deleted.

33 changes: 33 additions & 0 deletions doc/pymol_app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import __main__
__main__.pymol_argv = [ 'pymol', '-qc'] # Quiet and no GUI

import os
if os.path.isfile("bioservices_pdb.png"):
os.remove("bioservices_pdb.png")

# BioServices 1: obtain the PDB ID from a given uniprot ID (P43403 i.e. ZAP70)
from bioservices import *
print("Retrieving PDB ID")
u = UniProt(verbose=False)
res = u.mapping(fr="UniProtKB_AC-ID", to="PDB", query="P43403")
pdb_id = res['results']['P43403'][0] # e.g, "1FBV"

# BioServices 2: Download the PDB file from the PDB Web Service
print("Fetching PDB file")
p = pdbe.PDBe()
res = p.get_files(pdb_id)

# General: save the fetched file in a temporary file
import tempfile
fh = tempfile.NamedTemporaryFile()
fh.write(res)
sname = fh.name

# THIS IS NOT BIOSERVICES ANYMORE but PYMOL
import pymol
pymol.finish_launching()
pymol.cmd.load(sname)
pymol.cmd.png("bioservices_pdb.png", width="15cm", height="15cm", dpi=140)
#pymol.cmd.png("my_image.png")
# Get out!
pymol.cmd.quit()
6 changes: 1 addition & 5 deletions doc/references.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Services
ArrayExpress
===================

.. .. automodule:: bioservices.arrayexpress
.. automodule:: bioservices.arrayexpress
:members:
:undoc-members:
:synopsis:
Expand Down Expand Up @@ -130,10 +130,6 @@ GeneProf
Currently removed from the main API from version 1.6.0 onwards. You can still get
the code in earlier version or in the github repository in the attic/ directory

.. .. automodule:: bioservices.geneprof
:members:
:undoc-members:
:synopsis:

QuickGO
================
Expand Down
1 change: 0 additions & 1 deletion doc/tutorials.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,3 @@ welcomed.
compound_tutorial.rst
convertor_tutorial.rst
biomart.rst
geneprof_tutorial.rst
14 changes: 9 additions & 5 deletions src/bioservices/chembl.py
Original file line number Diff line number Diff line change
Expand Up @@ -694,15 +694,19 @@ def get_organism(self, query=None, limit=20, offset=0, filters=None):
params = {"limit": limit, "offset": offset, "filters": filters}
return self._get_this_service("organism", query, params=params)

"""
# subservices removed apparatently (march 2023) hence the commented code
def search_protein_class(self, query, limit=20, offset=0):
params = {"limit": limit, "offset": offset}
return self._search("protein_class", query, params=params)
def get_protein_class(self, query=None, limit=20, offset=0, filters=None):
"""Protein family classification of TargetComponents"""
"Protein family classification of TargetComponents"
params = {"limit": limit, "offset": offset, "filters": filters}
return self._get_this_service("protein_class", query, params=params)
"""
def get_substructure(self, structure, limit=20, offset=0, filters=None):
"""Molecule substructure search
Expand Down Expand Up @@ -906,10 +910,10 @@ def get_image(self, query, dimensions=500, format="png", save=True, view=True, e
.. todo:: ignorecoords option
"""
# NOTE: not async requests here.
self.devtools.check_range(dimensions, 1, 500)
self.devtools.check_param_in_list(engine, ["rdkit", "indigo"])
self.devtools.check_param_in_list(format, ["png", "svg"])
queries = self.devtools.to_list(query)
self.services.devtools.check_range(dimensions, 1, 500)
self.services.devtools.check_param_in_list(engine, ["rdkit", "indigo"])
self.services.devtools.check_param_in_list(format, ["png", "svg"])
queries = self.services.devtools.to_list(query)

res = {"filenames": [], "images": [], "chemblids": []}
for query in queries:
Expand Down
Loading

0 comments on commit 71aef3a

Please sign in to comment.