Package: regulAS
regulASA Bioinformatics Tool for the Integrative Analysis of Alternative Splicing Regulome using RNA-Seq data across cancer and tissue typesOverviewregulASis a computational software for analysis of regulatory mechanisms of alternative splicing enabling to
dissect complex relationships between alternative splicing events and thousands of its prospective regulatory RBPs using large-scale RNA-seq data derived
from The Cancer Genome Atlas (TCGA) and The Genotype-Tissue Expression (GTEx) projects.regulASis a powerful machine learning experiment management tool written in Python that combines
flexible configuration system based on YAML and shell, fast and reliable data storage
driven by SQLite relational database engine and an extension-friendly API compatible
withscikit-learn.regulASis designed to provide users with a "Low-Code" experiment management solution that is
dedicated for researchers of alternative splicing regulatory mechanisms to simplify computational workflow,
allowing them to alleviate the number of the prospective regulatory candidates of splicing changes for further
in-depth bioinformatics and experimental analysis.StructureregulASis supplied with a set of pre-defined modules that introduce support for data
acquisition, fitting of machine learning models, persistence and export of results.WorkflowTheregulASpackage encapsulates ETL-, ML- and report generation workflows.
ETL-workflow includes data Extraction, Transformation and Loading operations,
thus preparing the input for the next step, namely Machine Learning (ML) part.
The ML-workflow incorporates predictive modeling, hyper-parameter optimization,
performance evaluation and feature ranking tasks for identifying candidate
regulators of alternative splicing events across tumors and tissue types.
The ML-workflow outputs can subsequently be utilized for generating summary reports in
tabular and visual forms to support interpretation of the findings and knowledge sharing.Data loadingAfter the transformation step,regulASloads the data into apandas.DataFrame,
which is a default container to store intermediate results.
Given an additional argument denoting the target for supervised model training,
data loader splits theDataFrameinto samples and targets that are used by the ML-part.ConfigurationExperimental setups are configured through YAML files usingFacebook Hydraframework.Evaluation of ML-modelsThe Machine Learning sub-flow manages hyper-parameter tuning, performance evaluation
and scoring of feature relevance.
To tune hyper-parameters,regulASperforms a cross validation procedure that is similar
to thescikit-learngrid search (GridSearchCV).
The model performance evaluation requires comparison of ground truth targets to the actual predictions.
Thus, both true and predicted values are stored into a database that serves as a data source
for performance evaluation reports.
Finally,regulASdetects if a model provides information on feature importance
and intercepts this scoring putting it into a database for later analysis.Storing resultsregulAStracks and stores a wide variety of experimental data that includes:Dataset descriptionExperimental configurationActual hyper-parametersSource code for modelsTrue and predicted target valuesFeature importanceTypically, a single experiment is able to provide the management system with several hundred
thousand records, which makes storing them a non-trivial task.
To address this challenge,regulASrelies on a relational database
powered by theSQLiteengine.
The use of the SQLite database ensures data integrity and provides fast and reliable storage for it.Report generationThe report generation workflow allows assembling results and summarizing them in an appropriate
way (e.g., text- or image-based output).
Moreover, the reports can be chained such as the output of a preceding report is fed into
the next one depending on it.ConfigurationHow to use YAML configuration files and (optionally) combine them with command line arguments.A single experimental setup defines a scope namedexperimentthat encapsulates
the following sub-scopes:name– name of the experimentdataset– configuration of a data sourcesplit– cross validation parameterspipelines– list of ML-configurations to comparereports– data export configurationsUsing Facebook Hydra framework,regulASprovides the ability to override configuration
keys from the command line, to define required-in-runtime arguments (using reserved value???)
and to substitute values given a key to another field of a configuration file (${experiment.another_field}).Sample experimental setupregulASconfiguration can define model evaluation tasks only, while keeping the list
of reports empty.experiment_tasks.yamlname:lr_svr_tmrdataset:_target_:regulAS.utils.PickleLoadername:RNA-Seqmeta:some fancy descriptionpath_to_file:???objective:psisplit:_target_:sklearn.model_selection.ShuffleSplitn_splits:5test_size:0.2train_size:nullrandom_state:${random_state}pipelines:-transformations:ZScore:_target_:sklearn.preprocessing.StandardScalermodel:LinearRegression:_target_:sklearn.linear_model.ElasticNetl1_ratio:0.2_varargs_:alpha:[0.1,0.5,1.0]-transformations:MinMax:_target_:sklearn.preprocessing.MinMaxScalermodel:SupportVectorMachine:_target_:sklearn.svm.SVRkernel:linear_varargs_:C:[0.1,0.5,1.0]reports:nullSample report setupSimilarly, there can be only report tasks defined in the experimental setup.report_tasks.yamlname:lr_svr_tmrdataset:nullsplit:nullpipelines:nullreports:MSE:_target_:regulAS.reports.ModelPerformanceReportexperiment_name:${experiment.name}loss_fn:sklearn.metrics.mean_squared_errorPearsonR:_target_:regulAS.reports.ModelPerformanceReportexperiment_name:${experiment.name}score_fn:scipy.stats.pearsonrFeatureRanking:_depends_on_:["MSE"]_target_:regulAS.reports.FeatureRankingReportexperiment_name:${experiment.name}sort_by:"${experiment.reports.MSE.loss_fn}:test:mean"sort_ascending:truetop_k_models:3top_k_features:nullPerformanceCSV:_depends_on_:["MSE","PearsonR"]_target_:regulAS.reports.ExportCSVoutput_dir:reportssep:";"RankingCSV:_depends_on_:["FeatureRanking"]_target_:regulAS.reports.ExportCSVoutput_dir:reportssep:";"DatabaseDatabase structure is dedicated to reliably store experimental results and to serve
as a data source for reports based on its contents.
Schema of theregulAS' database was designed to preserve consistency and to
minimize redundancy of the stored records.
The database includes the following tables:Experiment– contains high-level summary of the experimentsData– contains details on the dataset used inExperimentPipeline– contains high-level summary on specific pipelines used inExperimentTransformation– contains details on ML-models and transformationsHyperParameter– contains hyper-parameters of modelsPrediction– contains true and predicted values for targetFeatureRanking– contains feature importance scoresTransformationSequence– contains details on the use of models and transformationsHyperParameterValue– contains details on the specific values of hyper-parametersUsageIn order to useregulASfor experimental management, user should define a project directory
containing YAML configuration files and data if necessary.
The experiment then can be run from the command line.# install regulAS package from PyPipipinstallregulAS# navigate to the user's project foldercd/path/to/the/project# run the experimental setup on different dataset filespython-mregulAS.app--multirun\experiment=experiments/experiment_tasks\+dataset.path_to_file=data/data_cNormal.pkl,data/data_cTumor.pklAfterregulASfinishes all the tasks, an SQLite database fileregulAS.dbwill be stored
in the project directory as well as the reports if any was submitted to generate.