This example creates minimal metadata for a single study ISA descriptor with no assay declared.
It shows how to serialize (write) the ISA Model content to ISA-Tab and ISA-JSON formats.
# If executing the notebooks on `Google Colab`,uncomment the following command
# and run it to install the required python libraries. Also, make the test datasets available.
# !pip install -r requirements.txt
from isatools.model import (
Comment,
Investigation,
Study,
StudyFactor,
FactorValue,
OntologyAnnotation,
Material,
Sample,
Source,
Protocol,
ProtocolParameter,
ProtocolComponent,
ParameterValue,
Process,
Publication,
Person,
Assay,
DataFile,
plink
)
import datetime
investigation = Investigation()
i_comment = Comment(name="i_comment", value="i_value")
investigation.comments.append(i_comment)
study = Study(filename="s_study.txt")
st_comment = Comment(name="st_comment", value="st_value")
study.comments.append(st_comment)
study.identifier = "S1"
study.title = "My Simple ISA Study"
study.description = "We could alternatively use the class constructor's parameters to set some default " \
"values at the time of creation, however we want to demonstrate how to use the " \
"object's instance variables to set values."
study.submission_date = str(datetime.datetime.today())
study.public_release_date = str(datetime.datetime.today())
study.sources = [Source(name="source1"), Source(name="source2")]
src_comment = Comment(name="src_comment", value="src_value")
study.sources[0].comments.append(src_comment)
smp_comment = Comment(name="smp_comment", value="smp_value")
study.samples = [Sample(name="sample1")]
study.samples[0].comments.append(smp_comment)
study.samples[0].derives_from.append(study.sources[0])
study.samples[0].derives_from.append(study.sources[1])
study.protocols = [
Protocol(name="sample collection",
components=[
ProtocolComponent(name="magnetic agitator",
component_type=OntologyAnnotation(term="device"))]),
Protocol(
name="data analysis with Galaxy",
uri="https://doi.org/10.5464/workflow.cwl",
protocol_type=OntologyAnnotation(term="data transformation"),
parameters=[
ProtocolParameter(parameter_name=OntologyAnnotation(term="genome assembly")),
ProtocolParameter(parameter_name=OntologyAnnotation(term="cut-off value"))
],
),
Protocol(
name="data visualization with Intermine",
uri="https://intermine.org/10.5464/network.svg",
protocol_type=OntologyAnnotation(term="data visualization"),
comments=[Comment(name="pro_comment", value="pro_value")]
)
]
study.factors = [
StudyFactor(name="Factor",factor_type=OntologyAnnotation(term="factor category"))
]
study.publications = [
Publication(doi="10.12314",pubmed_id="1222322", title="publication title")
]
study.contacts = [
Person(first_name="bob", last_name="hughes", affiliation="WHO", email="bob.hughes@who.else",
comments=[Comment(name="per_comment", value="per_value")]
)
]
study.process_sequence = [
Process(
executes_protocol=study.protocols[-1],
inputs=[study.sources[-1]],
outputs=[study.samples[-1]]
)
]
investigation.studies = [study]
# Next, we build n Assay object and attach two protocols, extraction and sequencing.
assay = Assay(filename="a_assay.txt")
extraction_protocol = Protocol(name='extraction', protocol_type=OntologyAnnotation(term="material extraction"))
study.protocols.append(extraction_protocol)
labeling_protocol = Protocol(name='labeling', protocol_type=OntologyAnnotation(term="labeling"))
study.protocols.append(extraction_protocol)
sequencing_protocol = Protocol(name='sequencing', protocol_type=OntologyAnnotation(term="material sequencing"))
study.protocols.append(sequencing_protocol)
# To build out assay graphs, we enumereate the samples from the study-level, and for each sample we create an
# extraction process and a sequencing process. The extraction process takes as input a sample material, and produces
# an extract material. The sequencing process takes the extract material and produces a data file. This will
# produce three graphs, from sample material through to data, as follows:
#
# (sample_material-0)->(extraction)->(extract-0)->(sequencing)->(sequenced-data-0)
# (sample_material-1)->(extraction)->(extract-1)->(sequencing)->(sequenced-data-1)
# (sample_material-2)->(extraction)->(extract-2)->(sequencing)->(sequenced-data-2)
#
# Note that the extraction processes and sequencing processes are distinctly separate instances, where the three
# graphs are NOT interconnected.
for i, sample in enumerate(study.samples):
# create an extraction process that executes the extraction protocol
extraction_process = Process(executes_protocol=extraction_protocol)
# extraction process takes as input a sample, and produces an extract material as output
extraction_process.inputs.append(sample)
material = Material(name="extract-{}".format(i))
mat_comment = Comment(name="mat_comment", value="mat_value")
material.comments.append(mat_comment)
material.type = "Extract Name"
extraction_process.outputs.append(material)
#labeling process
labeling_process = Process(executes_protocol=labeling_protocol)
le = Material(name="labeleddextract-{}".format(i))
le.type = "Labeled Extract Name"
labeling_process.inputs.append(extraction_process.outputs[0])
labeling_process.outputs.append(le)
# create a sequencing process that executes the sequencing protocol
sequencing_process = Process(executes_protocol=sequencing_protocol)
sequencing_process.name = "assay-name-{}".format(i)
sequencing_process.inputs.append(labeling_process.outputs[0])
# Sequencing process usually has an output data file
datafile = DataFile(filename="sequenced-data-{}".format(i), label="Raw Data File")
data_comment = Comment(name="data_comment",value="data_value")
datafile.comments.append(data_comment)
sequencing_process.outputs.append(datafile)
# Ensure Processes are linked forward and backward. plink(from_process, to_process) is a function to set
# these links for you. It is found in the isatools.model package
plink(extraction_process, labeling_process)
plink(labeling_process, sequencing_process)
# make sure the extract, data file, and the processes are attached to the assay
assay.data_files.append(datafile)
assay.samples.append(sample)
assay.other_material.append(material)
assay.other_material.append(le)
assay.process_sequence.append(extraction_process)
assay.process_sequence.append(labeling_process)
assay.process_sequence.append(sequencing_process)
assay.measurement_type = OntologyAnnotation(term="genome sequencing")
assay.technology_type = OntologyAnnotation(term="nucleotide sequencing")
study.assays.append(assay)
# Let's see the object :
investigation
isatools.model.Investigation(identifier='', filename='', title='', submission_date='', public_release_date='', ontology_source_references=[], publications=[], contacts=[], studies=[isatools.model.Study(filename='s_study.txt', identifier='S1', title='My Simple ISA Study', description='We could alternatively use the class constructor's parameters to set some default values at the time of creation, however we want to demonstrate how to use the object's instance variables to set values.', submission_date='2021-12-01 22:29:22.101893', public_release_date='2021-12-01 22:29:22.101933', contacts=[isatools.model.Person(last_name='hughes', first_name='bob', mid_initials='', email='bob.hughes@who.else', phone='', fax='', address='', affiliation='WHO', roles=[], comments=[isatools.model.Comment(name='per_comment', value='per_value')])], design_descriptors=[], publications=[isatools.model.Publication(pubmed_id='1222322', doi='10.12314', author_list='', title='publication title', status=None, comments=[])], factors=[isatools.model.StudyFactor(name='Factor', factor_type=isatools.model.OntologyAnnotation(term='factor category', term_source=None, term_accession='', comments=[]), comments=[])], protocols=[isatools.model.Protocol(name='sample collection', protocol_type=isatools.model.OntologyAnnotation(term='', term_source=None, term_accession='', comments=[]), uri='', version='', parameters=[], components=[], comments=[]), isatools.model.Protocol(name='data analysis with Galaxy', protocol_type=isatools.model.OntologyAnnotation(term='data transformation', term_source=None, term_accession='', comments=[]), uri='https://doi.org/10.5464/workflow.cwl', version='', parameters=[isatools.model.ProtocolParameter(parameter_name=isatools.model.OntologyAnnotation(term='genome assembly', term_source=None, term_accession='', comments=[]), comments=[]), isatools.model.ProtocolParameter(parameter_name=isatools.model.OntologyAnnotation(term='cut-off value', term_source=None, term_accession='', comments=[]), comments=[])], components=[], comments=[]), isatools.model.Protocol(name='data visualization with Intermine', protocol_type=isatools.model.OntologyAnnotation(term='data visualization', term_source=None, term_accession='', comments=[]), uri='https://intermine.org/10.5464/network.svg', version='', parameters=[], components=[], comments=[isatools.model.Comment(name='pro_comment', value='pro_value')]), isatools.model.Protocol(name='extraction', protocol_type=isatools.model.OntologyAnnotation(term='material extraction', term_source=None, term_accession='', comments=[]), uri='', version='', parameters=[], components=[], comments=[]), isatools.model.Protocol(name='extraction', protocol_type=isatools.model.OntologyAnnotation(term='material extraction', term_source=None, term_accession='', comments=[]), uri='', version='', parameters=[], components=[], comments=[]), isatools.model.Protocol(name='sequencing', protocol_type=isatools.model.OntologyAnnotation(term='material sequencing', term_source=None, term_accession='', comments=[]), uri='', version='', parameters=[], components=[], comments=[])], assays=[isatools.model.Assay(measurement_type=isatools.model.OntologyAnnotation(term='genome sequencing', term_source=None, term_accession='', comments=[]), technology_type=isatools.model.OntologyAnnotation(term='nucleotide sequencing', term_source=None, term_accession='', comments=[]), technology_platform='', filename='a_assay.txt', data_files=[isatools.model.DataFile(filename='sequenced-data-0', label='Raw Data File', generated_from=[], comments=[isatools.model.Comment(name='data_comment', value='data_value')])], samples=[isatools.model.Sample(name='sample1', characteristics=[], factor_values=[], derives_from=[isatools.model.Source(name='source1', characteristics=[], comments=[isatools.model.Comment(name='src_comment', value='src_value')]), isatools.model.Source(name='source2', characteristics=[], comments=[])], comments=[isatools.model.Comment(name='smp_comment', value='smp_value')])], process_sequence=[isatools.model.Process(id="". name="None", executes_protocol=Protocol( name=extraction protocol_type=material extraction uri= version= parameters=0 ProtocolParameter objects components=0 OntologyAnnotation objects comments=0 Comment objects ), date="None", performer="None", inputs=[isatools.model.Sample(name='sample1', characteristics=[], factor_values=[], derives_from=[isatools.model.Source(name='source1', characteristics=[], comments=[isatools.model.Comment(name='src_comment', value='src_value')]), isatools.model.Source(name='source2', characteristics=[], comments=[])], comments=[isatools.model.Comment(name='smp_comment', value='smp_value')])], outputs=[<isatools.model.Material object at 0x103b2f7f0>]), isatools.model.Process(id="". name="None", executes_protocol=Protocol( name=labeling protocol_type=labeling uri= version= parameters=0 ProtocolParameter objects components=0 OntologyAnnotation objects comments=0 Comment objects ), date="None", performer="None", inputs=[<isatools.model.Material object at 0x103b2f7f0>], outputs=[<isatools.model.Material object at 0x103b2f6a0>]), isatools.model.Process(id="". name="assay-name-0", executes_protocol=Protocol( name=sequencing protocol_type=material sequencing uri= version= parameters=0 ProtocolParameter objects components=0 OntologyAnnotation objects comments=0 Comment objects ), date="None", performer="None", inputs=[<isatools.model.Material object at 0x103b2f6a0>], outputs=[isatools.model.DataFile(filename='sequenced-data-0', label='Raw Data File', generated_from=[], comments=[isatools.model.Comment(name='data_comment', value='data_value')])])], other_material=[<isatools.model.Material object at 0x103b2f7f0>, <isatools.model.Material object at 0x103b2f6a0>], characteristic_categories=[], comments=[], units=[])], sources=[isatools.model.Source(name='source1', characteristics=[], comments=[isatools.model.Comment(name='src_comment', value='src_value')]), isatools.model.Source(name='source2', characteristics=[], comments=[])], samples=[isatools.model.Sample(name='sample1', characteristics=[], factor_values=[], derives_from=[isatools.model.Source(name='source1', characteristics=[], comments=[isatools.model.Comment(name='src_comment', value='src_value')]), isatools.model.Source(name='source2', characteristics=[], comments=[])], comments=[isatools.model.Comment(name='smp_comment', value='smp_value')])], process_sequence=[isatools.model.Process(id="". name="None", executes_protocol=Protocol( name=data visualization with Intermine protocol_type=data visualization uri=https://intermine.org/10.5464/network.svg version= parameters=0 ProtocolParameter objects components=0 OntologyAnnotation objects comments=1 Comment objects ), date="None", performer="None", inputs=[isatools.model.Source(name='source2', characteristics=[], comments=[])], outputs=[isatools.model.Sample(name='sample1', characteristics=[], factor_values=[], derives_from=[isatools.model.Source(name='source1', characteristics=[], comments=[isatools.model.Comment(name='src_comment', value='src_value')]), isatools.model.Source(name='source2', characteristics=[], comments=[])], comments=[isatools.model.Comment(name='smp_comment', value='smp_value')])])], other_material=[], characteristic_categories=[], comments=[isatools.model.Comment(name='st_comment', value='st_value')], units=[])], comments=[isatools.model.Comment(name='i_comment', value='i_value')])
from isatools.isatab import dumps
print(dumps(investigation))
2021-12-01 22:29:22,205 [INFO]: isatab.py(_all_end_to_end_paths:1131) >> [1] 2021-12-01 22:29:22,206 [WARNING]: isatab.py(write_study_table_files:1194) >> [3, 2, 1] 2021-12-01 22:29:22,207 [INFO]: isatab.py(_longest_path_and_attrs:1091) >> [[1, 3, 2]] 2021-12-01 22:29:22,229 [INFO]: isatab.py(_all_end_to_end_paths:1131) >> [2] 2021-12-01 22:29:22,230 [INFO]: isatab.py(_longest_path_and_attrs:1091) >> [[2, 4, 5, 6, 7, 8]] 2021-12-01 22:29:22,230 [INFO]: isatab.py(_longest_path_and_attrs:1091) >> [[2, 4, 5, 6, 7, 8]]
/var/folders/5n/rl6lqnks4rqb59pbtpvvntqw0000gr/T/tmpkd97rbgg/i_investigation.txt ONTOLOGY SOURCE REFERENCE Term Source Name Term Source File Term Source Version Term Source Description INVESTIGATION Investigation Identifier Investigation Title Investigation Description Investigation Submission Date Investigation Public Release Date Comment[i_comment] i_value INVESTIGATION PUBLICATIONS Investigation PubMed ID Investigation Publication DOI Investigation Publication Author List Investigation Publication Title Investigation Publication Status Investigation Publication Status Term Accession Number Investigation Publication Status Term Source REF INVESTIGATION CONTACTS Investigation Person Last Name Investigation Person First Name Investigation Person Mid Initials Investigation Person Email Investigation Person Phone Investigation Person Fax Investigation Person Address Investigation Person Affiliation Investigation Person Roles Investigation Person Roles Term Accession Number Investigation Person Roles Term Source REF STUDY Study Identifier S1 Study Title My Simple ISA Study Study Description We could alternatively use the class constructor's parameters to set some default values at the time of creation, however we want to demonstrate how to use the object's instance variables to set values. Study Submission Date 2021-12-01 22:29:22.101893 Study Public Release Date 2021-12-01 22:29:22.101933 Study File Name s_study.txt Comment[st_comment] st_value STUDY DESIGN DESCRIPTORS Study Design Type Study Design Type Term Accession Number Study Design Type Term Source REF STUDY PUBLICATIONS Study PubMed ID 1222322 Study Publication DOI 10.12314 Study Publication Author List Study Publication Title publication title Study Publication Status Study Publication Status Term Accession Number Study Publication Status Term Source REF STUDY FACTORS Study Factor Name Factor Study Factor Type factor category Study Factor Type Term Accession Number Study Factor Type Term Source REF STUDY ASSAYS Study Assay File Name a_assay.txt Study Assay Measurement Type genome sequencing Study Assay Measurement Type Term Accession Number Study Assay Measurement Type Term Source REF Study Assay Technology Type nucleotide sequencing Study Assay Technology Type Term Accession Number Study Assay Technology Type Term Source REF Study Assay Technology Platform STUDY PROTOCOLS Study Protocol Name sample collection data analysis with Galaxy data visualization with Intermine extraction extraction sequencing Study Protocol Type data transformation data visualization material extraction material extraction material sequencing Study Protocol Type Term Accession Number Study Protocol Type Term Source REF Study Protocol Description Study Protocol URI https://doi.org/10.5464/workflow.cwl https://intermine.org/10.5464/network.svg Study Protocol Version Study Protocol Parameters Name genome assembly;cut-off value Study Protocol Parameters Name Term Accession Number ; Study Protocol Parameters Name Term Source REF ; Study Protocol Components Name Study Protocol Components Type Study Protocol Components Type Term Accession Number Study Protocol Components Type Term Source REF Comment[pro_comment] pro_value STUDY CONTACTS Study Person Last Name hughes Study Person First Name bob Study Person Mid Initials Study Person Email bob.hughes@who.else Study Person Phone Study Person Fax Study Person Address Study Person Affiliation WHO Study Person Roles Study Person Roles Term Accession Number Study Person Roles Term Source REF Comment[per_comment] per_value -------- /var/folders/5n/rl6lqnks4rqb59pbtpvvntqw0000gr/T/tmpkd97rbgg/s_study.txt Source Name Protocol REF Sample Name Comment[smp_comment] source2 data visualization with Intermine sample1 smp_value -------- /var/folders/5n/rl6lqnks4rqb59pbtpvvntqw0000gr/T/tmpkd97rbgg/a_assay.txt Sample Name Comment[smp_comment] Protocol REF Extract Name Comment[mat_comment] Protocol REF Labeled Extract Name Protocol REF Raw Data File Comment[data_comment] sample1 smp_value extraction extract-0 mat_value labeling labeleddextract-0 sequencing sequenced-data-0 data_value
import json
from isatools.isajson import ISAJSONEncoder
print(json.dumps(investigation, cls=ISAJSONEncoder, sort_keys=True, indent=4, separators=(',', ': ')))
{ "@id": "#investigation/4909215360", "comments": [ { "name": "i_comment", "value": "i_value" } ], "description": "", "identifier": "", "ontologySourceReferences": [], "people": [], "publicReleaseDate": "", "publications": [], "studies": [ { "@id": "#study/4909211904", "assays": [ { "@id": "#4909152096", "characteristicCategories": [], "comments": [], "dataFiles": [ { "@id": "#data/rawdata-4357026720", "comments": [ { "name": "data_comment", "value": "data_value" } ], "name": "sequenced-data-0", "type": "Raw Data File" } ], "filename": "a_assay.txt", "materials": { "otherMaterials": [ { "@id": "#material/extract-4357027824", "characteristics": [], "comments": [ { "name": "mat_comment", "value": "mat_value" } ], "name": "extract-0", "type": "Extract Name" }, { "@id": "#material/labeledextract-4357027488", "characteristics": [], "comments": [], "name": "labeleddextract-0", "type": "Labeled Extract Name" } ], "samples": [ { "@id": "#sample/4909191280", "characteristics": [], "comments": [ { "name": "smp_comment", "value": "smp_value" } ], "factorValues": [], "name": "sample1" } ] }, "measurementType": { "@id": "#annotation_value/33b03c28-95c0-4f2c-8755-9986e71e9290", "annotationValue": "genome sequencing", "comments": [], "termAccession": "", "termSource": "" }, "processSequence": [ { "@id": "#process/4357029072", "comments": [], "date": "", "executesProtocol": { "@id": "#protocol/4909154064" }, "inputs": [ { "@id": "#sample/4909191280" } ], "name": "", "nextProcess": { "@id": "#process/4357027536" }, "outputs": [ { "@id": "#material/extract-4357027824" } ], "parameterValues": [], "performer": "" }, { "@id": "#process/4357027536", "comments": [], "date": "", "executesProtocol": { "@id": "#protocol/4909153968" }, "inputs": [ { "@id": "#material/extract-4357027824" } ], "name": "", "nextProcess": { "@id": "#process/4357026672" }, "outputs": [ { "@id": "#material/labeledextract-4357027488" } ], "parameterValues": [], "performer": "", "previousProcess": { "@id": "#process/4357029072" } }, { "@id": "#process/4357026672", "comments": [], "date": "", "executesProtocol": { "@id": "#protocol/4909153920" }, "inputs": [ { "@id": "#material/labeledextract-4357027488" } ], "name": "assay-name-0", "outputs": [ { "@id": "#data/rawdata-4357026720" } ], "parameterValues": [], "performer": "", "previousProcess": { "@id": "#process/4357027536" } } ], "technologyPlatform": "", "technologyType": { "@id": "#annotation_value/5174e4a8-f267-480d-930f-998f81064712", "annotationValue": "nucleotide sequencing", "comments": [], "termAccession": "", "termSource": "" }, "unitCategories": [] } ], "characteristicCategories": [], "comments": [ { "name": "st_comment", "value": "st_value" } ], "description": "We could alternatively use the class constructor's parameters to set some default values at the time of creation, however we want to demonstrate how to use the object's instance variables to set values.", "factors": [ { "@id": "#studyfactor/4909204480", "comments": [], "factorName": "Factor", "factorType": { "@id": "#annotation_value/78be4c7e-965a-4d42-bc4b-fad329c708e6", "annotationValue": "factor category", "comments": [], "termAccession": "", "termSource": "" } } ], "filename": "s_study.txt", "identifier": "S1", "materials": { "otherMaterials": [], "samples": [ { "@id": "#sample/4909191280", "characteristics": [], "comments": [ { "name": "smp_comment", "value": "smp_value" } ], "factorValues": [], "name": "sample1" } ], "sources": [ { "@id": "#source/4909191232", "characteristics": [], "comments": [ { "name": "src_comment", "value": "src_value" } ], "name": "source1" }, { "@id": "#source/4909191520", "characteristics": [], "comments": [], "name": "source2" } ] }, "people": [ { "@id": "#person/4909204384", "address": "", "affiliation": "WHO", "comments": [ { "name": "per_comment", "value": "per_value" } ], "email": "bob.hughes@who.else", "fax": "", "firstName": "bob", "lastName": "hughes", "midInitials": "", "phone": "", "roles": [] } ], "processSequence": [ { "@id": "#process/4909204576", "comments": [], "date": "", "executesProtocol": { "@id": "#protocol/4909204864" }, "inputs": [ { "@id": "#source/4909191520" } ], "name": "", "outputs": [ { "@id": "#sample/4909191280" } ], "parameterValues": [], "performer": "" } ], "protocols": [ { "@id": "#protocol/4909205488", "comments": [], "components": [], "description": "", "name": "sample collection", "parameters": [], "protocolType": { "@id": "#annotation_value/e71e71d2-00df-4713-94f7-22913308b18b", "annotationValue": "", "comments": [], "termAccession": "", "termSource": "" }, "uri": "", "version": "" }, { "@id": "#protocol/4909205104", "comments": [], "components": [], "description": "", "name": "data analysis with Galaxy", "parameters": [ { "@id": "#parameter/4909205296", "parameterName": { "@id": "#annotation_value/264cedf2-119a-406d-8da2-9a9e77ee9a96", "annotationValue": "genome assembly", "comments": [], "termAccession": "", "termSource": "" } }, { "@id": "#parameter/4909205008", "parameterName": { "@id": "#annotation_value/ef75225f-9a81-41ec-9143-31dce1542a95", "annotationValue": "cut-off value", "comments": [], "termAccession": "", "termSource": "" } } ], "protocolType": { "@id": "#annotation_value/564e017b-4fac-40e2-ad6d-324ca1a6bf55", "annotationValue": "data transformation", "comments": [], "termAccession": "", "termSource": "" }, "uri": "https://doi.org/10.5464/workflow.cwl", "version": "" }, { "@id": "#protocol/4909204864", "comments": [ { "name": "pro_comment", "value": "pro_value" } ], "components": [], "description": "", "name": "data visualization with Intermine", "parameters": [], "protocolType": { "@id": "#annotation_value/ae77ae54-aa7b-40c9-9c16-a8ba70953a1b", "annotationValue": "data visualization", "comments": [], "termAccession": "", "termSource": "" }, "uri": "https://intermine.org/10.5464/network.svg", "version": "" }, { "@id": "#protocol/4909154064", "comments": [], "components": [], "description": "", "name": "extraction", "parameters": [], "protocolType": { "@id": "#annotation_value/840a6f25-8ddc-4071-a1f5-60d37c88a9bc", "annotationValue": "material extraction", "comments": [], "termAccession": "", "termSource": "" }, "uri": "", "version": "" }, { "@id": "#protocol/4909154064", "comments": [], "components": [], "description": "", "name": "extraction", "parameters": [], "protocolType": { "@id": "#annotation_value/840a6f25-8ddc-4071-a1f5-60d37c88a9bc", "annotationValue": "material extraction", "comments": [], "termAccession": "", "termSource": "" }, "uri": "", "version": "" }, { "@id": "#protocol/4909153920", "comments": [], "components": [], "description": "", "name": "sequencing", "parameters": [], "protocolType": { "@id": "#annotation_value/13330396-e038-4ae6-872b-c7f16ed298e3", "annotationValue": "material sequencing", "comments": [], "termAccession": "", "termSource": "" }, "uri": "", "version": "" } ], "publicReleaseDate": "2021-12-01 22:29:22.101933", "publications": [ { "@id": "#publication/4909204720", "authorList": "", "comments": [], "doi": "10.12314", "pubMedID": "1222322", "status": { "@id": "" }, "title": "publication title" } ], "studyDesignDescriptors": [], "submissionDate": "2021-12-01 22:29:22.101893", "title": "My Simple ISA Study", "unitCategories": [] } ], "submissionDate": "", "title": "" }
import os
from isatools import isatab
# with open(os.path.join('./BII-I-1/', 'i_investigation.txt')) as fp:
#w ith open(os.path.join('./BII-S-3/', 'i_gilbert.txt')) as fp:
# with open(os.path.join('./BII-S-4/', 'i_investigation.txt')) as fp:
# with open(os.path.join('./BII-S-7/', 'i_matteo.txt')) as fp:
with open(os.path.join('./BII-S-8_FP001RO-isatab-TEST/', 'i_fp001ro-investigation.txt')) as fp:
ISA = isatab.load(fp)
--------------------------------------------------------------------------- FileNotFoundError Traceback (most recent call last) /var/folders/5n/rl6lqnks4rqb59pbtpvvntqw0000gr/T/ipykernel_2669/799938493.py in <module> 5 # with open(os.path.join('./BII-S-4/', 'i_investigation.txt')) as fp: 6 # with open(os.path.join('./BII-S-7/', 'i_matteo.txt')) as fp: ----> 7 with open(os.path.join('./BII-S-8_FP001RO-isatab-TEST/', 'i_fp001ro-investigation.txt')) as fp: 8 ISA = isatab.load(fp) FileNotFoundError: [Errno 2] No such file or directory: './BII-S-8_FP001RO-isatab-TEST/i_fp001ro-investigation.txt'
from isatools.isatab import dumps
print(dumps(ISA))