def velocity_genes(data, vkey='<STR_LIT>', min_r2=<NUM_LIT>, highly_variable=None, copy=False):
adata = data.copy() if copy else data<EOL>if vkey + '<STR_LIT>' not in adata.var.keys(): velocity(data, vkey)<EOL>adata.var[vkey + '<STR_LIT>'] = np.array(adata.var[vkey + '<STR_LIT>'], dtype=bool) & (adata.var[vkey + '<STR_LIT>'] > min_r2)<EOL>if highly_variable and '<STR_LIT>' in adata.var.keys():<EOL><INDENT>adata.var[vkey + '<STR_LIT>'] &= adata.var['<STR_LIT>']<EOL><DEDENT>logg.info('<STR_LIT>', np.sum(adata.var[vkey + '<STR_LIT>']))<EOL>return adata if copy else None<EOL>
Estimates velocities in a gene-specific manner

    Arguments
    ---------
    data: :class:`~anndata.AnnData`
        Annotated data matrix.
    vkey: `str` (default: `'velocity'`)
        Name under which to refer to the computed velocities for `velocity_graph` and `velocity_embedding`.
    min_r2: `float` (default: 0.01)
        Minimum threshold for coefficient of determination
    highly_variable: `bool` (default: `None`)
        Whether to include highly variable genes only.
    copy: `bool` (default: `False`)
        Return a copy instead of writing to `adata`.

    Returns
    -------
    Updates `adata` attributes
    velocity_genes: `.var`
        genes to be used for further velocity analysis (velocity graph and embedding)