Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 33 additions & 1 deletion sample_annotator/clients/gold_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,39 @@ def fetch_study_by_project(self, id: str) -> List[SampleDict]:
id = self._normalize_id(id)
results = self._call("studies", {"projectGoldId": id})
return results


def fetch_study_by_analysis_id(self, id: str) -> List[SampleDict]:
"""Fetch the study id for which the informatics processing
of a sequencing project was performed.

:param id: GOLD Analysis id. Ex.: Ga0466468
:return: List of SampleDict objects
"""
id = self._normalize_id(id)
results = self._call("studies", {"analysisGoldId": id})
return results

def fetch_biosample_by_analysis_id(self, id: str) -> List[SampleDict]:
"""Fetch the biosample id for which the informatics processing
of a sequencing project was performed.

:param id: GOLD Analysis id. Ex.: Ga0466468
:return: List of SampleDict objects
"""
id = self._normalize_id(id)
results = self._call("biosamples", {"analysisGoldId": id})
return results

def fetch_project_by_analysis_id(self, id: str) -> List[SampleDict]:
"""Fetch the project id for which the informatics processing
of a sequencing project was performed.

:param id: GOLD Analysis id. Ex.: Ga0466468
:return: List of SampleDict objects
"""
id = self._normalize_id(id)
results = self._call("projects", {"analysisGoldId": id})
return results

@click.group()
@click.option("-v", "--verbose", count=True)
Expand Down