freegenes.main package¶
Module contents¶
Copyright (C) 2019 Vanessa Sochat.
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
class
freegenes.main.
Client
(token=None, base='https://freegenes.dev', validate=True)[source]¶ Bases:
object
create a new author using the FreeGenes API. Must be superuser or staff, and provide required fields in data.
-
create_collection
(name, description, parent_id, uuid=None, tag_ids=None, update=False)[source]¶ create a new collection using the FreeGenes API. Must be superuser or staff, and provide required fields in data.
-
create_composite_part
(name, sequence, uuid=None, circular=True, part_ids=None, description=None, direction_string=None, composite_id=None, composite_type=None, update=False)[source]¶ create a new composite part from a sequence. If no parts are provided, then we search the provided sequence for all parts in FreeGenes, and make the association (and derive directions). The data for the parts is cached with the client so we only need to derive it once.
Parameters: - name (a name for the composite part (required))
- sequence (the new sequence (required))
- circular (is the sequence circular? (default True))
- part_ids (a list of one or more part ids (optional))
- description (a string description (optional))
- composite_id (a composite id (optional) (like gene_id for a part))
- composite_type (the type of composite part (optional))
-
create_container
(name, container_type, description, parent_id, uuid=None, estimated_temperature=None, x=None, y=None, z=None, update=False)[source]¶ create a new container using the FreeGenes API. Must be superuser or staff, and provide required fields in data.
-
create_distribution
(name, description, plateset_ids, uuid=None, update=False)[source]¶ create a new distribution using the FreeGenes API. Must be superuser or staff, and provide required fields in data.
-
create_entity
(name, data=None)[source]¶ create an entity with a POST request.
Parameters: - name (the name of the endpoint to post to.)
- data (key word arguments to include.)
-
create_institution
(name, uuid=None, signed_master=False, update=False)[source]¶ create a new institution using the FreeGenes API. Must be superuser or staff, and provide required fields in data.
-
create_module
(name, container_id, notes, model_id, module_type, uuid=None, module_data=None, update=False)[source]¶ create a new module using the FreeGenes API. Must be superuser or staff, and provide required fields in data.
-
create_operation
(name, description, uuid=None, plan_ids=None, update=False)[source]¶ create a new operation using the FreeGenes API. Must be superuser or staff, and provide required fields in data.
-
create_order
(name, notes, uuid=None, distribution_ids=None, update=False)[source]¶ create a new order using the FreeGenes API. Must be superuser or staff, and provide required fields in data.
-
create_organism
(name, description, genotype, uuid=None, update=False)[source]¶ create a new organism using the FreeGenes API. Must be superuser or staff, and provide required fields in data.
-
create_part
(name, gene_id, author_id, part_type, primer_forward, primer_reverse, uuid=None, genbank=None, original_sequence=None, optimized_sequence=None, synthesized_sequence=None, full_sequence=None, vector=None, description=None, status=None, barcode=None, translation=None, tag_ids=None, collection_ids=None, update=False)[source]¶ create a new part using the FreeGenes API. Must be superuser or staff, and provide required fields in data.
-
create_plan
(name, description, status, operation_id, uuid=None, parent_id=None, update=False)[source]¶ create a new plan using the FreeGenes API. Must be superuser or staff, and provide required fields in data.
-
create_plate
(name, container_id, plate_type, plate_form, status, notes, uuid=None, protocol_id=None, well_ids=None, thaw_count=None, height=None, length=None, update=False)[source]¶ create a new plate using the FreeGenes API. Must be superuser or staff, and provide required fields in data.
-
create_plateset
(name, description, plate_ids, uuid=None, update=False)[source]¶ create a new plateset using the FreeGenes API. Must be superuser or staff, and provide required fields in data.
-
create_protocol
(description, uuid=None, protocol_data=None, schema_id=None, update=False)[source]¶ create a new protocol using the FreeGenes API. Must be superuser or staff, and provide required fields in data.
-
create_robot
(name, robot_id, container_id, notes, server_version, left_mount_id, right_mount_id, uuid=None, robot_type=None, update=False)[source]¶ create a new robot using the FreeGenes API. Must be superuser or staff, and provide required fields in data.
-
create_sample
(part_id, well_ids, uuid=None, status=None, evidence=None, outside_collaborator=True, vendor=None, sample_type=None, index_forward=None, index_reverse=None, update=False)[source]¶ create a new sample using the FreeGenes API. Must be superuser or staff, and provide required fields in data.
-
create_schema
(name, description, uuid=None, schema=None, schema_version=None, update=False)[source]¶ create a new schema using the FreeGenes API. Must be superuser or staff, and provide required fields in data.
-
create_tag
(tag, uuid=None, update=False)[source]¶ create a new tag using the FreeGenes API. Must be superuser or staff, and provide required fields in data.
-
delete
(url, headers=None)[source]¶ data is required (typically with a unique id in the url to identify the object to delete)
Parameters: url (the url endpoint to query (without the http/s or domain))
-
delete_entity
(name, uuid)[source]¶ delete an entity with a DELETE request. For all entities, we take the uuid, and the name of the delete endpoint.
-
get
(url, headers=None, paginate=True, limit=1000)[source]¶ the default get, will use default headers if custom aren’t defined. we take a partial url (e.g., /api/authors) and then add the base.
Parameters: - url (the url endpoint to query (without the http/s or domain))
- headers (if defined, don’t use default headers.)
- paginate (obtain all pages after query (default is True))
- limit (number of responses per query (default 1000))
-
get_entity
(name, uuid=None)[source]¶ return a single entity if a uuid is provided, otherwise a list
Parameters: uuid (the unique resource identifier of the entity)
-
patch_entity
(name, uuid, data)[source]¶ A partial update performs a patch, allowing for update of just a single (or not all required) fields.
-
post
(url, data=None, headers=None)[source]¶ a wrapper to create, providing requests.post as the function
-
put
(url, data=None, headers=None)[source]¶ a wrapper to create, providing requests.put as the function
-
update_composite_part
(uuid, name, sequence, circular=True, part_ids=None, description=None, direction_string=None, composite_id=None, composite_type=None, update=False)[source]¶
-
update_container
(uuid, name, container_type, description, parent_id, estimated_temperature=None, x=None, y=None, z=None)[source]¶
-
update_entity
(name, uuid, data)[source]¶ delete an entity with a DELETE request. For all entities, we take the uuid, and the name of the delete endpoint.
-
update_part
(uuid, name, gene_id, author_id, part_type, primer_forward, primer_reverse, genbank=None, original_sequence=None, optimized_sequence=None, synthesized_sequence=None, full_sequence=None, vector=None, description=None, status=None, barcode=None, translation=None, tag_ids=None, collection_ids=None)[source]¶
-
update_plate
(uuid, name, container_id, plate_type, plate_form, status, notes, protocol_id=None, well_ids=None, thaw_count=None, height=None, length=None)[source]¶
-
update_robot
(uuid, name, robot_id, container_id, notes, server_version, left_mount_id, right_mount_id, robot_type=None)[source]¶