Feature Selector Numeric Parse Helper
GitHub Link to Code.
Base numeric parser helper for feature selection.
This module provides the base class for numeric category parsers (resid, seqid), implementing shared logic for range and single value parsing with configurable metadata fields.
- class mdxplain.feature_selection.helper.feature_selector_numeric_parse_helper.FeatureSelectorNumericParseHelper
Base helper class for numeric category parsing - array index and sequence ID based operations.
Provides static methods to parse numeric categories like “123”, “123-140” to identify matching feature indices based on trajectory metadata.
- static parse_numeric_category(param_parts: List[str], features_list: List[list], metadata_field: str, category_name: str) Tuple[List[int], Set[int]]
Parse numeric category and return matching feature indices plus matched residue indices. Uses configurable metadata field (e.g., residue.index or residue.seqid).
Parameters
- param_partsList[str]
List of parameter parts for numeric selection
- features_listList[list]
List of features from metadata
- metadata_fieldstr
Metadata field to use (“index” or “seqid”)
- category_namestr
Category name for error messages (“resid” or “seqid”)
Returns
- Tuple[List[int], Set[int]]
Tuple of (feature_indices, matched_residue_indices)
feature_indices: List of feature indices matching the criteria
matched_residue_indices: Set of residue.index values that matched
Raises
- ValueError
If the numeric specification is invalid