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: InvestigationInfo)[source]
Validator for Investigation
- Parameters:
investigation (models.InvestigationInfo) – The investigation model to validate
altamisa.isatab.AssayValidator
- class altamisa.isatab.AssayValidator(investigation: InvestigationInfo, study_info: StudyInfo, assay_info: AssayInfo, assay: Assay, parent_study: 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)
altamisa.isatab.StudyValidator
- class altamisa.isatab.StudyValidator(investigation: InvestigationInfo, study_info: StudyInfo, study: 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