deconvatac.pp.feature_selection
===============================

.. py:module:: deconvatac.pp.feature_selection


Functions
---------

.. autoapisummary::

   deconvatac.pp.feature_selection.highly_variable_peaks
   deconvatac.pp.feature_selection.highly_accessible_peaks


Module Contents
---------------

.. py:function:: highly_variable_peaks(adata: anndata.AnnData, cluster_key: str, layer: str = None, scale: float = 1, n_top_features: int = 20000)

   Selects highly variable features the "var" way. 

   Adapted from: https://github.com/GreenleafLab/ArchR/blob/c61b0645d1482f80dcc24e25fbd915128c1b2500/R/IterativeLSI.R#L1015

   Parameters
   -----------

   adata: AnnData
       AnnData object of the (reference) scATAC data.
   cluster_key: str
       Name of column in adata.obs containing the clusters.
   layer: str 
       Layer of the raw counts. If None, uses .X
   scale: float
       Scale factor, i.e. log2((sums/feature_sums) *scale + 1).
   n_top_features: int
       How many features to select.

       
   Returns
   -------

   Saves a boolean indicator of the HVPs in place to adata.var['highly_variable'].


.. py:function:: highly_accessible_peaks(adata: anndata.AnnData, layer: str = None, n_top_features: int = 20000, copy: bool = False)

   Selects the most accessible peaks from the given AnnData object.

   Parameters
   ----------

   adata: AnnData
       Annotated data object containing the peaks.
   layer: str 
       Name of the layer to use for peak accessibility.
   n_top_features: int
       Number of top accessible peaks to select.
   copy: bool
       Whether to copy the AnnData object. 

       
   Returns
   -------

   AnnData object with the highly accessible peaks saved to adata.var['highly_accessible'].


