filter_genes_by_strand

filter_genes_by_strand#

GeneExpressionData.filter_genes_by_strand(strand)[source]#

Filters gene rows to those matching strand ('+', '-', or '.').

Unlike filter_to_positive_strand() / filter_to_negative_strand() which filter track columns via track_metadata['strand'], this filters rows via gene_metadata['strand'].

Parameters:

strand (str) – Gene strand to retain ('+', '-', or '.').

Return type:

GeneExpressionData

Returns:

A new GeneExpressionData object containing only matching gene rows.

Raises:

ValueError – If strand is not a valid strand option or 'strand' is missing from gene_metadata.