rnaglib.transforms.ResidueNameFilter

class rnaglib.transforms.ResidueNameFilter(value_checker=None, min_valid=1, **kwargs)[source]

Filter RNAs based on their residuess’ names.

This filter keeps only the RNAs such that a minimal number of their residues’ names match a specific criterion.

Parameters:
  • value_checker (Callable) – a method taking as input an RNA residue name and returning a boolean defining the filter’s criterion on the residues’ names (default None)

  • min_valid (int) – the minimal number of residues within an RNA which have to match the above defined criterion so that the RNA is kept by the filter

__init__(value_checker=None, min_valid=1, **kwargs)[source]

Methods

__init__([value_checker, min_valid])

forward(data)

Check if the RNA's name is in the list of allowed names.