simba.pp.select_pcs

simba.pp.select_pcs(adata, n_pcs=None, S=1, curve='convex', direction='decreasing', online=False, min_elbow=None, **kwargs)[source]

select top PCs based on variance_ratio

Parameters:
  • n_pcs (int, optional (default: None)) – If n_pcs is None, the number of PCs will be automatically selected with “kneed

  • S (float, optional (default: 1)) – Sensitivity

  • min_elbow (int, optional (default: None)) – The minimum elbow location By default, it is n_components/10

  • curve (str, optional (default: ‘convex’)) – Choose from {‘convex’,’concave’} If ‘concave’, algorithm will detect knees, If ‘convex’, algorithm will detect elbows.

  • direction (str, optional (default: ‘decreasing’)) – Choose from {‘decreasing’,’increasing’}

  • online (bool, optional (default: False)) – kneed will correct old knee points if True, kneed will return first knee if False.

  • **kwargs (dict, optional) – Extra arguments to KneeLocator.

  • Returns