From a1ba3e792d0a0dc2ffe1f791f0673176918ff34f Mon Sep 17 00:00:00 2001 From: Victor Date: Fri, 16 Dec 2016 09:54:53 -0500 Subject: [PATCH] Added subtype. --- cutlass/Proteome.py | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/cutlass/Proteome.py b/cutlass/Proteome.py index a247178..d128f69 100644 --- a/cutlass/Proteome.py +++ b/cutlass/Proteome.py @@ -76,6 +76,7 @@ def __init__(self): self._spectra_url = [''] self._local_spectra_file = None self._study = None + self._subtype = None self._title = None # Optional properties @@ -870,6 +871,31 @@ def study(self, study): else: raise Exception("Invalid study.") + @property + def subtype(self): + """ + str: Retrieves the subtype of the Proteome (host or microbiome). + """ + self.logger.debug("In 'subtype' getter.") + + return self._subtype + + @subtype.setter + @enforce_string + def subtype(self, subtype): + """ + Sets the subtype of the proteome. Must be either 'host' or 'microbiome'. + + Args: + subtype (str): host or microbiome. + + Returns: + None + """ + self.logger.debug("In 'subtype' setter.") + + self._subtype = subtype + def validate(self): """ Validates the current object's data/JSON against the current @@ -981,7 +1007,7 @@ def _get_raw_doc(self): 'spectra_format': self._spectra_format, 'spectra_url': self._spectra_url, 'study': self._study, - 'subtype': self._study, + 'subtype': self._subtype, 'tags': self._tags } } @@ -1038,7 +1064,7 @@ def required_fields(): "search_engine", "protid_format", "pepid_format", "protmod_format", "spectra_format", "local_spectra_file", "local_protmod_file", "local_protid_file", - "local_pepid_file", "study") + "local_pepid_file", "study", "subtype") def delete(self): """