Package: lXtractor
lXtractorIntroductionlXtractoris a toolbox devoted to feature extraction from macromolecular
sequences and structures.
It's tailored towards creating shareable local data collections anchored to
a reference sequence-based object: a single sequence, MSA, or an HMM model.
Currently, it doesn't define any unique algorithms, aiming at simplicity and
transparency.
It simply provides a (hopefully) convenient interface simplifying mundane tasks,
such as fetching the data, extracting domains, mapping sequences, and computing
sequential and structural variables.
Sequences and structures anchored to a single reference object have a benefit
of interpretability in downstream applications, such as fitting interpretable
ML models.InstallationlXtractorrequires python>=3.10 installed on a Unix system and is
installable via pippipinstalllXtractorWe encourage users to first create a virtual environment viacondaormamba.UsagelXtractoris designed to be flexible and its usage is defined by the initial
hypothesis or a reference object that one wants to extrapolate towards the
existing sequences or structures.
Below, we'll provide a very abstract description of what this package is
intended for.In creating data collections, one could define the following steps::Assemble the data.Map reference object to assembled entries' sequences.Filter hits.Define and calculate variables -- sequence or structure descriptors.Save the data for later usage or modifications.lXtractordefines objects and routines helpful throughout this process.
Namely,PDB,SIFTS,AlphaFold,fetch_uniprot()can aid in the first step.
Then,AlignmentandPyHMMercan facilitate step 2.
At the end of the step 2 one will get a collection ofChain*-type objects.
If working with sequence-only collections, these are going to beChainSequenceobjects.
For structure-only data, these are going to beChainStructurecontainers,
embeddingChainSequenceandGenericStructureobjects.
Finally, dealing with mappings between canonical sequence associated with
a group of structures will result inChainobjects.ChainListwrapsChain*-type objects into a list-like collection with
useful operations allowing to quickly filter and bulk-modifyChain*-type
objects.
Thus, filtering typically comes down to usingChainList.filter()method that
accepts aCallable[Chain*, bool]and returns a filteredChainList.
One can save/load the collected objects usingChainIOand proceed
with the feature extraction.lXtractordefines various sequence and structure variables.
Variable-related operations are handled byGenericCalculatorandManagerclasses. The former defines the calculation strategy and how
the calculations are parallelized, while the latter handles the calculations
and aggregates the results into a pandasDataFrame.As a result, one is left with a collection ofChain*-type objects and a
table with calculated variables. In addition, one can store the calculated
variables within the objects themselves, although we currently do not encourage
this practice.lXtractoris in the experimental stage and under active development.
Thus, objects' interfaces may change.For the time being, one can check the examples offinding sequence determinantsof tyrosine and serine-threonine kinases anda protocolto build a complete structural collection of protein kinase domains.More examples are to come in the future, so stay tuned. If you know a good example to applylXtractor, feel free to raise an issue or reach outivan.reveguk@gmail.com.