Models

Class models for storing and representing ISA data, with particular focus on ISA-Tab compatibility. The modeling follows the structure of the specifications with different classes for each file type (investigation, study, assay), investigation sections, the different study and assay column types etc. In particular, study and assay data (i.e. corresponding materials and processes) are represented by use of directed acyclic graphs.

Note that all models are immutable after construction. Here is a common pattern for getting a copy with modifying select members.

>>> import attr
>>> from altamisa.isatab import Comment
>>> c1 = Comment(name="Name", value="the value")
>>> c1
Comment(name='Name', value='value')
>>> c2 = Comment(**{**attr.asdict(c1), "name": "Another Name"})
>>> c2
Comment(name='Another Name', value='value')

altamisa.isatab.AnnotatedStr

class altamisa.isatab.AnnotatedStr(value, *args, **kwargs)[source]

A str that can be flagged with values.

Example Usage

>>> x = AnnotateStr("text", key1="value1", key2=2)
>>> x
"text"
>>> x.key1
"value1"
>>> x.key2
2

altamisa.isatab.OntologyTermRef

class altamisa.isatab.OntologyTermRef(name: str = None, accession: str = None, ontology_name: str = None)[source]

Reference to a term into an ontology.

Can be either initialized with

  • all three of a name, an accession, and an ontology_name

  • only a name

  • nothing (empty)

name: str

Human-readable name of the term

accession: str

The accession of the referenced term

ontology_name: str

Name of the ontology (links to OntologyRef.name)

altamisa.isatab.Comment

class altamisa.isatab.Comment(name: str, value: str)[source]

Representation of a Comment[*] cell.

name: str

Comment name

value: str

Comment value

altamisa.isatab.OntologyRef

class altamisa.isatab.OntologyRef(name: str, file: str, version: str, description: str, comments: Tuple[Comment], headers: List[str])[source]

Description of an ontology term source, as used for investigation file.

name: str

The name of the ontology (e.g., CEBI)

file: str

Path to file or URI to ontology

version: str

Version of the ontology

description: str

Description of the ontology

comments: Tuple[Comment]

Comments

headers: List[str]

Headers from/for ISA-tab parsing/writing

altamisa.isatab.BasicInfo

class altamisa.isatab.BasicInfo(path: Path, identifier: str, title: str, description: str, submission_date: date, public_release_date: date, comments: Tuple[Comment], headers: List[str])[source]

Basic metadata for an investigation or study (INVESTIGATION or STUDY).

path: Path

Path to the investigation or study file

identifier: str

Investigation/Study identifier

title: str

Investigation/Study title

description: str

Investigation/Study description

submission_date: date

Investigation/Study submission date

public_release_date: date

Investigation/Study public release date

comments: Tuple[Comment]

Comments

headers: List[str]

Headers from/for ISA-tab parsing/writing

altamisa.isatab.PublicationInfo

class altamisa.isatab.PublicationInfo(pubmed_id: str, doi: str, authors: str, title: str, status: OntologyTermRef | str, comments: Tuple[Comment], headers: List[str])[source]

Information regarding an investigation publication (INVESTIGATION PUBLICATIONS).

pubmed_id: str

Publication PubMed ID

doi: str

Publication DOI

authors: str

Publication author list string

title: str

Publication title

status: OntologyTermRef | str

Publication status

comments: Tuple[Comment]

Comments

headers: List[str]

Headers from/for ISA-tab parsing/writing

altamisa.isatab.ContactInfo

class altamisa.isatab.ContactInfo(last_name: str, first_name: str, mid_initial: str, email: str, phone: str, fax: str, address: str, affiliation: str, role: OntologyTermRef | str, comments: Tuple[Comment], headers: List[str])[source]

Investigation contact information

last_name: str

Last name of contact

first_name: str

First name of contact

mid_initial: str

Middle initial of contact

email: str

Email of contact

phone: str

Phone of contact

fax: str

Fax no. of contact

address: str

Address of contact

affiliation: str

Affiliation of contact

role: OntologyTermRef | str

Role of contact

comments: Tuple[Comment]

Comments

headers: List[str]

Headers from/for ISA-tab parsing/writing

altamisa.isatab.DesignDescriptorsInfo

class altamisa.isatab.DesignDescriptorsInfo(type: OntologyTermRef | str, comments: Tuple[Comment], headers: List[str])[source]

Study design descriptors information

type: OntologyTermRef | str

Design descriptors type

comments: Tuple[Comment]

Comments

headers: List[str]

Headers from/for ISA-tab parsing/writing

altamisa.isatab.FactorInfo

class altamisa.isatab.FactorInfo(name: str, type: OntologyTermRef | str, comments: Tuple[Comment], headers: List[str])[source]

Study factor information

name: str

Factor name

type: OntologyTermRef | str

Factor type

comments: Tuple[Comment]

Comments

headers: List[str]

Headers from/for ISA-tab parsing/writing

altamisa.isatab.AssayInfo

class altamisa.isatab.AssayInfo(measurement_type: OntologyTermRef | str, technology_type: OntologyTermRef | str, platform: str, path: Path, comments: Tuple[Comment], headers: List[str])[source]

Study assay information

measurement_type: OntologyTermRef | str

Assay measurement type

technology_type: OntologyTermRef | str

Assay technology type

platform: str

Assay platform

path: Path

Path to assay file

comments: Tuple[Comment]

Comments

headers: List[str]

Headers from/for ISA-tab parsing/writing

altamisa.isatab.ProtocolComponentInfo

class altamisa.isatab.ProtocolComponentInfo(name: str, type: OntologyTermRef | str)[source]

Protocol component information

name: str

Protocol component name

type: OntologyTermRef | str

Protocol component type

altamisa.isatab.ProtocolInfo

class altamisa.isatab.ProtocolInfo(name: str, type: OntologyTermRef | str, description: str, uri: str, version: str, parameters: Dict[str, OntologyTermRef | str], components: Dict[str, ProtocolComponentInfo], comments: Tuple[Comment], headers: List[str])[source]

Protocol information

name: str

Protocol name

type: OntologyTermRef | str

Protocol type

description: str

Protocol

uri: str

Protocol URI

version: str

Protocol version

parameters: Dict[str, OntologyTermRef | str]

Protocol parameters

components: Dict[str, ProtocolComponentInfo]

Protocol components

comments: Tuple[Comment]

Comments

headers: List[str]

Headers from/for ISA-tab parsing/writing

altamisa.isatab.StudyInfo

class altamisa.isatab.StudyInfo(info: BasicInfo, designs: Tuple[DesignDescriptorsInfo], publications: Tuple[PublicationInfo], factors: Dict[str, FactorInfo], assays: Tuple[AssayInfo], protocols: Dict[str, ProtocolInfo], contacts: Tuple[ContactInfo])[source]

The full metadata regarding one study

info: BasicInfo

Basic study information

designs: Tuple[DesignDescriptorsInfo]

Study designs by name

publications: Tuple[PublicationInfo]

Publication list for study

factors: Dict[str, FactorInfo]

Study factors by name

assays: Tuple[AssayInfo]

Study assays

protocols: Dict[str, ProtocolInfo]

Study protocols by name

contacts: Tuple[ContactInfo]

Study contact list

altamisa.isatab.InvestigationInfo

class altamisa.isatab.InvestigationInfo(ontology_source_refs: Dict[str, OntologyRef], info: BasicInfo, publications: Tuple[PublicationInfo], contacts: Tuple[ContactInfo], studies: Tuple[StudyInfo])[source]

Representation of an ISA investigation

ontology_source_refs: Dict[str, OntologyRef]

Ontologies defined for investigation

info: BasicInfo

Basic information on investigation

publications: Tuple[PublicationInfo]

List of investigation publications

contacts: Tuple[ContactInfo]

Contact list for investigation

studies: Tuple[StudyInfo]

List of studies in this investigation

altamisa.isatab.Characteristics

class altamisa.isatab.Characteristics(name: str, value: List[OntologyTermRef | str], unit: OntologyTermRef | str)[source]

Representation of a Characteristics[*] cell.

name: str

Characteristics name

value: List[OntologyTermRef | str]

Characteristics value

unit: OntologyTermRef | str

Characteristics unit

altamisa.isatab.FactorValue

class altamisa.isatab.FactorValue(name: str, value: OntologyTermRef | str, unit: OntologyTermRef | str)[source]

Representation of a Factor Value[*] cell.

name: str

Factor name

value: OntologyTermRef | str

Factor value

unit: OntologyTermRef | str

Factor value unit

altamisa.isatab.ParameterValue

class altamisa.isatab.ParameterValue(name: str, value: List[OntologyTermRef | str], unit: OntologyTermRef | str)[source]

Representation of a Parameter Value[*] cell.

name: str

Parameter name

value: List[OntologyTermRef | str]

Parameter value

unit: OntologyTermRef | str

Parameter value unit

altamisa.isatab.Material

class altamisa.isatab.Material(type: str, unique_name: str, name: str, extract_label: OntologyTermRef | str, characteristics: Tuple[Characteristics], comments: Tuple[Comment], factor_values: Tuple[FactorValue], material_type: OntologyTermRef | str, headers: List[str])[source]

Representation of a Material or Data node.

type: str

The type of node (i.e. column name)

unique_name: str

The unique name of the material node. This is usually created with respect to study/assay and column. The unique name is necessary to distinguish materials of different type with potential overlaps in names. Otherwise graph representation might be incorrect (ambiguous arcs, loops) and the original relation of material and process not conclusively reproducible.

name: str

Original name of a material or data file

extract_label: OntologyTermRef | str

The label of a Labeled Extract

characteristics: Tuple[Characteristics]

Material characteristics

comments: Tuple[Comment]

Material comments

factor_values: Tuple[FactorValue]

Material factor values

material_type: OntologyTermRef | str

Material type

headers: List[str]

Columns headers from/for ISA-tab parsing/writing

altamisa.isatab.Process

class altamisa.isatab.Process(protocol_ref: str, unique_name: str, name: str, name_type: str, date: date, performer: str, parameter_values: Tuple[ParameterValue], comments: Tuple[Comment], array_design_ref: str, first_dimension: OntologyTermRef | str, second_dimension: OntologyTermRef | str, headers: List[str])[source]

Representation of a Process or Assay node.

protocol_ref: str

Referenced to protocol name from investigation

unique_name: str

The unique name of the process node. This is usually created with respect to study/assay and column. The unique name is necessary to distinguish processes of different protocols with potential overlaps in names. Otherwise graph representation might be incorrect (ambiguous arcs, loops) and the original relation of material and process not conclusively reproducible. When “Protocol REF” is given without a further qualifying name, this is generated from the protocol reference with an auto-incrementing number.

name: str

Original name of a process (e.g. from Assay Name etc.)

name_type: str

Type of original name (e.g. Assay Name)

date: date

Process date

performer: str

Performer of process

parameter_values: Tuple[ParameterValue]

Tuple of parameters values

comments: Tuple[Comment]

Tuple of process comments

array_design_ref: str

Array design reference (special case annotation)

Technology types: “DNA microarray”, “protein microarray”

Protocol types: “nucleic acid hybridization”, “hybridization”

first_dimension: OntologyTermRef | str

First dimension (special case annotation, INSTEAD of Gel Electrophoresis Assay Name)

Technology types: “gel electrophoresis”

Protocol types: “electrophoresis”

second_dimension: OntologyTermRef | str

Second dimension (special case annotation, INSTEAD of Gel Electrophoresis Assay Name)

Technology types: “gel electrophoresis”

Protocol types: “electrophoresis”

headers: List[str]

Columns headers from/for ISA-tab parsing/writing

altamisa.isatab.Arc

class altamisa.isatab.Arc(tail: str, head: str)[source]

Representation of an arc between two Material and/or Process nodes.

tail: str

The arc’s tail name

head: str

The arc’s head name

altamisa.isatab.Study

class altamisa.isatab.Study(file: Path, header: Tuple, materials: Dict[str, Material], processes: Dict[str, Process], arcs: Tuple[Arc])[source]

Representation of an ISA study.

file: Path

Path to ISA study file

header: Tuple

The study’s header

materials: Dict[str, Material]

A mapping from material name to Material object (Data is a kind of material)

processes: Dict[str, Process]

A mapping from process name to Process object

arcs: Tuple[Arc]

The processing arcs

altamisa.isatab.Assay

class altamisa.isatab.Assay(file: Path, header: Tuple, materials: Dict[str, Material], processes: Dict[str, Process], arcs: Tuple[Arc])[source]

Representation of an ISA assay.

file: Path

Path to ISA assay file

header: Tuple

The assay’s header

materials: Dict[str, Material]

A mapping from material name to Material object (Data is a kind of material)

processes: Dict[str, Process]

A mapping from process name to Process object

arcs: Tuple[Arc]

The processing arcs