concat

Contents

concat#

alphagenome.data.gene_expression_data.concat(gene_expression_datas, extra_metadata_name_and_keys=None)[source]#

Concatenates multiple GeneExpressionData objects along the track dimension.

This function combines multiple GeneExpressionData objects into a single object by concatenating their values (along the track dimension) and track_metadata. The resulting GeneExpressionData object will have the same interval and gene_metadata as the input objects.

Parameters:
  • gene_expression_datas (Sequence[GeneExpressionData]) – A sequence of GeneExpressionData objects to concatenate. All objects must have the same interval and gene_metadata.

  • extra_metadata_name_and_keys (tuple[str, Sequence[str | int | float]] | None (default: None)) – An optional tuple specifying a new metadata column to add to track_metadata. The first element is the column name, and the second is a sequence of values to populate the column.

Return type:

GeneExpressionData

Returns:

A new GeneExpressionData object containing the concatenated data.

Raises:

ValueError – If gene_expression_datas is empty, or if input GeneExpressionData objects have different intervals or gene_metadatas, or if the length of extra_metadata_name_and_keys[1] does not match the length of gene_expression_datas.