diff --git a/altamisa/apps/isatab2dot.py b/altamisa/apps/isatab2dot.py index 1f8e6b9..1590574 100644 --- a/altamisa/apps/isatab2dot.py +++ b/altamisa/apps/isatab2dot.py @@ -19,7 +19,6 @@ def print_dot( proc_shape="ellipse", proc_color="blue", ): - print(indent + "/* materials */", file=outf) for name, mat in obj.materials.items(): label = json.dumps("{}:\n{}\n({})".format(mat.type, mat.name if mat.name else "-", name)) diff --git a/altamisa/constants/investigation_headers.py b/altamisa/constants/investigation_headers.py index e48ef2b..3aaf583 100644 --- a/altamisa/constants/investigation_headers.py +++ b/altamisa/constants/investigation_headers.py @@ -68,11 +68,11 @@ INVESTIGATION_PUBLICATION_TITLE = "Investigation Publication Title" #: INVESTIGATION_PUBLICATION_STATUS = "Investigation Publication Status" #: INVESTIGATION_PUBLICATION_STATUS_TERM_ACCESSION_NUMBER = ( - "Investigation Publication Status Term Accession Number" -) #: + "Investigation Publication Status Term Accession Number" #: +) INVESTIGATION_PUBLICATION_STATUS_TERM_SOURCE_REF = ( - "Investigation Publication Status Term Source REF" -) #: + "Investigation Publication Status Term Source REF" #: +) #: Collected header keys of INVESTIGATION PUBLICATIONS INVESTIGATION_PUBLICATIONS_KEYS = ( INVESTIGATION_PUBMED_ID, @@ -96,8 +96,8 @@ INVESTIGATION_PERSON_AFFILIATION = "Investigation Person Affiliation" #: INVESTIGATION_PERSON_ROLES = "Investigation Person Roles" #: INVESTIGATION_PERSON_ROLES_TERM_ACCESSION_NUMBER = ( - "Investigation Person Roles Term Accession Number" -) #: + "Investigation Person Roles Term Accession Number" #: +) INVESTIGATION_PERSON_ROLES_TERM_SOURCE_REF = "Investigation Person Roles Term Source REF" #: #: Collected header keys of INVESTIGATION CONTACTS section INVESTIGATION_CONTACTS_KEYS = ( @@ -152,8 +152,8 @@ STUDY_PUBLICATION_TITLE = "Study Publication Title" #: STUDY_PUBLICATION_STATUS = "Study Publication Status" #: STUDY_PUBLICATION_STATUS_TERM_ACCESSION_NUMBER = ( - "Study Publication Status Term Accession Number" -) #: + "Study Publication Status Term Accession Number" #: +) STUDY_PUBLICATION_STATUS_TERM_SOURCE_REF = "Study Publication Status Term Source REF" #: #: Collected header keys of STUDY PUBLICATIONS section STUDY_PUBLICATIONS_KEYS = ( @@ -185,13 +185,13 @@ STUDY_ASSAY_FILE_NAME = "Study Assay File Name" #: STUDY_ASSAY_MEASUREMENT_TYPE = "Study Assay Measurement Type" #: STUDY_ASSAY_MEASUREMENT_TYPE_TERM_ACCESSION_NUMBER = ( - "Study Assay Measurement Type Term Accession Number" -) #: + "Study Assay Measurement Type Term Accession Number" #: +) STUDY_ASSAY_MEASUREMENT_TYPE_TERM_SOURCE_REF = "Study Assay Measurement Type Term Source REF" #: STUDY_ASSAY_TECHNOLOGY_TYPE = "Study Assay Technology Type" #: STUDY_ASSAY_TECHNOLOGY_TYPE_TERM_ACCESSION_NUMBER = ( - "Study Assay Technology Type Term Accession Number" -) #: + "Study Assay Technology Type Term Accession Number" #: +) STUDY_ASSAY_TECHNOLOGY_TYPE_TERM_SOURCE_REF = "Study Assay Technology Type Term Source REF" #: STUDY_ASSAY_TECHNOLOGY_PLATFORM = "Study Assay Technology Platform" #: #: Collected header keys of STUDY ASSAYS section @@ -217,19 +217,19 @@ STUDY_PROTOCOL_VERSION = "Study Protocol Version" #: STUDY_PROTOCOL_PARAMETERS_NAME = "Study Protocol Parameters Name" #: STUDY_PROTOCOL_PARAMETERS_NAME_TERM_ACCESSION_NUMBER = ( - "Study Protocol Parameters Name Term Accession Number" -) #: + "Study Protocol Parameters Name Term Accession Number" #: +) STUDY_PROTOCOL_PARAMETERS_NAME_TERM_SOURCE_REF = ( - "Study Protocol Parameters Name Term Source REF" -) #: + "Study Protocol Parameters Name Term Source REF" #: +) STUDY_PROTOCOL_COMPONENTS_NAME = "Study Protocol Components Name" #: STUDY_PROTOCOL_COMPONENTS_TYPE = "Study Protocol Components Type" #: STUDY_PROTOCOL_COMPONENTS_TYPE_TERM_ACCESSION_NUMBER = ( - "Study Protocol Components Type Term Accession Number" -) #: + "Study Protocol Components Type Term Accession Number" #: +) STUDY_PROTOCOL_COMPONENTS_TYPE_TERM_SOURCE_REF = ( - "Study Protocol Components Type Term Source REF" -) #: + "Study Protocol Components Type Term Source REF" #: +) #: Collected header keys of STUDY PROTOCOLS section STUDY_PROTOCOLS_KEYS = ( STUDY_PROTOCOL_NAME, diff --git a/altamisa/constants/table_headers.py b/altamisa/constants/table_headers.py index 5f347c9..3718fc0 100644 --- a/altamisa/constants/table_headers.py +++ b/altamisa/constants/table_headers.py @@ -36,8 +36,8 @@ METABOLITE_ASSIGNMENT_FILE = "Metabolite Assignment File" #: PEPTIDE_ASSIGNMENT_FILE = "Peptide Assignment File" #: POST_TRANSLATIONAL_MODIFICATION_ASSIGNMENT_FILE = ( - "Post Translational Modification Assignment File" -) #: + "Post Translational Modification Assignment File" #: +) PROTEIN_ASSIGNMENT_FILE = "Protein Assignment File" #: RAW_DATA_FILE = "Raw Data File" #: RAW_SPECTRAL_DATA_FILE = "Raw Spectral Data File" #: diff --git a/altamisa/isatab/models.py b/altamisa/isatab/models.py index d6fc7f4..d61255c 100644 --- a/altamisa/isatab/models.py +++ b/altamisa/isatab/models.py @@ -93,8 +93,7 @@ class Comment: @attr.s(auto_attribs=True, frozen=True) class OntologyRef: - """Description of an ontology term source, as used for investigation file. - """ + """Description of an ontology term source, as used for investigation file.""" #: The name of the ontology (e.g., ``CEBI``) name: str @@ -112,8 +111,7 @@ class OntologyRef: @attr.s(auto_attribs=True, frozen=True) class BasicInfo: - """Basic metadata for an investigation or study (``INVESTIGATION`` or ``STUDY``). - """ + """Basic metadata for an investigation or study (``INVESTIGATION`` or ``STUDY``).""" #: Path to the investigation or study file path: Path @@ -135,8 +133,7 @@ class BasicInfo: @attr.s(auto_attribs=True, frozen=True) class PublicationInfo: - """Information regarding an investigation publication (``INVESTIGATION PUBLICATIONS``). - """ + """Information regarding an investigation publication (``INVESTIGATION PUBLICATIONS``).""" #: Publication PubMed ID pubmed_id: str diff --git a/altamisa/isatab/parse_investigation.py b/altamisa/isatab/parse_investigation.py index 8ddba3f..5ac8aff 100644 --- a/altamisa/isatab/parse_investigation.py +++ b/altamisa/isatab/parse_investigation.py @@ -56,7 +56,7 @@ def _split_study_protocols_parameters( tpl = "Repeated protocol parameter; found: {}" msg = tpl.format(names) raise ParseIsatabException(msg) - for (name, acc, src) in zip(names, name_term_accs, name_term_srcs): + for name, acc, src in zip(names, name_term_accs, name_term_srcs): if any((name, acc, src)): # skips empty parameters yield models.OntologyTermRef(name, acc, src) @@ -79,7 +79,7 @@ def _split_study_protocols_components( tpl = "Repeated protocol components; found: {}" msg = tpl.format(names) raise ParseIsatabException(msg) - for (name, ctype, acc, src) in zip( + for name, ctype, acc, src in zip( names, types, type_term_accs, type_term_srcs ): # pragma: no cover if not name and any((ctype, acc, src)): diff --git a/altamisa/isatab/write_assay_study.py b/altamisa/isatab/write_assay_study.py index cbba3ce..5c065d2 100644 --- a/altamisa/isatab/write_assay_study.py +++ b/altamisa/isatab/write_assay_study.py @@ -167,8 +167,7 @@ def run(self): class _WriterBase: - """Base class that writes a file from an ``Study`` or ``Assay`` object. - """ + """Base class that writes a file from an ``Study`` or ``Assay`` object.""" #: Note type starting a graph _starting_type = None diff --git a/docs/conf.py b/docs/conf.py index b2abf27..48656d6 100755 --- a/docs/conf.py +++ b/docs/conf.py @@ -54,9 +54,9 @@ master_doc = "index" # General information about the project. -project = u"AltamISA" -copyright = u"2018-2019, Berlin Institute of Health" -author = u"Mathias Kuhring, Manuel Holtgrewe" +project = "AltamISA" +copyright = "2018-2019, Berlin Institute of Health" +author = "Mathias Kuhring, Manuel Holtgrewe" # The version info for the project you're documenting, acts as replacement # for |version| and |release|, also used in various other places throughout @@ -132,7 +132,7 @@ # (source start file, target name, title, author, documentclass # [howto, manual, or own class]). latex_documents = [ - (master_doc, "altamisa.tex", u"AltamISA Documentation", u"Core Unit Bioinformatics", "manual") + (master_doc, "altamisa.tex", "AltamISA Documentation", "Core Unit Bioinformatics", "manual") ] @@ -140,7 +140,7 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). -man_pages = [(master_doc, "altamisa", u"AltamISA Documentation", [author], 1)] +man_pages = [(master_doc, "altamisa", "AltamISA Documentation", [author], 1)] # -- Options for Texinfo output ---------------------------------------- @@ -152,7 +152,7 @@ ( master_doc, "altamisa", - u"AltamISA Documentation", + "AltamISA Documentation", author, "altamisa", "One line description of project.", diff --git a/tests/conftest.py b/tests/conftest.py index e77c056..0498f76 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -63,8 +63,7 @@ def small_assay_file(): @pytest.fixture def full_investigation_file(): - """This file contains values for each normal investigation section and key. - """ + """This file contains values for each normal investigation section and key.""" path = os.path.join(os.path.dirname(__file__), "data/i_fullinvest/i_fullinvest.txt") with open(path, "rt") as file: yield file @@ -72,8 +71,7 @@ def full_investigation_file(): @pytest.fixture def full2_investigation_file(): - """This file contains values for each normal investigation section and key. - """ + """This file contains values for each normal investigation section and key.""" path = os.path.join(os.path.dirname(__file__), "data/i_fullinvest2/i_fullinvest2.txt") with open(path, "rt") as file: yield file @@ -81,8 +79,7 @@ def full2_investigation_file(): @pytest.fixture def comment_investigation_file(): - """This file contains comments for each investigation section. - """ + """This file contains comments for each investigation section.""" path = os.path.join(os.path.dirname(__file__), "data/i_comments/i_comments.txt") with open(path, "rt") as file: yield file @@ -124,8 +121,7 @@ def small2_study_file(): @pytest.fixture def small2_assay_file(): - """This file contains splitting and pooling examples. - """ + """This file contains splitting and pooling examples.""" path = os.path.join(os.path.dirname(__file__), "data/i_small2/a_small2.txt") with open(path, "rt") as file: yield file @@ -140,8 +136,7 @@ def gelelect_investigation_file(): @pytest.fixture def gelelect_assay_file(): - """This file contains special cases for gel electrophoresis assays. - """ + """This file contains special cases for gel electrophoresis assays.""" path = os.path.join( os.path.dirname(__file__), "data/test_gelelect/a_study01_protein_expression_profiling_gel_electrophoresis.txt", diff --git a/tests/test_exceptions.py b/tests/test_exceptions.py index e79653b..3d2868e 100644 --- a/tests/test_exceptions.py +++ b/tests/test_exceptions.py @@ -19,7 +19,7 @@ def test_header_exception_simple_header_not_allowed(assay_file_exception_simple_ def test_header_exception_labeled_header_not_allowed( - assay_file_exception_labeled_header_not_allowed + assay_file_exception_labeled_header_not_allowed, ): with pytest.raises(ParseIsatabException) as excinfo: AssayReader.from_stream("S1", "A1", assay_file_exception_labeled_header_not_allowed) @@ -35,7 +35,7 @@ def test_header_exception_unknown_header(assay_file_exception_unknown_header): def test_header_exception_term_source_ref_next_column( - assay_file_exception_term_source_ref_next_column + assay_file_exception_term_source_ref_next_column, ): with pytest.raises(ParseIsatabException) as excinfo: AssayReader.from_stream("S1", "A1", assay_file_exception_term_source_ref_next_column) @@ -44,7 +44,7 @@ def test_header_exception_term_source_ref_next_column( def test_header_exception_term_source_ref_stop_iteration( - assay_file_exception_term_source_ref_stop_iteration + assay_file_exception_term_source_ref_stop_iteration, ): with pytest.raises(ParseIsatabException) as excinfo: AssayReader.from_stream("S1", "A1", assay_file_exception_term_source_ref_stop_iteration)