vantage6.client.subclients.study.StudySubClient#

class StudySubClient(parent)#

Bases: SubClient

Subclient for the algorithm store.

__init__(parent)#

Methods

__init__(parent)

add_organization(organization[, study])

Add an organization to a study

create(name, organizations[, collaboration])

Create new study

delete([id_])

Deletes a study

get(id_)

Get a study by its id.

list([name, organization, ...])

View your studies

remove_organization(organization[, study])

Remove an organization from a study

update(id_[, name, organizations])

Update study information

add_organization(organization, study=None)#

Add an organization to a study

Parameters:
  • organization (int) – Id of the organization you want to add to the study

  • study (int, optional) – Id of the study you want to add the organization to.

Returns:

Containing the updated list of organizations in the study

Return type:

list[dict]

create(name, organizations, collaboration=None)#

Create new study

Parameters:
  • name (str) – Name of the study

  • organizations (list[int]) – List of organization ids which participate in the study

  • collaboration (int | None) – Id of the collaboration the study is part of. If None, the value of setup_collaboration() is used.

  • field (str, optional) – Which data field to keep in the returned dict. For instance, “field=’name’” will only return the name of the study. Default is None.

  • fields (list[str], optional) – Which data fields to keep in the returned dict. For instance, “fields=[‘name’, ‘id’]” will only return the name and id of the study. Default is None.

Returns:

Containing the new study information

Return type:

dict

delete(id_=None)#

Deletes a study

Parameters:

id (int) – Id of the study you want to delete

Return type:

None

get(id_)#

Get a study by its id.

Parameters:
  • id (int) – The id of the study

  • field (str, optional) – Which data field to keep in the result. For instance, “field=’name’” will only return the name of the study. Default is None.

  • fields (list[str], optional) – Which data fields to keep in the result. For instance, “fields=[‘name’, ‘id’]” will only return the name and id of the study. Default is None.

Returns:

The study

Return type:

dict

list(name=None, organization=None, include_organizations=False, page=1, per_page=20)#

View your studies

Parameters:
  • name (str, optional (with LIKE operator)) – Filter studies by name

  • organization (int, optional) – Filter studies by organization id

  • include_organizations (bool, optional) – Include organizations in the response, by default False

  • field (str, optional) – Which data field to keep in the result. For instance, “field=’name’” will only return the name of the studies. Default is None.

  • fields (list[str], optional) – Which data fields to keep in the result. For instance, “fields=[‘name’, ‘id’]” will only return the name and id of the studies. Default is None.

  • filter (tuple, optional) – Filter the result on key-value pairs. For instance, “filter_=(‘name’, ‘study1’)” will only return the studies with the name ‘study1’. Default is None.

  • filters (list[tuple], optional) – Filter the result on multiple key-value pairs. For instance, “filters=[(‘name’, ‘study1’), (‘id’, 1)]” will only return the studies with the name ‘study1’ and id 1. Default is None.

  • page (int, optional) – Pagination page, by default 1

  • per_page (int, optional) – Number of items on a single page, by default 20

Returns:

Containing collabotation information

Return type:

list[dict]

remove_organization(organization, study=None)#

Remove an organization from a study

Parameters:
  • organization (int) – Id of the organization you want to remove from the study

  • study (int, optional) – Id of the study you want to remove the organization from

Returns:

Containing the updated list of organizations in the study

Return type:

list[dict]

update(id_, name=None, organizations=None)#

Update study information

Parameters:
  • id (int) – Id of the study you want to update.

  • name (str, optional) – New name of the study

  • organizations (list[int], optional) – New list of organization ids which participate in the study

  • field (str, optional) – Which data field to keep in the returned dict. For instance, “field=’name’” will only return the name of the study. Default is None.

  • fields (list[str], optional) – Which data fields to keep in the returned dict. For instance, “fields=[‘name’, ‘id’]” will only return the name and id of the study. Default is None.

Returns:

Containing the updated study information

Return type:

dict