Skip to content
David Johnson edited this page Feb 25, 2016 · 15 revisions

Recreate the BII-S-3 study example using ISA model class objects

First, create the investigation object and populate with content that would correspond with the INVESTIGATION section of an ISA tab file.

from isatools.model.v1 import *

# Create the root investigation object with an identifier
i = Investigation(identifier="BII-S-3")  

# Create some ontology source references
term_source_chebi = OntologySourceReference(
    name='CHEBI',
    file='http://data.bioontology.org/ontologies/CHEBI',
    version='78',
    description="Chemical Entities of Biological Interest Ontology")
term_source_efo = OntologySourceReference(
    name='EFO',
    file='http://data.bioontology.org/ontologies/EFO',
    version='111',
    description="Experimental Factor Ontology")
term_source_obi = OntologySourceReference(
    name='OBI',
    file='http://data.bioontology.org/ontologies/OBI',
    version='21',
    description="Ontology for Biomedical Investigations")
term_source_ncbitaxon = OntologySourceReference(
    name='NCBITAXON',
    file='http://data.bioontology.org/ontologies/NCBITAXON',
    version='2',
    description="National Center for Biotechnology Information (NCBI) Organismal Classification")
term_source_pato = OntologySourceReference(
    name='PATO',
    file='http://data.bioontology.org/ontologies/PATO',
    version='160',
    description="Phenotypic Quality Ontology")
# Attach ontology sources to the investigation ontology_source_references list
i.ontology_source_references.append(term_source_chebi)
i.ontology_source_references.append(term_source_efo)
i.ontology_source_references.append(term_source_obi)
i.ontology_source_references.append(term_source_ncbitaxon)
i.ontology_source_references.append(term_source_pato)

# Create two comments. The first contains an empty string, the second as some value set
comment_created_with_config = Comment(name='Created With Configuration')
comment_last_opened_with_config = Comment(name='Last Opened With Configuration')
comment_last_opened_with_config.value = "GSC MIxS human gut"
# Attach comments to the investigation comments list
i.comments.append(comment_created_with_config)
i.comments.append(comment_last_opened_with_config)

Next, let's create the study content.