ISA tools API
model.py
file has been split into the model
module. Each class has been split into a dedicated file.from_dict()
to the ISA Investigation class to let users load objects from a dictionary.to_dict()
to each ISA model class that let users dump ISA objects to dictionaries. (also see ISA JSONLD section)isatab.py
file has been split into the isatab
module.
Functions and classes have been split into three submodules: load
(to read isatab files), dump
(to write isafiles) and validate
(to run validation rules against an isatab file). Usage remains the same.isajson.py
file has been split into the isajson
module.
Functions and classes have been split into three files: load.py
, dump.py
and validate.py
. Usage remains the same but there is now an alternative using dicts instead of files (see below)load.py
and dump.py
are now wrappers. The code of the isa json serializer/deserializer has been moved to be part of the ISA model. Users can still use the old load()
and dump()
methods but are now able to do it directly from an investigation object. Examplefrom json import load
from isatools.model import Investigation
isa_json_file = 'path/to/isa.json' # the json file path
with open(isa_json_file, 'r') as f:
isa_json_input = load(f) # load the dict from the file
investigation = Investigation() # create en investigation
investigation.from_dict(isa_json_input) # feed in the dictionary, will generated missing identifiers make inputs and outputs different
isa_json_output = investigation.to_dict() # Dump it back to a dict
another_investigation = Investigation() # create en investigation
another_investigation.from_dict(isa_json_output) # feed in the dictionary
assert investigation == another_investigation # assert equality between the created investigations.
assert investigation.to_dict() == another_investigation.to-dict() # compare to_dict() methods
Note: identifiers may be missing from the json file and autogenerated by the ISA objects. In this case, output dictionnaries won't match which is why the investigation is being compared to another investigation.
to_dict()
function from model.py, it is possible to produce JSON-LD.
The The method takes an optional boolean parameter ld
(default to False
) that serializes to json-ld dictionaries by injecting @context
, @id
and @type
attributes. See isa json below for more information.set_context()
function of the model
module.set_context(vocab='wd', all_in_one=False, local=False, include_contexts=False)
we were able to produce RDF triples and store them into a virtuosoDB and a berkeleyDB with SPARQL support.from isatools.net.mtbls import MTBLSInvestigation
investigation = MTBLSInvestigation('MTBLS1')
# This creates a temp dir for the investigation that gets deleted when the object is destroyed through the automatic garbage collector. You can pass a directory if you want to persist the investigation.
investigation = MTBLSInvestigation(mtbls_id='MTBLS1', output_directory="path/to/output/dir", output_format='tab')
# You can then run all the old function through methods with the same name and chain methods without downloading the whole investigation again.
print(investigation.get_characteristics_summary())
print(investigation.get_factor_names())
Enhancements and Cleanup:
isatab.dump()
via reworking the study/assay graph implementation. This can improve up to 3 or 4 orders of magnitude the writing to ISA-tab for datasets with thousands of samples (PR #403). An additional tweak has been implemented to compute only once the study/assay process graph (8c2d09da6599dc89e3f6cfe8719c125c50fa3690)Commentable
(PR #395)isatools.create.connectors
now supports both strings and Ontology Annotations for Subject Type and Sample Type (PR #405)Breaking changes:
isatools.create.connectors
module to align it with the Datascriptor study JSON config. Now the Datascriptor study config has a "design" property holding all the study design information (PR #405)Bug Fixes:
isatools.create.connectors
from Datascriptor study configs are unique (issue #398)Enhancements and Cleanup:
isatab.dump()
via reworking the study/assay graph implementation. This can improve up to 3 or 4 orders of magnitude the writing to ISA-tab for datasets with thousands of samples (PR #403)Commentable
(PR #395)isatools.create.connectors
now supports both strings and Ontology Annotations for Subject Type and Sample Type (PR #405)Breaking changes:
isatools.create.connectors
module to align it with the Datascriptor study JSON config. Now the Datascriptor study config has a "design" property holding all the study design information (PR #405)Bug Fixes:
isatools.create.connectors
from Datascriptor study configs are unique (issue #398)This Bugfix release fixes the broken networkx
dependency in setup.py
.
Update to fix:
isatools.create
serialisation (PR #391)Features:
isatools.create.connectors
module. This module contains the generate_study_design_from_config
function to generate an isatools.create.StudyDesign
from a JSON configuration document containing metadata about the study design, including sampling and assay plan. These JSON documents can be generated by the Datascriptor application.(issues #355, #356, #377)isatools.create.model.StudyArm
(with the parameter source_characteristics
) (PR #367)StudyDesign.generate_isa_study()
now generates one Assay
per assay type (via StudyDesign._generate_samples()
). (issue #369, #373)isatools.create.model.ProductNode
now has an attribute extension
(e.g. a file extension fo a DataFile
node) (issue #378)Enhancements and Cleanup:
isatools.create.constants
and isatools.create.errors
(issue #342, #368)*
) from all the core modules (issue #368)print()
statements (issue #374)Breaking changes:
isatools.create.models
has been renamed to isatools.create.model
(issue #368)IsaModelAttributeError
has been replaced with AttributeError
. We will favour standard Exceptions whenever applicable.Bug Fixes:
Characteristic
categories from str
to OntologyAnnotation
now supported. You can assign a string to a characteristic category and it will be automatically wrapped into an ontology annotation. (issue #332)OntologyAnnotation
ids (issue #381)Features:
isatools.create.connectors
module. This module contains the generate_study_design_from_config
function to generate an isatools.create.StudyDesign
from a JSON configuration document containing metadata about the study design, including sampling and assay plan. These JSON documents can be generated by the Datascriptor application.(issues #355, #356, #377)isatools.create.model.StudyArm
(with the parameter source_characteristics
) (PR #367)StudyDesign.generate_isa_study()
now generates one Assay
per assay type (via StudyDesign._generate_samples()
). (issue #369, #373)isatools.create.model.ProductNode
now has an attribute extension
(e.g. a file extension fo a DataFile
node) (issue #378)Enhancements and Cleanup:
isatools.create.constants
and isatools.create.errors
(issue #342, #368)*
) from all the core modules (issue #368)print()
statements (issue #374)Breaking changes:
isatools.create.models
has been renamed to isatools.create.model
(issue #368)IsaModelAttributeError
has been replaced with AttributeError
. We will favour standard Exceptions whenever applicable.Bug Fixes:
Characteristic
categories from str
to OntologyAnnotation
now supported. You can assign a string to a characteristic category and it will be automatically wrapped into an ontology annotation. (issue #332)OntologyAnnotation
ids (issue #381)Features:
isatools.create.connectors
module. This module contains the generate_study_design_from_config
function to generate an isatools.create.StudyDesign
from a JSON configuration document containing metadata about the study design, including sampling and assay plan. These JSON documents can be generated by the Datascriptor application.(issues #355, #356, #377)isatools.create.model.StudyArm
(with the parameter source_characteristics
) (PR #367)StudyDesign.generate_isa_study()
now generates one Assay
per assay type (via StudyDesign._generate_samples()
). (issue #369, #373)isatools.create.model.ProductNode
now has an attribute extension
(e.g. a file extension fo a DataFile
node) (issue #378)Enhancements and Cleanup:
isatools.create.constants
and isatools.create.errors
(issue #342, #368)*
) from all the core modules (issue #368)print()
statements (issue #374)Breaking changes:
isatools.create.models
has been renamed to isatools.create.model
(issue #368)IsaModelAttributeError
has been replaced with AttributeError
. We will favour standard Exceptions whenever applicable.Bug Fixes:
Characteristic
categories from str
to OntologyAnnotation
now supported. You can assign a string to a characteristic category and it will be automatically wrapped into an ontology annotation. (issue #332)OntologyAnnotation
ids (issue #381)Features:
isatools.create.connectors
module. This module contains the generate_study_design_from_config
function to generate an isatools.create.StudyDesign
from a JSON configuration document containing metadata about the study design, including sampling and assay plan. These JSON documents can be generated by the Datascriptor application.(issues #355, #356, #377)isatools.create.model.StudyArm
(with the parameter source_characteristics
) (PR #367)StudyDesign.generate_isa_study()
now generates one Assay
per assay type (via StudyDesign._generate_samples()
). (issue #369, #373)isatools.create.model.ProductNode
now has an attribute extension
(e.g. a file extension fo a DataFile
node) (issue #378)Enhancements and Cleanup:
isatools.create.constants
and isatools.create.errors
(issue #342, #368)*
) from all the core modules (issue #368)print()
statements (issue #374)Breaking changes:
isatools.create.models
has been renamed to isatools.create.model
(issue #368)IsaModelAttributeError
has been replaced with AttributeError
. We will favour standard Exceptions whenever applicable.Bug Fixes:
Characteristic
categories from str
to OntologyAnnotation
now supported. You can assign a string to a characteristic category and it will be automatically wrapped into an ontology annotation. (issue #332)OntologyAnnotation
ids (issue #381)This release of isatools
introduces a major overhaul of the pre-existing create
mode for the generation of ISA documents from study design metadata. We have also introduced some (mostly) minor fixes to the core ISA API, enforcing a stricter validation on some objects.
Among the most noteworthy changes there are:
Element
, Treatment
, StudyCell
and StudyArm
classes #318, #321AssayGraph
and the overhaul of the SampleAssayPlan
class, now renamed SampleAndAssayPlan
#329, #333, #296QualityControlService
utility classFor more information on the known issues with this release, please check the documentation at http://isatools.readthedocs.org