gene#

SingleCell.gene(gene, /, *, num_threads=None)[source]#

Get the column of X corresponding to a single gene, based on the gene’s name in var_names.

Parameters:
  • gene: str

    the name of the gene in var_names

  • num_threads: int | None

    the number of threads to use when retrieving the row of X. Set num_threads=-1 to use all available cores, as determined by os.cpu_count(). By default (num_threads=None), use self.num_threads cores when X is a CSR array and 1 thread when X is a CSC array. Cannot be specified when X is a CSC array, since there is no benefit to parallelism in that case.

Returns:

The corresponding column of X, as a dense 1D NumPy array with zeros included.

Return type:

ndarray