Constants

bioturing_connector package

bioturing_connector.bbrowserx_connector module

Python package for submitting/getting data from BBrowserX

class bioturing_connector.bbrowserx_connector.BBrowserXConnector(host: str, token: str, ssl: bool = True)[source]

Bases: Connector

Create a connector object to submit/get data from BBrowserX

Parameters:
hoststr

The URL of the BBrowserX server, only support HTTPS connection

Example:

https://talk2data.bioturing.com/t2d_index_tool/

tokenstr

The API token to verify authority. Generated in-app.

Methods

assign_standardized_meta(species, group_id, ...)

Assign metadata value to a standardized term on ontologies tree

get_all_studies_info_in_group(species, group_id)

Get info of all studies within group.

get_barcodes(species, study_id)

Get barcodes of a study.

get_features(species, study_id)

Get features of a study.

get_metadata(species, study_id)

Get full metadata of a study.

get_ontologies_tree(species, group_id)

Get standardized ontologies tree

get_shared_s3_of_group(group_id)

Get all available groups of current token

get_user_groups()

Get all available groups of current token

get_user_s3()

Get all available groups of current token

list_all_custom_embeddings(species, study_id)

List all custom embeddings of a study

query_genes(species, study_id, gene_names[, ...])

Query genes expression of a study.

retrieve_custom_embedding(species, study_id, ...)

Retrieve an embedding array of a study

submit_metadata_from_dataframe(species, ...)

Submit metadata dataframe directly to a study

submit_metadata_from_local(species, ...)

Submit metadata to a study with local path

submit_metadata_from_s3(species, study_id, ...)

Submit metadata to a study with s3 path

submit_metadata_from_shared_s3(species, ...)

Submit metadata to a study with s3 path

submit_study_from_local(group_id, batch_info)

Submit one or multiple datasets from local / server.

submit_study_from_s3(group_id[, s3_id, ...])

Submit one or multiple datasets from s3 bucket to BBrowserX.

submit_study_from_shared_s3(group_id, ...[, ...])

Submit one or multiple datasets from s3 bucket to BBrowserX.

test_connection()

Test the connection to the host

upload_chunk(file_names, files, chunk_size)

meta private:

assign_standardized_meta(species, group_id, study_id, metadata_field, metadata_value, root_name, leaf_name)

Assign metadata value to a standardized term on ontologies tree

Parameters:
speciesbioturing_connector.typing.Species

Species of the study.

Support:

bioturing_connector.typing.Species.HUMAN.value

bioturing_connector.typing.Species.MOUSE.value

bioturing_connector.typing.Species.PRIMATE.value

bioturing_connector.typing.Species.OTHERS.value

group_idstr

ID of the group to submit the data to.

study_idstr

ID of the study (uuid)

metadata_fieldstr

~ column name of meta dataframe in platform (eg: author’s tissue)

metadata_valuestr

~ metadata value within the metadata field (eg: normal lung)

root_namestr

name of root in btr ontologies tree (eg: tissue)

leaf_namestr

name of leaf in btr ontologies tree (eg: lung)

Returns:
Submission statusbool | str

True or Error log

get_all_studies_info_in_group(species: str, group_id: str)

Get info of all studies within group.

Parameters:
speciesbioturing_connector.typing.Species.typing.Species

Species of the study.

Support:

bioturing_connector.typing.Species.HUMAN.value

bioturing_connector.typing.Species.MOUSE.value

bioturing_connector.typing.Species.PRIMATE.value

bioturing_connector.typing.Species.OTHERS.value

group_idstr,

Group hash id (uuid)

Returns:
List of studies’ infoList[dict]
In which:

‘uuid’: the uuid of study, which will be used in further steps,

‘study_hash_id’: the displaying id of study on platform,

‘created_by’: email of person who submitted the study,

get_barcodes(species: str, study_id: str)

Get barcodes of a study.

Parameters:
speciesbioturing_connector.typing.Species,

Species of the study.

Support:

bioturing_connector.typing.Species.HUMAN.value

bioturing_connector.typing.Species.MOUSE.value

bioturing_connector.typing.Species.PRIMATE.value

bioturing_connector.typing.Species.OTHERS.value

study_idstr,

uuidv4 of study

Returns:
barcodesList[]
get_features(species: str, study_id: str)

Get features of a study.

Parameters:
speciesbioturing_connector.typing.Species,

Species of the study.

Support:

bioturing_connector.typing.Species.HUMAN.value

bioturing_connector.typing.Species.MOUSE.value

bioturing_connector.typing.Species.PRIMATE.value

bioturing_connector.typing.Species.OTHERS.value

study_idstr,

uuidv4 of study

Returns:
FeaturesList[]
get_metadata(species: str, study_id: str)

Get full metadata of a study.

Parameters:
speciesbioturing_connector.typing.Species,

Species of the study.

Support:

bioturing_connector.typing.Species.HUMAN.value

bioturing_connector.typing.Species.MOUSE.value

bioturing_connector.typing.Species.PRIMATE.value

bioturing_connector.typing.Species.OTHERS.value

study_idstr,

uuidv4 of study

Returns:
Metadatapd.DataFrame
get_ontologies_tree(species, group_id)

Get standardized ontologies tree

Parameters:
speciesbioturing_connector.typing.Species,

Species of the study.

Support:

bioturing_connector.typing.Species.HUMAN.value

bioturing_connector.typing.Species.MOUSE.value

bioturing_connector.typing.Species.PRIMATE.value

bioturing_connector.typing.Species.OTHERS.value

group_idstr

ID of the group.

Returns:
Ontologies treeDict[Dict]
In which:

‘name’: name of the node, which will be used in further steps

get_shared_s3_of_group(group_id: str)

Get all available groups of current token

Parameters:
group_idstr,

Group hash id (uuid)

Returns:
List of s3 bucket’ infoList[dict]
In which:

‘id’: uuid of the s3 bucket, which will be used in further steps,

‘bucket’: bucket of s3,

‘prefix’: prefix of s3,

( s3_path = s3://[bucket]/[prefix]/ )

get_user_groups()

Get all available groups of current token

Returns:
List of groups’ infoList[dict]
In which:

‘group_id’: uuid of the group, which will be used in further steps,

‘group_name’: displaying name of the group

get_user_s3()

Get all available groups of current token

Returns:
List of s3 bucket’ infoList[dict]
In which:

‘id’: uuid of the s3 bucket, which will be used in further steps,

‘bucket’: bucket of s3,

‘prefix’: prefix of s3,

( s3_path = s3://[bucket]/[prefix]/ )

list_all_custom_embeddings(species: str, study_id: str)

List all custom embeddings of a study

Parameters:
speciesbioturing_connector.typing.Species,

Species of the study.

Support:

bioturing_connector.typing.Species.HUMAN.value

bioturing_connector.typing.Species.MOUSE.value

bioturing_connector.typing.Species.PRIMATE.value

bioturing_connector.typing.Species.OTHERS.value

study_idstr,

uuidv4 of study

Returns:
List of embeddings’ infoList[dict]
In which:

‘embedding_id’: the uuid used in further steps

‘embedding_name’: displaying name on platform

query_genes(species: str, study_id: str, gene_names: List[str], unit: str = 'raw')

Query genes expression of a study.

Parameters:
speciesbioturing_connector.typing.Species,

Species of the study.

Support:

bioturing_connector.typing.Species.HUMAN.value

bioturing_connector.typing.Species.MOUSE.value

bioturing_connector.typing.Species.PRIMATE.value

bioturing_connector.typing.Species.OTHERS.value

study_idstr,

uuidv4 of study

gene_namesList[str]

Querying gene names.

If gene_names=[], full matrix will be returned

unitbioturing_connector.typing.StudyUnit. Default ‘raw’

Expression unit

Support:

bioturing_connector.typing.StudyUnit.UNIT_LOGNORM.value

bioturing_connector.typing.StudyUnit.UNIT_RAW.value

Returns:
expression_matrixcsc_matrix

Expression matrix, shape=(n_cells, n_genes)

retrieve_custom_embedding(species: str, study_id: str, embedding_id: str)

Retrieve an embedding array of a study

Parameters:
speciesbioturing_connector.typing.Species,

Species of the study.

Support:

bioturing_connector.typing.Species.HUMAN.value

bioturing_connector.typing.Species.MOUSE.value

bioturing_connector.typing.Species.PRIMATE.value

bioturing_connector.typing.Species.OTHERS.value

study_idstr,

uuidv4 of study

embedding_idstr,

Embedding id (uuid)

Returns:
embedding_arrnp.ndarray with shape (n_cells x n_dims)
submit_metadata_from_dataframe(species: str, study_id: str, group_id: str, df: DataFrame)

Submit metadata dataframe directly to a study

Parameters:
speciesbioturing_connector.typing.Species,

Species of the study.

Support:

bioturing_connector.typing.Species.HUMAN.value

bioturing_connector.typing.Species.MOUSE.value

bioturing_connector.typing.Species.PRIMATE.value

bioturing_connector.typing.Species.OTHERS.value

study_idstr,

uuidv4 of study

group_idstr,

ID of the group containing study id

dfpandas DataFrame,

Barcodes must be in df.index!!!!

Returns:
Submission statusbool | str

True or Error log

submit_metadata_from_local(species: str, study_id: str, group_id: str, file_path: str)

Submit metadata to a study with local path

Parameters:
speciesbioturing_connector.typing.Species,

Species of the study.

Support:

bioturing_connector.typing.Species.HUMAN.value

bioturing_connector.typing.Species.MOUSE.value

bioturing_connector.typing.Species.PRIMATE.value

bioturing_connector.typing.Species.OTHERS.value

study_idstr,

uuidv4 of study

group_idstr,

ID of the group containing study id

file_pathlocal path leading to metadata file,

Barcodes must be in the first column

File suffix must be in .tsv/.csv

Returns:
Submission statusbool | str

True or Error log

submit_metadata_from_s3(species: str, study_id: str, group_id: str, file_path: str, s3_id: str | None = None)

Submit metadata to a study with s3 path

Parameters:
speciesbioturing_connector.typing.Species,

Species of the study.

Support:

bioturing_connector.typing.Species.HUMAN.value

bioturing_connector.typing.Species.MOUSE.value

bioturing_connector.typing.Species.PRIMATE.value

bioturing_connector.typing.Species.OTHERS.value

study_idstr,

uuidv4 of study

group_idstr,

ID of the group containing study id

file_pathstr,

Path in s3 bucket leading to metadata file,

Notes:

Barcodes must be in the fist column

File suffix must be in .tsv/.csv

File_path DOES NOT contain s3_bucket path configured on the platform
E.g:

realpath: ‘s3://bucket/folder/metadata.tsv’

inputpath: ‘folder/metadata.tsv’

s3_idstr, Optional

ID of s3 bucket. Default: None

If s3_id is not provided, we will use the first s3 bucket configured on the platform.

Returns:
Submission statusbool | str

True or Error log

submit_metadata_from_shared_s3(species: str, study_id: str, group_id: str, file_path: str, shared_s3_id: str | None = None)

Submit metadata to a study with s3 path

Parameters:
speciesbioturing_connector.typing.Species,

Species of the study.

Support:

bioturing_connector.typing.Species.HUMAN.value

bioturing_connector.typing.Species.MOUSE.value

bioturing_connector.typing.Species.PRIMATE.value

bioturing_connector.typing.Species.OTHERS.value

study_idstr,

uuidv4 of study

group_idstr,

ID of the group containing study id

file_pathstr,

Path in s3 bucket leading to metadata file,

Notes:

Barcodes must be in the fist column

File suffix must be in .tsv/.csv

File_path DOES NOT contain s3_bucket path configured on the platform
E.g:

realpath: ‘s3://bucket/prefix/metadata.tsv’

inputpath: ‘prefix/metadata.tsv’

shared_s3_idstr

ID of shared s3 bucket

Returns:
Submission statusbool | str

True or Error log

submit_study_from_local(group_id: str, batch_info: object, study_id: str | None = None, name: str = 'TBD', authors: List[str] = [], abstract: str = '', species: str = 'human', input_matrix_type: str = 'normalized', study_type: int = 2, min_counts: int | None = None, min_genes: int | None = None, max_counts: int | None = None, max_genes: int | None = None, mt_percentage: int | float | None = None, skip_dimred: bool = False, chunk_size: int = 104857600)[source]

Submit one or multiple datasets from local / server.

Parameters:
group_idstr

ID of the group to submit the data to.

batch_infoList[dict]

File path and batch name information.

Example:
For h5ad format:
[{

‘matrix’: ‘local_path/GSE128223_1.h5ad’

}, {…}]

For mtx format:
[{

‘name’: ‘data_1’,

‘matrix’: ‘local_path/data_1/matrix.mtx’,

‘features’: ‘local_path/data_1/features.tsv’,

‘barcodes’: ‘local_path/data_1/barcodes.tsv’,

}, {…}]

study_idstr, optional

Will be the displaying name of study (eg: PBMC_3K). Default: uuidv4

namestr, optional

Name of the study. Default: ‘TBD’

authorsList[str], optional

Authors of the study. Default: []

abstractstr, optional

Abstract of the study. Default: ‘’

speciesbioturing_connector.typing.Species, optional

Species of the study. Default: ‘human’

Support:

bioturing_connector.typing.Species.HUMAN.value

bioturing_connector.typing.Species.MOUSE.value

bioturing_connector.typing.Species.NON_HUMAN_PRIMATE.value

bioturing_connector.typing.Species.OTHERS.value

input_matrix_typebioturing_connector.typing.InputMatrixType, optional

Is the input matrix already normalized or not?. Default: ‘normalized’

Support:
bioturing_connector.typing.InputMatrixType.NORMALIZED.value

(will skip BioTuring normalization, h5ad: use adata.X)

bioturing_connector.typing.InputMatrixType.RAW.value

(apply BioTuring normalization, h5ad: use adata.raw.X)

study_typebioturing_connector.typing.StudyType, optional

Format of the study. Default: bioturing_connector.typing.StudyType.H5AD.value

Support:

bioturing_connector.typing.StudyType.BBROWSER.value

bioturing_connector.typing.StudyType.H5_10X.value

bioturing_connector.typing.StudyType.H5AD.value

bioturing_connector.typing.StudyType.MTX_10X.value

bioturing_connector.typing.StudyType.BCS.value

bioturing_connector.typing.StudyType.RDS.value

bioturing_connector.typing.StudyType.TSV.value

min_countsint, optional

Minimum number of counts required for a cell to pass filtering. Default: 0

min_genesint, optional

Minimum number of genes expressed required for a cell to pass filtering. Default: 0

max_countsint, optional

Maximum number of counts required for a cell to pass filtering. Default: inf

max_genesint, optional

Maximum number of genes expressed required for a cell to pass filtering. Default: inf

mt_percentageint, optional

Maximum number of mitochondria genes percentage required for a cell to pass filtering. Default: 100.

Ranging from 0 to 100

skip_dimredbool, optional

Skip BioTuring pipeline if set to True (only appliable when input is a scanpy/seurat object). Default: False

chunk_sizebioturing_connector.typing.ChunkSize, optional

Size of each separated chunk for uploading. Default: 104857600

Support:

bioturing_connector.typing.ChunkSize.CHUNK_5_MB.value

bioturing_connector.typing.ChunkSize.CHUNK_100_MB.value

bioturing_connector.typing.ChunkSize.CHUNK_500_MB.value

bioturing_connector.typing.ChunkSize.CHUNK_1_GB.value

Returns:
Submission statusbool | str

True or Error log

submit_study_from_s3(group_id: str, s3_id: str | None = None, batch_info: List[dict] = [], study_id: str | None = None, name: str = 'TBD', authors: List[str] = [], abstract: str = '', species: str = 'human', input_matrix_type: str = 'normalized', study_type: int = 2, min_counts: int | None = None, min_genes: int | None = None, max_counts: int | None = None, max_genes: int | None = None, mt_percentage: int | float | None = None, skip_dimred: bool = False)[source]

Submit one or multiple datasets from s3 bucket to BBrowserX.

Parameters:
group_idstr

ID of the group to submit the data to.

s3_idstr, Optional

ID of s3 bucket. Default: None

If s3_id is not provided, we will use the first s3 bucket configured on the platform.

batch_infoList[dict]

File path and batch name information, the path DOES NOT included the bucket path!

Example:
For h5ad format:
[{

‘matrix’: ‘s3_path/GSE128223_1.h5ad’

}, {…}]

For mtx format:
[{

‘matrix’: ‘s3_path/data_1/matrix.mtx’,

‘features’: ‘s3_path/data_1/features.tsv’,

‘barcodes’: ‘s3_path/data_1/barcodes.tsv’,

}, {…}]

For tiledb format:
[{

‘folder’: ‘s3_path/GSE128223_1’

}, {…}]

study_idstr, optional

Will be the displaying name of study (eg: PBMC_3K). Default: uuidv4

namestr, optional

Name of the study. Default: ‘TBD’

authorsList[str], optional

Authors of the study. Default: []

abstractstr, optional

Abstract of the study. Default: ‘’

speciesbioturing_connector.typing.Species, optional

Species of the study. Default: ‘human’

Support:

bioturing_connector.typing.Species.HUMAN.value

bioturing_connector.typing.Species.MOUSE.value

bioturing_connector.typing.Species.NON_HUMAN_PRIMATE.value

bioturing_connector.typing.Species.OTHERS.value

skip_dimredBool, optional

Skip BioTuring pipeline if set to True. Default: False

(only applicable when input is a scanpy/seurat object).

input_matrix_typebioturing_connector.typing.InputMatrixType, optional

Is the input matrix already normalized or not?. Default: ‘normalized’

Support:
bioturing_connector.typing.InputMatrixType.NORMALIZED.value

(will skip BioTuring normalization, h5ad: use adata.X)

bioturing_connector.typing.InputMatrixType.RAW.value

(apply BioTuring normalization, h5ad: use adata.raw.X)

study_typebioturing_connector.typing.StudyType, opitonal

Format of the study. Default: bioturing_connector.typing.StudyType.H5AD.value

Support:

bioturing_connector.typing.StudyType.BBROWSER.value

bioturing_connector.typing.StudyType.H5_10X.value

bioturing_connector.typing.StudyType.H5AD.value

bioturing_connector.typing.StudyType.MTX_10X.value

bioturing_connector.typing.StudyType.BCS.value

bioturing_connector.typing.StudyType.RDS.value

bioturing_connector.typing.StudyType.TSV.value

bioturing_connector.typing.StudyType.TILE_DB.value

min_countsint, optional

Minimum number of counts required for a cell to pass filtering. Default: 0

min_genesint, optional

Minimum number of genes expressed required for a cell to pass filtering. Default: 0

max_countsint, optional

Maximum number of counts required for a cell to pass filtering. Default: inf

max_genesint, optional

Maximum number of genes expressed required for a cell to pass filtering. Default: inf

mt_percentageint, optional

Maximum number of mitochondria genes percentage required for a cell to pass filtering. Default: 100

Ranging from 0 to 100

Returns:
Submission statusbool | str

True or Error log

submit_study_from_shared_s3(group_id: str, shared_s3_id: str, batch_info: List[dict] = [], study_id: str | None = None, name: str = 'TBD', authors: List[str] = [], abstract: str = '', species: str = 'human', input_matrix_type: str = 'normalized', study_type: int = 2, min_counts: int | None = None, min_genes: int | None = None, max_counts: int | None = None, max_genes: int | None = None, mt_percentage: int | float | None = None, skip_dimred: bool = False)[source]

Submit one or multiple datasets from s3 bucket to BBrowserX.

Parameters:
group_idstr

ID of the group to submit the data to.

shared_s3_idstr

ID of s3 bucket.

batch_infoList[dict]

File path and batch name information, the path DOES NOT included the bucket path!

Example:
For h5ad format:
[{

‘matrix’: ‘s3_path/GSE128223_1.h5ad’

}, {…}]

For mtx format:
[{

‘matrix’: ‘s3_path/data_1/matrix.mtx’,

‘features’: ‘s3_path/data_1/features.tsv’,

‘barcodes’: ‘s3_path/data_1/barcodes.tsv’,

}, {…}]

For tiledb format:
[{

‘folder’: ‘s3_path/GSE128223_1’

}, {…}]

study_idstr, optional

Will be the displaying name of study (eg: PBMC_3K). Default: uuidv4

namestr, optional

Name of the study. Default: ‘TBD’

authorsList[str], optional

Authors of the study. Default: []

abstractstr, optional

Abstract of the study. Default: ‘’

speciesbioturing_connector.typing.Species, optional

Species of the study. Default: ‘human’

Support:

bioturing_connector.typing.Species.HUMAN.value

bioturing_connector.typing.Species.MOUSE.value

bioturing_connector.typing.Species.NON_HUMAN_PRIMATE.value

bioturing_connector.typing.Species.OTHERS.value

skip_dimredBool, optional

Skip BioTuring pipeline if set to True. Default: False

(only applicable when input is a scanpy/seurat object).

input_matrix_typebioturing_connector.typing.InputMatrixType, optional

Is the input matrix already normalized or not?. Default: ‘normalized’

Support:
bioturing_connector.typing.InputMatrixType.NORMALIZED.value

(will skip BioTuring normalization, h5ad: use adata.X)

bioturing_connector.typing.InputMatrixType.RAW.value

(apply BioTuring normalization, h5ad: use adata.raw.X)

study_typebioturing_connector.typing.StudyType, opitonal

Format of the study. Default: bioturing_connector.typing.StudyType.H5AD.value

Support:

bioturing_connector.typing.StudyType.BBROWSER.value

bioturing_connector.typing.StudyType.H5_10X.value

bioturing_connector.typing.StudyType.H5AD.value

bioturing_connector.typing.StudyType.MTX_10X.value

bioturing_connector.typing.StudyType.BCS.value

bioturing_connector.typing.StudyType.RDS.value

bioturing_connector.typing.StudyType.TSV.value

bioturing_connector.typing.StudyType.TILE_DB.value

min_countsint, optional

Minimum number of counts required for a cell to pass filtering. Default: 0

min_genesint, optional

Minimum number of genes expressed required for a cell to pass filtering. Default: 0

max_countsint, optional

Maximum number of counts required for a cell to pass filtering. Default: inf

max_genesint, optional

Maximum number of genes expressed required for a cell to pass filtering. Default: inf

mt_percentageint, optional

Maximum number of mitochondria genes percentage required for a cell to pass filtering. Default: 100

Ranging from 0 to 100

Returns:
Submission statusbool | str

True or Error log

test_connection()

Test the connection to the host

Returns:
connection statusstr

bioturing_connector.lens_bulk_connector module

Python package for submitting/getting data from Lens Bulk

class bioturing_connector.lens_bulk_connector.LensBulkConnector(host: str, token: str, ssl: bool = True)[source]

Bases: Connector

Create a connector object to submit/get data from BioTuring Lens Bulk (Visium/GeoMx DSP)

Parameters:
hoststr

The URL of the LENS BULK server, only support HTTPS connection

Example:

https://talk2data.bioturing.com/lens_bulk/

tokenstr

The API token to verify authority. Generated in-app.

Methods

assign_standardized_meta(species, group_id, ...)

Assign metadata value to a standardized term on ontologies tree

get_all_studies_info_in_group(species, group_id)

Get info of all studies within group.

get_barcodes(species, study_id)

Get barcodes of a study.

get_features(species, study_id)

Get features of a study.

get_metadata(species, study_id)

Get full metadata of a study.

get_ontologies_tree(species, group_id)

Get standardized ontologies tree

get_shared_s3_of_group(group_id)

Get all available groups of current token

get_user_groups()

Get all available groups of current token

get_user_s3()

Get all available groups of current token

list_all_custom_embeddings(species, study_id)

List all custom embeddings of a study

query_genes(species, study_id, gene_names[, ...])

Query genes expression of a study.

retrieve_custom_embedding(species, study_id, ...)

Retrieve an embedding array of a study

submit_metadata_from_dataframe(species, ...)

Submit metadata dataframe directly to a study

submit_metadata_from_local(species, ...)

Submit metadata to a study with local path

submit_metadata_from_s3(species, study_id, ...)

Submit metadata to a study with s3 path

submit_metadata_from_shared_s3(species, ...)

Submit metadata to a study with s3 path

submit_study_from_local(group_id, batch_info)

Submit one or multiple data folders.

submit_study_from_s3(group_id[, s3_id, ...])

Submit one or multiple data folders.

submit_study_from_shared_s3(group_id, ...[, ...])

Submit one or multiple data folders.

test_connection()

Test the connection to the host

upload_chunk(file_names, files, chunk_size)

meta private:

assign_standardized_meta(species, group_id, study_id, metadata_field, metadata_value, root_name, leaf_name)

Assign metadata value to a standardized term on ontologies tree

Parameters:
speciesbioturing_connector.typing.Species

Species of the study.

Support:

bioturing_connector.typing.Species.HUMAN.value

bioturing_connector.typing.Species.MOUSE.value

bioturing_connector.typing.Species.PRIMATE.value

bioturing_connector.typing.Species.OTHERS.value

group_idstr

ID of the group to submit the data to.

study_idstr

ID of the study (uuid)

metadata_fieldstr

~ column name of meta dataframe in platform (eg: author’s tissue)

metadata_valuestr

~ metadata value within the metadata field (eg: normal lung)

root_namestr

name of root in btr ontologies tree (eg: tissue)

leaf_namestr

name of leaf in btr ontologies tree (eg: lung)

Returns:
Submission statusbool | str

True or Error log

get_all_studies_info_in_group(species: str, group_id: str)

Get info of all studies within group.

Parameters:
speciesbioturing_connector.typing.Species.typing.Species

Species of the study.

Support:

bioturing_connector.typing.Species.HUMAN.value

bioturing_connector.typing.Species.MOUSE.value

bioturing_connector.typing.Species.PRIMATE.value

bioturing_connector.typing.Species.OTHERS.value

group_idstr,

Group hash id (uuid)

Returns:
List of studies’ infoList[dict]
In which:

‘uuid’: the uuid of study, which will be used in further steps,

‘study_hash_id’: the displaying id of study on platform,

‘created_by’: email of person who submitted the study,

get_barcodes(species: str, study_id: str)

Get barcodes of a study.

Parameters:
speciesbioturing_connector.typing.Species,

Species of the study.

Support:

bioturing_connector.typing.Species.HUMAN.value

bioturing_connector.typing.Species.MOUSE.value

bioturing_connector.typing.Species.PRIMATE.value

bioturing_connector.typing.Species.OTHERS.value

study_idstr,

uuidv4 of study

Returns:
barcodesList[]
get_features(species: str, study_id: str)

Get features of a study.

Parameters:
speciesbioturing_connector.typing.Species,

Species of the study.

Support:

bioturing_connector.typing.Species.HUMAN.value

bioturing_connector.typing.Species.MOUSE.value

bioturing_connector.typing.Species.PRIMATE.value

bioturing_connector.typing.Species.OTHERS.value

study_idstr,

uuidv4 of study

Returns:
FeaturesList[]
get_metadata(species: str, study_id: str)

Get full metadata of a study.

Parameters:
speciesbioturing_connector.typing.Species,

Species of the study.

Support:

bioturing_connector.typing.Species.HUMAN.value

bioturing_connector.typing.Species.MOUSE.value

bioturing_connector.typing.Species.PRIMATE.value

bioturing_connector.typing.Species.OTHERS.value

study_idstr,

uuidv4 of study

Returns:
Metadatapd.DataFrame
get_ontologies_tree(species, group_id)

Get standardized ontologies tree

Parameters:
speciesbioturing_connector.typing.Species,

Species of the study.

Support:

bioturing_connector.typing.Species.HUMAN.value

bioturing_connector.typing.Species.MOUSE.value

bioturing_connector.typing.Species.PRIMATE.value

bioturing_connector.typing.Species.OTHERS.value

group_idstr

ID of the group.

Returns:
Ontologies treeDict[Dict]
In which:

‘name’: name of the node, which will be used in further steps

get_shared_s3_of_group(group_id: str)

Get all available groups of current token

Parameters:
group_idstr,

Group hash id (uuid)

Returns:
List of s3 bucket’ infoList[dict]
In which:

‘id’: uuid of the s3 bucket, which will be used in further steps,

‘bucket’: bucket of s3,

‘prefix’: prefix of s3,

( s3_path = s3://[bucket]/[prefix]/ )

get_user_groups()

Get all available groups of current token

Returns:
List of groups’ infoList[dict]
In which:

‘group_id’: uuid of the group, which will be used in further steps,

‘group_name’: displaying name of the group

get_user_s3()

Get all available groups of current token

Returns:
List of s3 bucket’ infoList[dict]
In which:

‘id’: uuid of the s3 bucket, which will be used in further steps,

‘bucket’: bucket of s3,

‘prefix’: prefix of s3,

( s3_path = s3://[bucket]/[prefix]/ )

list_all_custom_embeddings(species: str, study_id: str)

List all custom embeddings of a study

Parameters:
speciesbioturing_connector.typing.Species,

Species of the study.

Support:

bioturing_connector.typing.Species.HUMAN.value

bioturing_connector.typing.Species.MOUSE.value

bioturing_connector.typing.Species.PRIMATE.value

bioturing_connector.typing.Species.OTHERS.value

study_idstr,

uuidv4 of study

Returns:
List of embeddings’ infoList[dict]
In which:

‘embedding_id’: the uuid used in further steps

‘embedding_name’: displaying name on platform

query_genes(species: str, study_id: str, gene_names: List[str], unit: str = 'raw')

Query genes expression of a study.

Parameters:
speciesbioturing_connector.typing.Species,

Species of the study.

Support:

bioturing_connector.typing.Species.HUMAN.value

bioturing_connector.typing.Species.MOUSE.value

bioturing_connector.typing.Species.PRIMATE.value

bioturing_connector.typing.Species.OTHERS.value

study_idstr,

uuidv4 of study

gene_namesList[str]

Querying gene names.

If gene_names=[], full matrix will be returned

unitbioturing_connector.typing.StudyUnit. Default ‘raw’

Expression unit

Support:

bioturing_connector.typing.StudyUnit.UNIT_LOGNORM.value

bioturing_connector.typing.StudyUnit.UNIT_RAW.value

Returns:
expression_matrixcsc_matrix

Expression matrix, shape=(n_cells, n_genes)

retrieve_custom_embedding(species: str, study_id: str, embedding_id: str)

Retrieve an embedding array of a study

Parameters:
speciesbioturing_connector.typing.Species,

Species of the study.

Support:

bioturing_connector.typing.Species.HUMAN.value

bioturing_connector.typing.Species.MOUSE.value

bioturing_connector.typing.Species.PRIMATE.value

bioturing_connector.typing.Species.OTHERS.value

study_idstr,

uuidv4 of study

embedding_idstr,

Embedding id (uuid)

Returns:
embedding_arrnp.ndarray with shape (n_cells x n_dims)
submit_metadata_from_dataframe(species: str, study_id: str, group_id: str, df: DataFrame)

Submit metadata dataframe directly to a study

Parameters:
speciesbioturing_connector.typing.Species,

Species of the study.

Support:

bioturing_connector.typing.Species.HUMAN.value

bioturing_connector.typing.Species.MOUSE.value

bioturing_connector.typing.Species.PRIMATE.value

bioturing_connector.typing.Species.OTHERS.value

study_idstr,

uuidv4 of study

group_idstr,

ID of the group containing study id

dfpandas DataFrame,

Barcodes must be in df.index!!!!

Returns:
Submission statusbool | str

True or Error log

submit_metadata_from_local(species: str, study_id: str, group_id: str, file_path: str)

Submit metadata to a study with local path

Parameters:
speciesbioturing_connector.typing.Species,

Species of the study.

Support:

bioturing_connector.typing.Species.HUMAN.value

bioturing_connector.typing.Species.MOUSE.value

bioturing_connector.typing.Species.PRIMATE.value

bioturing_connector.typing.Species.OTHERS.value

study_idstr,

uuidv4 of study

group_idstr,

ID of the group containing study id

file_pathlocal path leading to metadata file,

Barcodes must be in the first column

File suffix must be in .tsv/.csv

Returns:
Submission statusbool | str

True or Error log

submit_metadata_from_s3(species: str, study_id: str, group_id: str, file_path: str, s3_id: str | None = None)

Submit metadata to a study with s3 path

Parameters:
speciesbioturing_connector.typing.Species,

Species of the study.

Support:

bioturing_connector.typing.Species.HUMAN.value

bioturing_connector.typing.Species.MOUSE.value

bioturing_connector.typing.Species.PRIMATE.value

bioturing_connector.typing.Species.OTHERS.value

study_idstr,

uuidv4 of study

group_idstr,

ID of the group containing study id

file_pathstr,

Path in s3 bucket leading to metadata file,

Notes:

Barcodes must be in the fist column

File suffix must be in .tsv/.csv

File_path DOES NOT contain s3_bucket path configured on the platform
E.g:

realpath: ‘s3://bucket/folder/metadata.tsv’

inputpath: ‘folder/metadata.tsv’

s3_idstr, Optional

ID of s3 bucket. Default: None

If s3_id is not provided, we will use the first s3 bucket configured on the platform.

Returns:
Submission statusbool | str

True or Error log

submit_metadata_from_shared_s3(species: str, study_id: str, group_id: str, file_path: str, shared_s3_id: str | None = None)

Submit metadata to a study with s3 path

Parameters:
speciesbioturing_connector.typing.Species,

Species of the study.

Support:

bioturing_connector.typing.Species.HUMAN.value

bioturing_connector.typing.Species.MOUSE.value

bioturing_connector.typing.Species.PRIMATE.value

bioturing_connector.typing.Species.OTHERS.value

study_idstr,

uuidv4 of study

group_idstr,

ID of the group containing study id

file_pathstr,

Path in s3 bucket leading to metadata file,

Notes:

Barcodes must be in the fist column

File suffix must be in .tsv/.csv

File_path DOES NOT contain s3_bucket path configured on the platform
E.g:

realpath: ‘s3://bucket/prefix/metadata.tsv’

inputpath: ‘prefix/metadata.tsv’

shared_s3_idstr

ID of shared s3 bucket

Returns:
Submission statusbool | str

True or Error log

submit_study_from_local(group_id: str, batch_info: object, study_id: str | None = None, name: str = 'TBD', authors: List[str] = [], abstract: str = '', species: str = 'human', study_type: int = 7, chunk_size: int = 104857600)[source]

Submit one or multiple data folders.

Parameters:
group_idstr

ID of the group to submit the data to.

batch_infoList[dict]

File path and batch name information

Example:
For DSP format:
[{

‘name’: ‘data_1’,

‘matrix’: ‘local_path/data_1/matrix.xlsx’,

‘image’: ‘local_path/data_1/image.ome.tiff’,

}, {…}]

For Visium format:
[{

‘name’: ‘data_1’,

‘matrix’: ‘local_path/data_1/matrix.h5’,

‘image’: ‘local_path/data_1/image.tiff’

‘position’: ‘local_path/data_1/tissue_positions_list.csv’

‘scale’: ‘local_path/data_1/scalefactors_json.json’

}, {…}]

For Visium RDS format:
[{

‘matrix’: ‘local_path/GSE128223_1.rds’

}, {…}]

For Visium Anndata format:
[{

‘matrix’: ‘local_path/GSE128223_1.h5ad’

}, {…}]

study_idstr, optional

Will be the displaying name of study (eg: VISIUM_PBMC). Default: uuidv4

namestr, optional

Name of the study. Default: ‘TBD’

authorsList[str], optional

Authors of the study. Default: []

abstractstr, optional

Abstract of the study. Default: ‘’

speciesbioturing_connector.typing.Species, optional

Species of the study. Default: ‘human’.

Support:

bioturing_connector.typing.Species.HUMAN.value

bioturing_connector.typing.Species.MOUSE.value

bioturing_connector.typing.Species.NON_HUMAN_PRIMATE.value

bioturing_connector.typing.Species.OTHERS.value

study_typebioturing_connector.typing.StudyType, optional

Format of the study. Default: bioturing_connector.typing.StudyType.DSP.value

Support:

bioturing_connector.typing.StudyType.DSP.value

bioturing_connector.typing.StudyType.VISIUM.value

bioturing_connector.typing.StudyType.VISIUM_RDS.value

bioturing_connector.typing.StudyType.VISIUM_ANN.value

chunk_sizebioturing_connector.typing.ChunkSize, optional

Size of each separated chunk for uploading. Default: 104857600

Support:

bioturing_connector.typing.ChunkSize.CHUNK_5_MB.value

bioturing_connector.typing.ChunkSize.CHUNK_100_MB.value

bioturing_connector.typing.ChunkSize.CHUNK_500_MB.value

bioturing_connector.typing.ChunkSize.CHUNK_1_GB.value

Returns:
Submission statusbool | str

True or Error log

submit_study_from_s3(group_id: str, s3_id: str | None = None, batch_info: List[dict] = [], study_id: str | None = None, name: str = 'TBD', authors: List[str] = [], abstract: str = '', species: str = 'human', study_type: int = 7)[source]

Submit one or multiple data folders.

Parameters:
group_idstr

ID of the group to submit the data to.

s3_idstr, Optional

ID of s3 bucket. Default: None

If s3_id is not provided, we will use the first s3 bucket configured on the platform.

batch_infoList[dict]

File path and batch name information, the path DOES NOT include the bucket path!

Example:
For DSP format:
[{

‘matrix’: ‘s3_path/data_1/matrix.xlsx’,

‘image’: ‘s3_path/data_1/image.ome.tiff’,

}, {…}]

For Visium format:
[{

‘matrix’: ‘s3_path/data_1/matrix.h5’,

‘image’: ‘s3_path/data_1/image.tiff’

‘position’: ‘s3_path/data_1/tissue_positions_list.csv’

‘scale’: ‘s3_path/data_1/scalefactors_json.json’

}, {…}]

For Visium RDS format:
[{

‘matrix’: ‘s3_path/GSE128223_1.rds’

}, {…}]

For Visium Anndata format:
[{

‘matrix’: ‘s3_path/GSE128223_1.h5ad’

}, {…}]

study_idstr, optional

Will be name of study (eg: VISIUM_PBMC). Default: uuidv4

namestr, optional

Name of the study. Default: ‘TBD’

authorsList[str], optional

Authors of the study. Default: []

abstractstr, optional

Abstract of the study. Default: ‘’

speciesbioturing_connector.typing.Species, optional

Species of the study. Default: ‘human’.

Support:

bioturing_connector.typing.Species.HUMAN.value

bioturing_connector.typing.Species.MOUSE.value

bioturing_connector.typing.Species.NON_HUMAN_PRIMATE.value

bioturing_connector.typing.Species.OTHERS.value

study_typebioturing_connector.typing.StudyType, optional

Format of the study. Default: bioturing_connector.typing.StudyType.DSP.value

Support:

bioturing_connector.typing.StudyType.DSP.value

bioturing_connector.typing.StudyType.VISIUM.value

bioturing_connector.typing.StudyType.VISIUM_RDS.value

bioturing_connector.typing.StudyType.VISIUM_ANN.value

Returns:
Submission statusbool | str

True or Error log

submit_study_from_shared_s3(group_id: str, shared_s3_id: str, batch_info: List[dict] = [], study_id: str | None = None, name: str = 'TBD', authors: List[str] = [], abstract: str = '', species: str = 'human', study_type: int = 7)[source]

Submit one or multiple data folders.

Parameters:
group_idstr

ID of the group to submit the data to.

shared_s3_idstr

ID of s3 bucket.

batch_infoList[dict]

File path and batch name information, the path DOES NOT include the bucket path!

Example:
For DSP format:
[{

‘matrix’: ‘s3_path/data_1/matrix.xlsx’,

‘image’: ‘s3_path/data_1/image.ome.tiff’,

}, {…}]

For Visium format:
[{

‘matrix’: ‘s3_path/data_1/matrix.h5’,

‘image’: ‘s3_path/data_1/image.tiff’

‘position’: ‘s3_path/data_1/tissue_positions_list.csv’

‘scale’: ‘s3_path/data_1/scalefactors_json.json’

}, {…}]

For Visium RDS format:
[{

‘matrix’: ‘s3_path/GSE128223_1.rds’

}, {…}]

For Visium Anndata format:
[{

‘matrix’: ‘s3_path/GSE128223_1.h5ad’

}, {…}]

study_idstr, optional

Will be name of study (eg: VISIUM_PBMC). Default: uuidv4

namestr, optional

Name of the study. Default: ‘TBD’

authorsList[str], optional

Authors of the study. Default: []

abstractstr, optional

Abstract of the study. Default: ‘’

speciesbioturing_connector.typing.Species, optional

Species of the study. Default: ‘human’.

Support:

bioturing_connector.typing.Species.HUMAN.value

bioturing_connector.typing.Species.MOUSE.value

bioturing_connector.typing.Species.NON_HUMAN_PRIMATE.value

bioturing_connector.typing.Species.OTHERS.value

study_typebioturing_connector.typing.StudyType, optional

Format of the study. Default: bioturing_connector.typing.StudyType.DSP.value

Support:

bioturing_connector.typing.StudyType.DSP.value

bioturing_connector.typing.StudyType.VISIUM.value

bioturing_connector.typing.StudyType.VISIUM_RDS.value

bioturing_connector.typing.StudyType.VISIUM_ANN.value

Returns:
Submission statusbool | str

True or Error log

test_connection()

Test the connection to the host

Returns:
connection statusstr

bioturing_connector.lens_sc_connector module

Python package for submitting/getting data from Lens SC

class bioturing_connector.lens_sc_connector.LensSCConnector(host: str, token: str, ssl: bool = True)[source]

Bases: Connector

Create a connector object to submit/get data from BioTuring Lens Single-cell (Xenium/Cosmx/Vizgen/Proteomics)

Parameters:
hoststr

The URL of the LENS SC server, only support HTTPS connection

Example:

https://talk2data.bioturing.com/lens_sc/

tokenstr

The API token to verify authority. Generated in-app.

Methods

assign_standardized_meta(species, group_id, ...)

Assign metadata value to a standardized term on ontologies tree

get_all_studies_info_in_group(species, group_id)

Get info of all studies within group.

get_barcodes(species, study_id)

Get barcodes of a study.

get_features(species, study_id)

Get features of a study.

get_metadata(species, study_id)

Get full metadata of a study.

get_ontologies_tree(species, group_id)

Get standardized ontologies tree

get_shared_s3_of_group(group_id)

Get all available groups of current token

get_user_groups()

Get all available groups of current token

get_user_s3()

Get all available groups of current token

list_all_custom_embeddings(species, study_id)

List all custom embeddings of a study

query_genes(species, study_id, gene_names[, ...])

Query genes expression of a study.

retrieve_custom_embedding(species, study_id, ...)

Retrieve an embedding array of a study

submit_metadata_from_dataframe(species, ...)

Submit metadata dataframe directly to a study

submit_metadata_from_local(species, ...)

Submit metadata to a study with local path

submit_metadata_from_s3(species, study_id, ...)

Submit metadata to a study with s3 path

submit_metadata_from_shared_s3(species, ...)

Submit metadata to a study with s3 path

submit_study_from_local_lens_sc(group_id, ...)

Submit multiple single cell - spatial folders.

submit_study_from_local_proteomics(group_id, ...)

Submit one Proteomics image.

submit_study_from_s3_lens_sc(group_id[, ...])

Submit multiple single cell - spatial folders.

submit_study_from_s3_proteomics(group_id[, ...])

Submit one Proteomics image.

submit_study_from_shared_s3_lens_sc(...[, ...])

Submit multiple single cell - spatial folders.

submit_study_from_shared_s3_proteomics(group_id)

Submit one Proteomics image.

test_connection()

Test the connection to the host

upload_chunk(file_names, files, chunk_size)

meta private:

assign_standardized_meta(species, group_id, study_id, metadata_field, metadata_value, root_name, leaf_name)

Assign metadata value to a standardized term on ontologies tree

Parameters:
speciesbioturing_connector.typing.Species

Species of the study.

Support:

bioturing_connector.typing.Species.HUMAN.value

bioturing_connector.typing.Species.MOUSE.value

bioturing_connector.typing.Species.PRIMATE.value

bioturing_connector.typing.Species.OTHERS.value

group_idstr

ID of the group to submit the data to.

study_idstr

ID of the study (uuid)

metadata_fieldstr

~ column name of meta dataframe in platform (eg: author’s tissue)

metadata_valuestr

~ metadata value within the metadata field (eg: normal lung)

root_namestr

name of root in btr ontologies tree (eg: tissue)

leaf_namestr

name of leaf in btr ontologies tree (eg: lung)

Returns:
Submission statusbool | str

True or Error log

get_all_studies_info_in_group(species: str, group_id: str)

Get info of all studies within group.

Parameters:
speciesbioturing_connector.typing.Species.typing.Species

Species of the study.

Support:

bioturing_connector.typing.Species.HUMAN.value

bioturing_connector.typing.Species.MOUSE.value

bioturing_connector.typing.Species.PRIMATE.value

bioturing_connector.typing.Species.OTHERS.value

group_idstr,

Group hash id (uuid)

Returns:
List of studies’ infoList[dict]
In which:

‘uuid’: the uuid of study, which will be used in further steps,

‘study_hash_id’: the displaying id of study on platform,

‘created_by’: email of person who submitted the study,

get_barcodes(species: str, study_id: str)

Get barcodes of a study.

Parameters:
speciesbioturing_connector.typing.Species,

Species of the study.

Support:

bioturing_connector.typing.Species.HUMAN.value

bioturing_connector.typing.Species.MOUSE.value

bioturing_connector.typing.Species.PRIMATE.value

bioturing_connector.typing.Species.OTHERS.value

study_idstr,

uuidv4 of study

Returns:
barcodesList[]
get_features(species: str, study_id: str)

Get features of a study.

Parameters:
speciesbioturing_connector.typing.Species,

Species of the study.

Support:

bioturing_connector.typing.Species.HUMAN.value

bioturing_connector.typing.Species.MOUSE.value

bioturing_connector.typing.Species.PRIMATE.value

bioturing_connector.typing.Species.OTHERS.value

study_idstr,

uuidv4 of study

Returns:
FeaturesList[]
get_metadata(species: str, study_id: str)

Get full metadata of a study.

Parameters:
speciesbioturing_connector.typing.Species,

Species of the study.

Support:

bioturing_connector.typing.Species.HUMAN.value

bioturing_connector.typing.Species.MOUSE.value

bioturing_connector.typing.Species.PRIMATE.value

bioturing_connector.typing.Species.OTHERS.value

study_idstr,

uuidv4 of study

Returns:
Metadatapd.DataFrame
get_ontologies_tree(species, group_id)

Get standardized ontologies tree

Parameters:
speciesbioturing_connector.typing.Species,

Species of the study.

Support:

bioturing_connector.typing.Species.HUMAN.value

bioturing_connector.typing.Species.MOUSE.value

bioturing_connector.typing.Species.PRIMATE.value

bioturing_connector.typing.Species.OTHERS.value

group_idstr

ID of the group.

Returns:
Ontologies treeDict[Dict]
In which:

‘name’: name of the node, which will be used in further steps

get_shared_s3_of_group(group_id: str)

Get all available groups of current token

Parameters:
group_idstr,

Group hash id (uuid)

Returns:
List of s3 bucket’ infoList[dict]
In which:

‘id’: uuid of the s3 bucket, which will be used in further steps,

‘bucket’: bucket of s3,

‘prefix’: prefix of s3,

( s3_path = s3://[bucket]/[prefix]/ )

get_user_groups()

Get all available groups of current token

Returns:
List of groups’ infoList[dict]
In which:

‘group_id’: uuid of the group, which will be used in further steps,

‘group_name’: displaying name of the group

get_user_s3()

Get all available groups of current token

Returns:
List of s3 bucket’ infoList[dict]
In which:

‘id’: uuid of the s3 bucket, which will be used in further steps,

‘bucket’: bucket of s3,

‘prefix’: prefix of s3,

( s3_path = s3://[bucket]/[prefix]/ )

list_all_custom_embeddings(species: str, study_id: str)

List all custom embeddings of a study

Parameters:
speciesbioturing_connector.typing.Species,

Species of the study.

Support:

bioturing_connector.typing.Species.HUMAN.value

bioturing_connector.typing.Species.MOUSE.value

bioturing_connector.typing.Species.PRIMATE.value

bioturing_connector.typing.Species.OTHERS.value

study_idstr,

uuidv4 of study

Returns:
List of embeddings’ infoList[dict]
In which:

‘embedding_id’: the uuid used in further steps

‘embedding_name’: displaying name on platform

query_genes(species: str, study_id: str, gene_names: List[str], unit: str = 'raw')

Query genes expression of a study.

Parameters:
speciesbioturing_connector.typing.Species,

Species of the study.

Support:

bioturing_connector.typing.Species.HUMAN.value

bioturing_connector.typing.Species.MOUSE.value

bioturing_connector.typing.Species.PRIMATE.value

bioturing_connector.typing.Species.OTHERS.value

study_idstr,

uuidv4 of study

gene_namesList[str]

Querying gene names.

If gene_names=[], full matrix will be returned

unitbioturing_connector.typing.StudyUnit. Default ‘raw’

Expression unit

Support:

bioturing_connector.typing.StudyUnit.UNIT_LOGNORM.value

bioturing_connector.typing.StudyUnit.UNIT_RAW.value

Returns:
expression_matrixcsc_matrix

Expression matrix, shape=(n_cells, n_genes)

retrieve_custom_embedding(species: str, study_id: str, embedding_id: str)

Retrieve an embedding array of a study

Parameters:
speciesbioturing_connector.typing.Species,

Species of the study.

Support:

bioturing_connector.typing.Species.HUMAN.value

bioturing_connector.typing.Species.MOUSE.value

bioturing_connector.typing.Species.PRIMATE.value

bioturing_connector.typing.Species.OTHERS.value

study_idstr,

uuidv4 of study

embedding_idstr,

Embedding id (uuid)

Returns:
embedding_arrnp.ndarray with shape (n_cells x n_dims)
submit_metadata_from_dataframe(species: str, study_id: str, group_id: str, df: DataFrame)

Submit metadata dataframe directly to a study

Parameters:
speciesbioturing_connector.typing.Species,

Species of the study.

Support:

bioturing_connector.typing.Species.HUMAN.value

bioturing_connector.typing.Species.MOUSE.value

bioturing_connector.typing.Species.PRIMATE.value

bioturing_connector.typing.Species.OTHERS.value

study_idstr,

uuidv4 of study

group_idstr,

ID of the group containing study id

dfpandas DataFrame,

Barcodes must be in df.index!!!!

Returns:
Submission statusbool | str

True or Error log

submit_metadata_from_local(species: str, study_id: str, group_id: str, file_path: str)

Submit metadata to a study with local path

Parameters:
speciesbioturing_connector.typing.Species,

Species of the study.

Support:

bioturing_connector.typing.Species.HUMAN.value

bioturing_connector.typing.Species.MOUSE.value

bioturing_connector.typing.Species.PRIMATE.value

bioturing_connector.typing.Species.OTHERS.value

study_idstr,

uuidv4 of study

group_idstr,

ID of the group containing study id

file_pathlocal path leading to metadata file,

Barcodes must be in the first column

File suffix must be in .tsv/.csv

Returns:
Submission statusbool | str

True or Error log

submit_metadata_from_s3(species: str, study_id: str, group_id: str, file_path: str, s3_id: str | None = None)

Submit metadata to a study with s3 path

Parameters:
speciesbioturing_connector.typing.Species,

Species of the study.

Support:

bioturing_connector.typing.Species.HUMAN.value

bioturing_connector.typing.Species.MOUSE.value

bioturing_connector.typing.Species.PRIMATE.value

bioturing_connector.typing.Species.OTHERS.value

study_idstr,

uuidv4 of study

group_idstr,

ID of the group containing study id

file_pathstr,

Path in s3 bucket leading to metadata file,

Notes:

Barcodes must be in the fist column

File suffix must be in .tsv/.csv

File_path DOES NOT contain s3_bucket path configured on the platform
E.g:

realpath: ‘s3://bucket/folder/metadata.tsv’

inputpath: ‘folder/metadata.tsv’

s3_idstr, Optional

ID of s3 bucket. Default: None

If s3_id is not provided, we will use the first s3 bucket configured on the platform.

Returns:
Submission statusbool | str

True or Error log

submit_metadata_from_shared_s3(species: str, study_id: str, group_id: str, file_path: str, shared_s3_id: str | None = None)

Submit metadata to a study with s3 path

Parameters:
speciesbioturing_connector.typing.Species,

Species of the study.

Support:

bioturing_connector.typing.Species.HUMAN.value

bioturing_connector.typing.Species.MOUSE.value

bioturing_connector.typing.Species.PRIMATE.value

bioturing_connector.typing.Species.OTHERS.value

study_idstr,

uuidv4 of study

group_idstr,

ID of the group containing study id

file_pathstr,

Path in s3 bucket leading to metadata file,

Notes:

Barcodes must be in the fist column

File suffix must be in .tsv/.csv

File_path DOES NOT contain s3_bucket path configured on the platform
E.g:

realpath: ‘s3://bucket/prefix/metadata.tsv’

inputpath: ‘prefix/metadata.tsv’

shared_s3_idstr

ID of shared s3 bucket

Returns:
Submission statusbool | str

True or Error log

submit_study_from_local_lens_sc(group_id: str, batch_info: List[dict], study_id: str | None = None, name: str = 'TBD', authors: List[str] = [], abstract: str = '', species: str = 'human', study_type: int = 11, min_counts: int | None = None, min_genes: int | None = None, max_counts: int | None = None, max_genes: int | None = None, neg_controls_percentage: int | float | None = None, chunk_size: int = 104857600)[source]

Submit multiple single cell - spatial folders.

Parameters:
group_idstr

ID of the group to submit the data to.

batch_infoList[dict]

File path and batch name information

Example:
[{

‘name’: ‘dataset_1’,

‘folder’: ‘server_path/dataset_folder_1’,

}, {…}]

study_idstr, optional

Will be the displaying name of study (eg: COSMX_BRAIN). Default: uuidv4

namestr, optional

Name of the study. Default: ‘TBD’

authorsList[str], optional

Authors of the study. Default: []

abstractstr, optional

Abstract of the study. Default: ‘’

speciesbioturing_connector.typing.Species, optional

Species of the study. Default: ‘human’.

Support:

bioturing_connector.typing.Species.HUMAN.value

bioturing_connector.typing.Species.MOUSE.value

bioturing_connector.typing.Species.PRIMATE.value

bioturing_connector.typing.Species.OTHERS.value

study_typebioturing_connector.typing.StudyType, optional

Format of the study. Default: bioturing_connector.typing.StudyType.XENIUM.value

Support:

bioturing_connector.typing.StudyType.VIZGEN.value

bioturing_connector.typing.StudyType.COSMX.value

bioturing_connector.typing.StudyType.XENIUM.value

min_countsint, optional

Minimum number of counts required for a cell to pass filtering. Default: 0

min_genesint, optional

Minimum number of genes expressed required for a cell to pass filtering. Default: 0

max_countsint, optional

Maximum number of counts required for a cell to pass filtering. Default: inf

max_genesint, optional

Maximum number of genes expressed required for a cell to pass filtering. Default: inf

neg_controls_percentageint, optional

Maximum number of control/negative genes percentage required for a cell to pass filtering. Default: 100

Ranging from 0 to 100

chunk_sizebioturing_connector.typing.ChunkSize, optional

Size of each separated chunk for uploading. Default: 104857600

Support:

bioturing_connector.typing.ChunkSize.CHUNK_5_MB.value bioturing_connector.typing.ChunkSize.CHUNK_100_MB.value bioturing_connector.typing.ChunkSize.CHUNK_500_MB.value bioturing_connector.typing.ChunkSize.CHUNK_1_GB.value

Returns:
Submission statusbool | str

True or Error log

submit_study_from_local_proteomics(group_id: str, batch_info: dict, study_id: str | None = None, name: str = 'TBD', authors: List[str] = [], abstract: str = '', species: str = 'human', min_counts: int | None = None, min_genes: int | None = None, max_counts: int | None = None, max_genes: int | None = None, chunk_size: int = 104857600)[source]

Submit one Proteomics image.

Parameters:
group_idstr

ID of the group to submit the data to.

batch_infoList[]

File path and batch name information

Example:
{

‘image’: ‘server_path/image.ome.tiff’

}

study_idstr, optional

Will be the displaying name of study (eg: CODEX_BRAIN). Default: uuidv4

namestr, optional

Name of the study. Default: ‘TBD’

authorsList[str], optional

Authors of the study. Default: []

abstractstr, optional

Abstract of the study. Default: ‘’

speciesbioturing_connector.typing.Species, optional

Species of the study. Default: ‘human’

Support:

bioturing_connector.typing.Species.HUMAN.value

bioturing_connector.typing.Species.MOUSE.value

bioturing_connector.typing.Species.PRIMATE.value

bioturing_connector.typing.Species.OTHERS.value

min_countsint, optional

Minimum number of counts required for a cell to pass filtering. Default: 0

min_genesint, optional

Minimum number of genes expressed required for a cell to pass filtering. Default: 0

max_countsint, optional

Maximum number of counts required for a cell to pass filtering. Default: inf

max_genesint, optional

Maximum number of genes expressed required for a cell to pass filtering. Default: inf

chunk_sizebioturing_connector.typing.ChunkSize, optional

Size of each separated chunk for uploading. Default: 104857600.

Support:

bioturing_connector.typing.ChunkSize.CHUNK_5_MB.value

bioturing_connector.typing.ChunkSize.CHUNK_100_MB.value

bioturing_connector.typing.ChunkSize.CHUNK_500_MB.value

bioturing_connector.typing.ChunkSize.CHUNK_1_GB.value

Returns:
Submission statusbool | str

True or Error log

submit_study_from_s3_lens_sc(group_id: str, s3_id: str | None = None, batch_info: List[dict] = [], study_id: str | None = None, name: str = 'TBD', authors: List[str] = [], abstract: str = '', species: str = 'human', study_type: int = 11, min_counts: int | None = None, min_genes: int | None = None, max_counts: int | None = None, max_genes: int | None = None, neg_controls_percentage: int | float | None = None)[source]

Submit multiple single cell - spatial folders.

Parameters:
group_idstr

ID of the group to submit the data to.

s3_idstr, Optional

ID of s3 bucket. Default: None

If s3_id is not provided, we will use the first s3 bucket configured on the platform.

batch_infoList[dict]

File path and batch name information, the path DOES NOT include the bucket path configured on platform!

Example:
[{

‘name’: ‘study_1’,

‘folder’: ‘s3_path/study_folder’,

}, {…}]

study_idstr, optional

Will be the displaying name of study (eg: COSMX_BRAIN). Default: uuidv4

namestr, optional

Name of the study. Default: ‘TBD’

authorsList[str], optional

Authors of the study. Default: []

abstractstr, optional

Abstract of the study. Default: ‘’

speciesbioturing_connector.typing.Species, optional

Species of the study. Default: ‘human’.

Support:

bioturing_connector.typing.Species.HUMAN.value

bioturing_connector.typing.Species.MOUSE.value

bioturing_connector.typing.Species.PRIMATE.value

bioturing_connector.typing.Species.OTHERS.value

study_typebioturing_connector.typing.StudyType, optional

Format of the study. Default: bioturing_connector.typing.StudyType.XENIUM.value.

Support:

bioturing_connector.typing.StudyType.VIZGEN.value

bioturing_connector.typing.StudyType.COSMX.value

bioturing_connector.typing.StudyType.XENIUM.value

min_countsint, optional

Minimum number of counts required for a cell to pass filtering. Default: 0

min_genesint, optional

Minimum number of genes expressed required for a cell to pass filtering. Default: 0

max_countsint, optional

Maximum number of counts required for a cell to pass filtering. Default: inf

max_genesint, optional

Maximum number of genes expressed required for a cell to pass filtering. Default: inf

neg_controls_percentageint, optional

Maximum number of control/negative genes percentage required for a cell to pass filtering. Default: 100

Ranging from 0 to 100

Returns:
Submission statusbool | str

True or Error log

submit_study_from_s3_proteomics(group_id: str, s3_id: str | None = None, batch_info: dict = {}, study_id: str | None = None, name: str = 'TBD', authors: List[str] = [], abstract: str = '', species: str = 'human', min_counts: int | None = None, min_genes: int | None = None, max_counts: int | None = None, max_genes: int | None = None)[source]

Submit one Proteomics image.

Parameters:
group_idstr

ID of the group to submit the data to.

s3_idstr, Optional

ID of s3 bucket. Default: None

If s3_id is not provided, we will use the first s3 bucket configured on the platform.

batch_infoDict[]

File path and batch name information, the path DOES NOT included the bucket path!

Example:
{

‘image’: ‘s3_path/image.ome.tiff’

}

study_idstr, optional

Will be the displaying name of study (eg: CODEX_BRAIN). Default: uuidv4

namestr, optional

Name of the study. Default: ‘TBD’

authorsList[str], optional

Authors of the study. Default: []

abstractstr, optional

Abstract of the study. Default: ‘’

speciesbioturing_connector.typing.Species, optional

Species of the study. Default: ‘human’.

Support:

bioturing_connector.typing.Species.HUMAN.value

bioturing_connector.typing.Species.MOUSE.value

bioturing_connector.typing.Species.PRIMATE.value

bioturing_connector.typing.Species.OTHERS.value

min_countsint, optional

Minimum number of counts required for a cell to pass filtering. Default: 0

min_genesint, optional

Minimum number of genes expressed required for a cell to pass filtering. Default: 0

max_countsint, optional

Maximum number of counts required for a cell to pass filtering. Default: inf

max_genesint, optional

Maximum number of genes expressed required for a cell to pass filtering. Default: inf

Returns:
Submission statusbool | str

True or Error log

submit_study_from_shared_s3_lens_sc(group_id: str, shared_s3_id: str, batch_info: List[dict] = [], study_id: str | None = None, name: str = 'TBD', authors: List[str] = [], abstract: str = '', species: str = 'human', study_type: int = 11, min_counts: int | None = None, min_genes: int | None = None, max_counts: int | None = None, max_genes: int | None = None, neg_controls_percentage: int | float | None = None)[source]

Submit multiple single cell - spatial folders.

Parameters:
group_idstr

ID of the group to submit the data to.

shared_s3_idstr

ID of s3 bucket.

batch_infoList[dict]

File path and batch name information, the path DOES NOT include the bucket path configured on platform!

Example:
[{

‘name’: ‘study_1’,

‘folder’: ‘s3_path/study_folder’,

}, {…}]

study_idstr, optional

Will be the displaying name of study (eg: COSMX_BRAIN). Default: uuidv4

namestr, optional

Name of the study. Default: ‘TBD’

authorsList[str], optional

Authors of the study. Default: []

abstractstr, optional

Abstract of the study. Default: ‘’

speciesbioturing_connector.typing.Species, optional

Species of the study. Default: ‘human’.

Support:

bioturing_connector.typing.Species.HUMAN.value

bioturing_connector.typing.Species.MOUSE.value

bioturing_connector.typing.Species.PRIMATE.value

bioturing_connector.typing.Species.OTHERS.value

study_typebioturing_connector.typing.StudyType, optional

Format of the study. Default: bioturing_connector.typing.StudyType.XENIUM.value.

Support:

bioturing_connector.typing.StudyType.VIZGEN.value

bioturing_connector.typing.StudyType.COSMX.value

bioturing_connector.typing.StudyType.XENIUM.value

min_countsint, optional

Minimum number of counts required for a cell to pass filtering. Default: 0

min_genesint, optional

Minimum number of genes expressed required for a cell to pass filtering. Default: 0

max_countsint, optional

Maximum number of counts required for a cell to pass filtering. Default: inf

max_genesint, optional

Maximum number of genes expressed required for a cell to pass filtering. Default: inf

neg_controls_percentageint, optional

Maximum number of control/negative genes percentage required for a cell to pass filtering. Default: 100

Ranging from 0 to 100

Returns:
Submission statusbool | str

True or Error log

submit_study_from_shared_s3_proteomics(group_id: str, shared_s3_id: str | None = None, batch_info: dict = {}, study_id: str | None = None, name: str = 'TBD', authors: List[str] = [], abstract: str = '', species: str = 'human', min_counts: int | None = None, min_genes: int | None = None, max_counts: int | None = None, max_genes: int | None = None)[source]

Submit one Proteomics image.

Parameters:
group_idstr

ID of the group to submit the data to.

shared_s3_idstr, Optional

ID of s3 bucket

batch_infoDict[]

File path and batch name information, the path DOES NOT included the bucket path!

Example:
{

‘image’: ‘s3_path/image.ome.tiff’

}

study_idstr, optional

Will be the displaying name of study (eg: CODEX_BRAIN). Default: uuidv4

namestr, optional

Name of the study. Default: ‘TBD’

authorsList[str], optional

Authors of the study. Default: []

abstractstr, optional

Abstract of the study. Default: ‘’

speciesbioturing_connector.typing.Species, optional

Species of the study. Default: ‘human’.

Support:

bioturing_connector.typing.Species.HUMAN.value

bioturing_connector.typing.Species.MOUSE.value

bioturing_connector.typing.Species.PRIMATE.value

bioturing_connector.typing.Species.OTHERS.value

min_countsint, optional

Minimum number of counts required for a cell to pass filtering. Default: 0

min_genesint, optional

Minimum number of genes expressed required for a cell to pass filtering. Default: 0

max_countsint, optional

Maximum number of counts required for a cell to pass filtering. Default: inf

max_genesint, optional

Maximum number of genes expressed required for a cell to pass filtering. Default: inf

Returns:
Submission statusbool | str

True or Error log

test_connection()

Test the connection to the host

Returns:
connection statusstr