Skip to content

Repository files navigation

adata_science_tools

Documentation

data science tools that operate on anndata objects

Set up

clone the repo

git clone https://github.com/gitbenlewis/adata_science_tools.git

Make the conda environments

conda deactivate
conda remove -n not_base --all
conda env create -f config/env_not_base.yaml -n not_base
conda activate not_base

run the examples

conda activate not_base
bash example_PMID_33969320/scripts/000_run_everything.bash
python example_simulated_data/scripts/simulate_1_var_covar_age.py
python example_simulated_data/scripts/plot_dotplot_simulate_1_var_covar_age.py
bash scripts/000_generate_plotting_gallery.bash

Simulated data example

The repo includes a small config-driven simulated-data workflow in example_simulated_data/.

conda activate not_base
python example_simulated_data/scripts/simulate_1_var_covar_age.py
python example_simulated_data/scripts/plot_dotplot_simulate_1_var_covar_age.py

The default config in example_simulated_data/config/config.yaml simulates one feature, simulated_feature, from Age and case_control, adds residual y variance so the points are not constrained to exact fit lines, and writes both a baseline AnnData bundle and a dotplot.

The main example knobs are beta or beta_age, beta_case_control, case_control_prob, and residual_stdev.

See docs/_simulate_data.md for the simulation API and config details, and docs/_corr_dotplots.md for the plotting API.

Example outputs: baseline.h5ad and baseline.png.

baseline simulated dotplot

Paired datapoints examples

adtl.paired_datapoints() can add a third x-axis position for either the signed post-baseline difference or log2(post / baseline). The secondary y-axis is symmetric around zero in both modes.

Raw post-baseline difference

Paired datapoints with raw post-baseline differences

Opt-in legend metrics can summarize the finite post-filter values at baseline, post, and the raw pairwise post - baseline position.

Paired datapoints with raw post-baseline differences and per-position summary legend

Post-over-baseline log2 fold change

Paired datapoints with post-over-baseline log2 fold changes

The log2FC summary uses valid pairwise log2(post / baseline) values rather than a fold change calculated from the endpoint means.

Paired datapoints with post-over-baseline log2 fold changes and per-position summary legend

Some example plots from example_PMID_33969320

Column plots

/adata_science_tools/_plotting/_column_plots.py view src file

adtl.barh_l2fc_dotplot()

View plot file COVID_over_NOT_D0_barh_l2fc_dotplot

Volcano plots

adtl.volcano_plot_generic()

View plot file COVID_over_NOT_D0_barh_l2fc_dotplot

About

data science tools that operate on anndata objects

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages