Validators

Classes to validate the integrity of the investigation model as well as study and assay graphs with respect to ISA-Tab format specifications.

AltamISA uses the Python warnings module for reporting validation warnings.

# Parse investigation and validate, capture warnings in `ws`.
with open("investigation.tsv", "rt") as inputf:
    with warnings.catch_warnings(record=True) as warnings:
        isa_inv = InvestigationReader.from_stream(input_file=inputf).read()
        InvestigationValidator(isa_inv).validate()

# Iterate over all captured warnings and handle them.
for warning in warnings:
    somehow_handle(warning)

Note

You can use the IsaWarning class hierarchy for getting severity information.

altamisa.isatab.InvestigationValidator

class altamisa.isatab.InvestigationValidator(investigation: altamisa.isatab.models.InvestigationInfo)[source]

Validator for Investigation

Parameters:investigation (models.InvestigationInfo) – The investigation model to validate
validate()[source]

Validate the investigation

altamisa.isatab.AssayValidator

class altamisa.isatab.AssayValidator(investigation: altamisa.isatab.models.InvestigationInfo, study_info: altamisa.isatab.models.StudyInfo, assay_info: altamisa.isatab.models.AssayInfo, assay: altamisa.isatab.models.Assay, parent_study: altamisa.isatab.models.Study = None)[source]

Validator for Assay

Parameters:
  • investigation (models.InvestigationInfo) – The corresponding investigation model
  • study_info (models.StudyInfo) – The corresponding study information
  • assay_info (models.AssayInfo) – The corresponding assay information
  • assay (models.Assay) – The Assay model to validate
  • parent_study (models.Study) – Optional: The parent Study of the current Assay (for extended validation)
validate()[source]

Validate the assay

altamisa.isatab.StudyValidator

class altamisa.isatab.StudyValidator(investigation: altamisa.isatab.models.InvestigationInfo, study_info: altamisa.isatab.models.StudyInfo, study: altamisa.isatab.models.Study)[source]

Validator for Study

Parameters:
  • investigation (models.InvestigationInfo) – The corresponding investigation model
  • study_info (models.StudyInfo) – The corresponding study information
  • study (models.Study) – The Study model to validate