Skip to content

Commit

Permalink
Added subtype.
Browse files Browse the repository at this point in the history
  • Loading branch information
victor73 committed Dec 16, 2016
1 parent 6b5afd3 commit a1ba3e7
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions cutlass/Proteome.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
}
}
Expand Down Expand Up @@ -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):
"""
Expand Down

0 comments on commit a1ba3e7

Please sign in to comment.