NETMAP Documentation¶
NETMAP infers single-cell gene regulatory networks (GRNs) using explainable AI. An ensemble of count-distribution autoencoders is trained on scRNA-seq data, then Captum attribution methods score directed gene–gene influences per cell. The full attribution matrix (cells × genes²) is stored as an AnnData object.
Pipeline overview¶
Model training —
netmap.modeltrains an ensemble ofZINBAutoencoderorNegativeBinomialAutoencodermodels with early stopping viacreate_model_zoo().GRN inference —
inferrence()applies Captum attribution (GradientShap, GuidedBackprop, or Deconvolution) across all model–target combinations and writes Parquet-backed output.Masking —
netmap.maskingannotates edges with co-expression support (internal) and external reference GRN overlap (external).Downstream —
netmap.downstreamclusters the GRN, ranks edges, builds signed regulons, and produces interactive network visualisations.
Installation¶
# Recommended — includes GPU deps (PyTorch, CuPy), CUDA 12.8, linux-64 only
pixi run install-kernel
# pip — GPU dependencies must be added manually
pip install -e .
Tutorials
API Reference
- API Reference
- netmap.model
- netmap.grn
- netmap.grn.inferrence
- netmap.grn.inferrence.aggregate_attributions
- netmap.grn.inferrence.attribution_one_model
- netmap.grn.inferrence.attribution_one_target
- netmap.grn.inferrence.inferrence
- netmap.grn.inferrence.inferrence_h5py
- netmap.grn.inferrence.inferrence_model_wise
- netmap.grn.inferrence.inferrence_model_wise_level
- netmap.grn.inferrence.return_grn_adata_to_memory
- netmap.grn.inferrence.shuffle_each_column_independently
- netmap.grn.inferrence
- netmap.masking
- netmap.masking.external
- netmap.masking.internal
- netmap.masking.internal.add_cluster_based_candidate_edges
- netmap.masking.internal.add_cluster_wise_spearman
- netmap.masking.internal.add_neighbourhood_expression_mask
- netmap.masking.internal.binarize_adata
- netmap.masking.internal.create_pairwise_binary_mask
- netmap.masking.internal.find_consistent_pairs
- netmap.masking.internal.get_neighborhood_expression
- netmap.downstream.clustering
- netmap.downstream.edge_selection
- netmap.downstream.gene_clustering
- netmap.downstream.markers
- netmap.downstream.regulon
- netmap.downstream.regulon.aggregate_edges
- netmap.downstream.regulon.aggregate_edges_arbitrary
- netmap.downstream.regulon.compute_signatures_UCell_scores
- netmap.downstream.regulon.get_overlapping_signatures
- netmap.downstream.regulon.get_sourcewise_jaccard_regulons
- netmap.downstream.regulon.jaccard_similarity
- netmap.downstream.regulon.load_edge_dict_from_dataframe
- netmap.downstream.regulon.make_cluster_regulon_dataframe
- netmap.downstream.regulon.make_cluster_regulon_dataframe_directional
- netmap.downstream.regulon.make_global_target_similarity_plot
- netmap.downstream.regulon.process_cell_edges
- netmap.downstream.regulon.process_cell_edges_signed
- netmap.downstream.regulon.select_top_edges
- netmap.downstream.regulon.select_top_edges_signed
- netmap.utils
- netmap.utils.data_utils
- netmap.utils.data_utils.attribution_to_anndata
- netmap.utils.data_utils.create_output_directory
- netmap.utils.data_utils.merge_all_to_obs
- netmap.utils.data_utils.remove_Ucell_columns
- netmap.utils.data_utils.remove_regulon_columns
- netmap.utils.data_utils.retrieve_edges_by_index
- netmap.utils.data_utils.retrieve_top_edges
- netmap.utils.data_utils.save_anndata
- netmap.utils.misc
- netmap.utils.netmap_config
- netmap.utils.tf_utils
- netmap.utils.data_utils