-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
150 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
ONTOLOGY SOURCE REFERENCE | ||
Term Source Name | ||
Term Source File | ||
Term Source Version | ||
Term Source Description | ||
INVESTIGATION | ||
Investigation Identifier "investigation" | ||
Investigation Title | ||
Investigation Description | ||
Investigation Submission Date | ||
Investigation Public Release Date | ||
Comment[Created With Configuration] | ||
Comment[Last Opened With Configuration] | ||
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 "study" | ||
Study Title | ||
Study Description | ||
Comment[Study Grant Number] | ||
Comment[Study Funding Agency] | ||
Study Submission Date | ||
Study Public Release Date | ||
Study File Name | ||
STUDY DESIGN DESCRIPTORS | ||
Study Design Type | ||
Study Design Type Term Accession Number | ||
Study Design Type Term Source REF | ||
STUDY PUBLICATIONS | ||
Study PubMed ID | ||
Study Publication DOI | ||
Study Publication Author List | ||
Study Publication Title | ||
Study Publication Status | ||
Study Publication Status Term Accession Number | ||
Study Publication Status Term Source REF | ||
STUDY FACTORS | ||
Study Factor Name | ||
Study Factor Type | ||
Study Factor Type Term Accession Number | ||
Study Factor Type Term Source REF | ||
STUDY ASSAYS | ||
Study Assay File Name | ||
Study Assay Measurement Type | ||
Study Assay Measurement Type Term Accession Number | ||
Study Assay Measurement Type Term Source REF | ||
Study Assay Technology Type | ||
Study Assay Technology Type Term Accession Number | ||
Study Assay Technology Type Term Source REF | ||
Study Assay Technology Platform | ||
STUDY PROTOCOLS | ||
Study Protocol Name | ||
Study Protocol Type | ||
Study Protocol Type Term Accession Number | ||
Study Protocol Type Term Source REF | ||
Study Protocol Description | ||
Study Protocol URI | ||
Study Protocol Version | ||
Study Protocol Parameters Name | ||
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 | ||
STUDY CONTACTS | ||
Study Person Last Name | ||
Study Person First Name | ||
Study Person Mid Initials | ||
Study Person Email | ||
Study Person Phone | ||
Study Person Fax | ||
Study Person Address | ||
Study Person Affiliation | ||
Study Person Roles | ||
Study Person Roles Term Accession Number | ||
Study Person Roles Term Source REF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/usr/bin/env python | ||
|
||
from isatools.isatab import load, dumps | ||
from isatools.model.v1 import * | ||
|
||
|
||
def modify_investigation(): | ||
"""Load, edit, and dump an ISA-Tab 1.0 descriptor.""" | ||
|
||
# Load an existing ISA-Tab investigation file. In this example, we load an unpopulated i_investigation.txt file | ||
|
||
with open('i_investigation.txt') as fp: | ||
investigation = load(fp, skip_load_tables=True) | ||
|
||
investigation.identifier = "i1" | ||
investigation.title = "My Simple ISA Investigation" | ||
investigation.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." | ||
investigation.submission_date = "2016-11-03" | ||
investigation.public_release_date = "2016-11-03" | ||
|
||
obi = OntologySource(name='OBI', description="Ontology for Biomedical Investigations") | ||
investigation.ontology_source_references.append(obi) | ||
|
||
study = Study(filename="s_study.txt") | ||
study.identifier = "s1" | ||
study.title = "My ISA Study" | ||
study.description = "Like with the Investigation, we could use the class constructor to set some default values, " \ | ||
"but have chosen to demonstrate in this example the use of instance variables to set initial " \ | ||
"values." | ||
study.submission_date = "2016-11-03" | ||
study.public_release_date = "2016-11-03" | ||
|
||
intervention_design = OntologyAnnotation(term_source=obi) | ||
intervention_design.term = "intervention design" | ||
intervention_design.term_accession = "http://purl.obolibrary.org/obo/OBI_0000115" | ||
study.design_descriptors.append(intervention_design) | ||
|
||
contact = Person(first_name="Alice", last_name="Robertson", affiliation="University of Life", roles=[OntologyAnnotation(term='submitter')]) | ||
study.contacts.append(contact) | ||
publication = Publication(title="Experiments with Elephants", author_list="A. Robertson, B. Robertson") | ||
publication.pubmed_id = "12345678" | ||
publication.status = OntologyAnnotation(term="published") | ||
study.publications.append(publication) | ||
|
||
investigation.studies[0] = study # replace the existing content with the new study we just created above | ||
|
||
return dumps(investigation, skip_dump_tables=True) # dumps() writes out the ISA as a string representation of the ISA-Tab | ||
|
||
if __name__ == '__main__': | ||
print(modify_investigation()) # print the result to stdout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters