apollo.remote package¶
Module contents¶
Contains possible interactions with the Apollo Organisms Module
-
class
apollo.remote.
RemoteClient
(webapolloinstance, **requestArgs)¶ Bases:
apollo.client.Client
-
CLIENT_BASE
= '/organism/'¶
-
add_organism
(common_name, organism_data, blatdb=None, genus=None, species=None, public=None, non_default_translation_table=None, metadata=None)¶ Add an organism using the remote organism API.
The recommended structure for the genome data tarball is as follows:
names/ names/root.json searchDatabaseData/blat_db.2bit seq/ seq/fba/ seq/fba/da8/ seq/fba/da8/f3/ seq/fba/da8/f3/Mijalis-0.txt seq/fba/da8/f3/Mijalis-1.txt seq/fba/da8/f3/Mijalis-2.txt seq/fba/da8/f3/Mijalis-3.txt seq/fba/da8/f3/Mijalis-4.txt seq/refSeqs.json tracks/ trackList.json tracks.conf
The genome name / hashed directories below the seq folder will obviously be specific to your organism.
Parameters: - common_name (str) – Organism common name
- organism_data (file) – .tar.gz or .zip archive containing the data directory.
- blatdb (file) – Path to 2bit index of the genome for Blat (Blat 2bit data can also be in organism_data in directory ‘searchDatabaseData’)
- genus (str) – Genus
- species (str) – Species
- public (bool) – should the organism be public
- non_default_translation_table (int) – The translation table number for the organism (if different than that of the server’s default)
- metadata (str) – JSON formatted arbitrary metadata
Return type: dict
Returns: a dictionary with information about the new organism
-
add_track
(organism_id, track_data, track_config)¶ Adds a tarball containing track data to an existing organism.
The recommended structure for your track data tarball is as follows:
tracks/testing2/ tracks/testing2/Mijalis/ tracks/testing2/Mijalis/hist-2000-0.json tracks/testing2/Mijalis/lf-1.json tracks/testing2/Mijalis/lf-2.json tracks/testing2/Mijalis/lf-3.json tracks/testing2/Mijalis/names.txt tracks/testing2/Mijalis/trackData.json
And an example of the track_config supplied at the same time:
{ "key": "Some human-readable name", "label": "my-cool-track", "storeClass": "JBrowse/Store/SeqFeature/NCList", "type": "FeatureTrack", "urlTemplate": "tracks/testing2/{refseq}/trackData.json" }
This is only the recommended structure, other directory structures / parameter combinations may work but were not tested by the python-apollo author who wrote this documentation.
Parameters: - organism_id (str) – Organism ID Number
- track_data (file) – .tar.gz or .zip archive containing the <track> directory.
- track_config (dict) – Track configuration
Return type: dict
Returns: a dictionary with information about all tracks on the organism
-
delete_organism
(organism_id)¶ Remove an organism completely.
Parameters: organism_id (str) – Organism ID Number Return type: dict Returns: a dictionary with information about the deleted organism
-
delete_track
(organism_id, track_label)¶ Remove a track from an organism
Parameters: - organism_id (str) – Organism ID Number
- track_label (str) – Track label
Return type: dict
Returns: a dictionary with information about the deleted track
-
update_organism
(organism_id, organism_data, blatdb=None, common_name=None, genus=None, species=None, public=None, metadata=None, no_reload_sequences=False)¶ Update an organism using the remote organism API.
The recommended structure for the genome data tarball is as follows:
names/ names/root.json searchDatabaseData/blat_db.2bit seq/ seq/fba/ seq/fba/da8/ seq/fba/da8/f3/ seq/fba/da8/f3/Mijalis-0.txt seq/fba/da8/f3/Mijalis-1.txt seq/fba/da8/f3/Mijalis-2.txt seq/fba/da8/f3/Mijalis-3.txt seq/fba/da8/f3/Mijalis-4.txt seq/refSeqs.json tracks/ trackList.json tracks.conf
The genome name / hashed directories below the seq folder will obviously be specific to your organism.
Parameters: - organism_id (str) – Organism ID Number
- organism_data (file) – .tar.gz or .zip archive containing the data directory.
- blatdb (file) – Path to 2bit index of the genome for Blat (Blat 2bit data can also be in organism_data in directory ‘searchDatabaseData’)
- common_name (str) – Organism common name
- genus (str) – Genus
- species (str) – Species
- public (bool) – User’s email
- metadata (str) – JSON formatted arbitrary metadata
- no_reload_sequences (bool) – Set this if you don’t want Apollo to reload genome sequences (no change in genome sequence)
Return type: dict
Returns: a dictionary with information about the updated organism
-
update_track
(organism_id, track_config)¶ Update the configuration of a track that has already been added to the organism. Will not update data for the track.
And an example of the track_config supplied:
{ "key": "Some human-readable name", "label": "my-cool-track", "storeClass": "JBrowse/Store/SeqFeature/NCList", "type": "FeatureTrack", "urlTemplate": "tracks/testing2/{refseq}/trackData.json" }
Parameters: - organism_id (str) – Organism ID Number
- track_config (dict) – Track configuration
Return type: dict
Returns: a dictionary with information about all tracks on the organism
-