diff --git a/altamisa/isatab/__init__.py b/altamisa/isatab/__init__.py index 419c951..4130587 100644 --- a/altamisa/isatab/__init__.py +++ b/altamisa/isatab/__init__.py @@ -16,3 +16,4 @@ from .validate_investigation import InvestigationValidator # noqa: F401 from .write_assay_study import AssayWriter, StudyWriter, RefTableBuilder # noqa: F401 from .write_investigation import InvestigationWriter # noqa: F401 +from .modify_investigation import InvestigationForge # noqa: F401 diff --git a/altamisa/isatab/modify_investigation.py b/altamisa/isatab/modify_investigation.py index aac33dc..7a3444c 100644 --- a/altamisa/isatab/modify_investigation.py +++ b/altamisa/isatab/modify_investigation.py @@ -5,7 +5,7 @@ from altamisa.isatab import InvestigationReader -class InvestigationForge(InvestigationReader): +class InvestigationForge(): """ Provides methods to add assays to an existing investigation. @@ -15,6 +15,7 @@ class InvestigationForge(InvestigationReader): def __init__(self, input_path: str): i_file = Path(input_path).expanduser().resolve() + with i_file.open("rt") as f: self.investigation = InvestigationReader.from_stream(f).read() @@ -73,5 +74,4 @@ def add_assay(self, input_path: str): assays += investigation2.studies[0].assays new_study = attr.evolve(self.investigation.studies[0], protocols=protocols, assays=assays) - modified_inv = attr.evolve(self.investigation, studies=(new_study,)) - return modified_inv + self.investigation = attr.evolve(self.investigation, studies=(new_study,))