Reference Manual

module PseudomonasDotComScraper:
 Hosting the PseudomonasDotComScraper, an API for the https://www.pseudomonas.com database web interface.
class GenDBScraper.PseudomonasDotComScraper.PseudomonasDotComScraper(query=None)[source]

An API for the pseudomonas.com genome database using web scraping technology.

connect()[source]

Connect to the database.

from_json(infile)[source]

Deserialize a json file into a results dictionary (a dict of pandas.DataFrame).

Parameters:infile (str) – The file path of the json file to load.
query

Get the query.

Returns:The query object.
Return type:pdc_query
run_query(query=None)[source]

Run a query on pseudomonas.com

Parameters:query ([list of] (pdc_query | dict)) – The query object to run.
Returns:The query results as a dictionary with ‘strain_feature’ keys.
Return type:dict
to_json(results, outfile=None)[source]

Serialize results dictionary to json.

Parameters:
  • results (dict) – The results dictionary (dict of pandas.DataFrame).
  • outfile (str) – Path to file for writing query results to. Default: None, will write to temp file.
Raises:

IOError – ‘outfile’ not writable.

Returns:

If successful, path to written file.

class GenDBScraper.PseudomonasDotComScraper.pdc_query(strain, feature, organism)
feature

Alias for field number 1

organism

Alias for field number 2

strain

Alias for field number 0

module StringDBScraper:
 Hosting the StringDBScraper, an API for the https://string-db.org database web interface.
class GenDBScraper.StringDBScraper.StringDBScraper(query=None)[source]

An API for the string-db.org protein interaction database.

functional_enrichments()[source]

Get the interaction partners.

interaction_enrichments(required_score=None)[source]

Get the interaction enrichments.

Parameters:required_score – The minimum score for an interaction to be considered.
interaction_partners(required_score=None, limit=None)[source]

Get the interaction partners.

Parameters:
  • required_score – The minimum score for an interaction to be considered.
  • limit (int) – Limit the number of matches per query identifier (best matches come first). Default: limit=1
network_image(query=None, image_format='png', flavor=None, white_nodes=None, color_nodes=None, show_image=False)[source]

Grab the protein network image for given proteins (genes).

Parameters:
  • query ((stringdb_query | dict)) – The (updated) query to submit.
  • image_format (str) – The image format for the network image (png, svg, hires_png)
  • flavor (str) – The type of network to draw between nodes (evidence, confidence (default), or actions).
  • white_nodes (int) – The number of white nodes to add. Default is 10 for single queries, 0 for multiple queries.
  • color_nodes (int) – The number of color nodes to add. Default is 0.
  • show_image (bool) – Whether to render the image (default False). WARNING: untested feature.
network_interactions(nodes=None)[source]

Get the string-db network interactions as a pandas.DataFrame.

Parameters:nodes (int) – The number of nodes to to add to the network based on their confidence score.
query

Get the query.

Returns:The query object.
Return type:pdc_query
resolve_id(**kwargs)[source]

Resolve the given identifier(s) to string-db.org’s own identifiers.

Parameters:limit (int) – (Optional): Limit the number of matches per query identifier (best matches come first). Default: limit=1
similarity_scores()[source]

Get the interaction partners.

Parameters:required_score – The minimum score for an interaction to be considered.
update_features()[source]

Replace the query features by the string-db identifiers.

class GenDBScraper.StringDBScraper.stringdb_query(taxonId, features)
features

Alias for field number 1

taxonId

Alias for field number 0