Skip to content

Commit

Permalink
improved docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrea Pierleoni committed Nov 3, 2016
1 parent 19af204 commit 1dde47c
Showing 1 changed file with 21 additions and 11 deletions.
32 changes: 21 additions & 11 deletions opentargets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ def __init__(self,
):
"""
Init the client and start a connection
Keyword Args:
**kwargs: all params forwarded to opentargets.conn.Connection object
**kwargs: all params forwarded to ``opentargets.conn.Connection`` object
"""
self.conn = Connection(**kwargs)

Expand All @@ -47,10 +48,11 @@ def search(self, query,**kwargs):
"""
Search a string and return a list of objects form the search method of the REST API.
E.g. A returned object could be a target or a disease
Args:
query (str): string to search for
Keyword Args:
**kwargs are passed as other parameters to the /public/search method of the REST API
**kwargs: are passed as other parameters to the /public/search method of the REST API
Returns:
IterableResult: Result of the query
Expand All @@ -67,7 +69,7 @@ def get_association(self,association_id, **kwargs):
Args:
association_id (str): Association ID
Keyword Args:
**kwargs are passed as other parameters to the /public/association method of the REST API
**kwargs: are passed as other parameters to the /public/association method of the REST API
Returns:
IterableResult: Result of the query
Expand All @@ -80,8 +82,9 @@ def get_association(self,association_id, **kwargs):
def filter_associations(self,**kwargs):
"""
Retrieve a set of associations by applying a set of filters
Keyword Args:
**kwargs are passed as parameters to the /public/association/filterby method of the REST API
**kwargs: are passed as parameters to the /public/association/filterby method of the REST API
Returns:
IterableResult: Result of the query
Expand All @@ -94,10 +97,11 @@ def get_associations_for_target(self, target, **kwargs):
"""
Same as ``OpenTargetsClient.filter_associations`` but accept any string as `target` parameter and fires a search
if it is not an Ensembl Gene identifier
Args:
target (str): an Ensembl Gene identifier or a string to search for a gene mapping
Keyword Args:
**kwargs are passed as parameters to the /public/association/filterby method of the REST API
**kwargs: are passed as parameters to the /public/association/filterby method of the REST API
Returns:
IterableResult: Result of the query
"""
Expand All @@ -117,10 +121,11 @@ def get_associations_for_disease(self, disease, **kwargs):
"""
Same as ``OpenTargetsClient.filter_associations`` but accept any string as `disease` parameter and
fires a search if it is not a valid disease identifier
Args:
disease (str): a disease identifier or a string to search for a disease mapping
Keyword Args:
**kwargs are passed as parameters to the /public/association/filterby method of the REST API
**kwargs: are passed as parameters to the /public/association/filterby method of the REST API
Returns:
IterableResult: Result of the query
"""
Expand All @@ -139,10 +144,11 @@ def get_associations_for_disease(self, disease, **kwargs):
def get_evidence(self, evidence_id, **kwargs):
"""
Retrieve a specific Evidence object from the REST API provided its ID
Args:
evidence_id:
Keyword Args:
**kwargs are passed as other parameters to the /public/evidence method of the REST API
**kwargs: are passed as other parameters to the /public/evidence method of the REST API
Returns:
IterableResult: Result of the query
Expand All @@ -155,8 +161,9 @@ def get_evidence(self, evidence_id, **kwargs):
def filter_evidence(self,**kwargs):
"""
Retrieve a set of evidence by applying a set of filters
Keyword Args:
**kwargs are passed as parameters to the /public/evidence/filterby method of the REST API
**kwargs: are passed as parameters to the /public/evidence/filterby method of the REST API
Returns:
IterableResult: Result of the query
Expand All @@ -169,10 +176,11 @@ def get_evidence_for_target(self, target, **kwargs):
"""
Same as ``OpenTargetsClient.filter_evidence`` but accept any string as `target` parameter and fires a search
if it is not an Ensembl Gene identifier
Args:
target (str): an Ensembl Gene identifier or a string to search for a gene mapping
Keyword Args:
**kwargs are passed as parameters to the /public/evidence/filterby method of the REST API
**kwargs: are passed as parameters to the /public/evidence/filterby method of the REST API
Returns:
IterableResult: Result of the query
"""
Expand All @@ -192,10 +200,11 @@ def get_evidence_for_disease(self, disease, **kwargs):
"""
Same as ``OpenTargetsClient.filter_evidence`` but accept any string as `disease` parameter and
fires a search if it is not a valid disease identifier
Args:
t (str): a disease identifier or a string to search for a disease mapping
disease (str): a disease identifier or a string to search for a disease mapping
Keyword Args:
**kwargs are passed as parameters to the /public/evidence/filterby method of the REST API
**kwargs: are passed as parameters to the /public/evidence/filterby method of the REST API
Returns:
IterableResult: Result of the query
"""
Expand All @@ -214,6 +223,7 @@ def get_evidence_for_disease(self, disease, **kwargs):
def get_stats(self):
"""
Returns statistics about the data served by the REST API
Returns:
IterableResult: Result of the query
"""
Expand Down

0 comments on commit 1dde47c

Please sign in to comment.