8000 GitHub - Thakar-Lab/scBONITA_attractor_analysis
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Thakar-Lab/scBONITA_attractor_analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Publication

Title: Oxygen-Regulated Pathways Modulate B Cell States in Health and Disease: A Pathway-Specific Discrete State Model Approach

Authors: George Kassis, Mukta G. Palshikar, Shannon P. Hilchey, Martin S. Zand, Juilee Thakar

Published in: Journal of Theoretical Biology

Year: 2023

Abstract:

Oxygen (O2) regulated pathways modulate B cell activation, migration, and proliferation during infection, vaccination, and other diseases. Modeling these pathways in health and disease is critical to understand B cell states and ways to mediate them. To characterize B cells by their activation of O2 regulated pathways, we develop pathway-specific discrete state models using previously published single-cell RNA-sequencing (scRNA-seq) datasets from isolated B cells. Specifically, Single Cell Boolean Omics Network Invariant-Time Analysis (scBONITA) was used to infer logic gates for known pathway topologies. The simplest inferred set of logic gates that maximized the number of “OR” interactions between genes was used to simulate B cell networks involved in oxygen sensing until they reached steady network states (attractors). By focusing on the attractors that best represented sequenced cells, we identified genes critical in determining pathway-specific cellular states that corresponded to diseased and healthy B cell phenotypes. Specifically, we investigate the transendothelial migration, regulation of actin cytoskeleton, HIF1A, and Citrate Cycle pathways. Our analysis revealed attractors that resembled the state of B cell exhaustion in HIV+ patients as well as attractors that promoted anaerobic metabolism, angiogenesis, and tumorigenesis in breast cancer patients, but which were eliminated after neoadjuvant chemotherapy (NACT). Finally, we investigated the attractors to which the Azimuth-annotated B cells mapped and found that attractors resembling B cells from HIV+ patients encompassed a significantly larger number of atypical memory B cells than HIV- attractors. Meanwhile, attractors resembling B cells from breast cancer patients post NACT encompassed a reduced number of atypical memory B cells compared to pre-NACT attractors.

Usage Steps

Step 1: Importing attractors mapped to cells and their counts

** Function: Import_Attractors_Mapped_To_By_Cells_And_Their_Counts **

This function imports attractors mapped to cells and their counts. It processes data files generated by scBONITA for a given dataset-signaling pathway pair. It extracts attractors, counts of cells mapping to each attractor, and distance data.

** Parameters: **

  • addresses_to_datasets_files: List of file addresses containing attractors and cell distances for different datasets and signaling pathways.
  • pathways_ids: List of signaling pathway IDs to analyze for the given datasets.
  • datasets_labels: Labels used for identifying datasets and figures.
  • networks_names: A dictionary mapping signaling pathway IDs to their corresponding names.
  • active_gene_tresh: A threshold for determining active genes (default is 1).

** Returns **

  • all_attractors_mapped_to_by_cells: A dictionary with dataset-signaling pathway pairs as keys and lists of attractors as values.
  • counts_for_attractors_mapped_to_by_cells: A dictionary with with dataset-signaling pathway pairs as keys and the values are inner dictionaries where the attractors are keys and count of cells mapping to them are values.
  • loaded_dist_dfs: A dictionary with dataset-signaling pathway pairs as keys and loaded distance dataframes as values. This is to be used by following functions.
  • datasets_addresses: A dictionary with dataset-signaling pathway pairs as keys and dataset file addresses as values.

** Example Usage **

#Address, label, and ID for files returned by scBONITA for a dataset-signaling pathway pair
addresses_to_datasets_files = ["Example_Dataset/"] #This is the address to the csv files of the distances between attractors and cells which were generated by scBONITA
pathways_ids = ["hsa04670"]
datasets_labels = ["HIV_dataset"] #used for labeling data and figures

#networks_names is a dictionary that maps each signaling pathway's ID to a name that will be used in figures
networks_names = {
    "hsa04066": "HIF-1",
    "hsa04010": "MAPK",
    "hsa04670":"Leukocyte_Transendotherlial_Migration",
    # Add more pathway mappings here...
}

# Running the function
all_attractors_mapped_to_by_cells, counts_for_attractors_mapped_to_by_cells, loaded_dist_dfs, datasets_addresses = Import_Attractors_Mapped_To_By_Cells_And_Their_Counts(addresses_to_datasets_files, pathways_ids, datasets_labels, networks_names)

Step 2: Clustering attractors

** Function: Attractors_Clustering **

This function performs agglomerative hierarchical clustering of attractors. It utilizes variables returned by the Import_Attractors_Mapped_To_By_Cells_And_Their_Counts function to cluster attractors based on their similarity.

** Parameters: **

  • all_attractors_mapped_to_by_cells: A dictionary with dataset-signaling pathway pairs as keys and lists of attractors as values.
  • distance_threshold: Specifies the threshold for merging attractors. Here it represents the percentage of nodes in the network which activation must match for two attractors to merge.
  • dendrogram_saving_pathway: The directory where generated dendrogram figures will be saved.
  • lastp_for_truncate: The p-value for truncating the dendrogram, either an integer or a string with the format "clusters_based_[multiplication_factor_of_choice]".
  • save_truncated_dendrogram: Specifies whether to save a truncated dendrogram figure (default is True).
  • save_dendrogram: Specifies whether to save a full dendrogram figure (default is True).

** Returns: **

  • set_of_clusters_per_dataset: A dictionary with dataset names as keys and values being dictionaries of cluster IDs and their respective attractors.

** Example Usage: **

# Parameters for clustering
distance_threshold = 20
save_truncated_dendrogram = True
save_dendrogram = True
lastp_for_truncate = "clusters_based_2"

# Where figures generated using the Attractors_Clustering function will be saved
dendrogram_saving_pathway = "Example_Dataset/Clustering_Output/"

# Running the function
set_of_clusters_per_dataset = Attractors_Clustering(all_attractors_mapped_to_by_cells, distance_threshold, dendrogram_saving_pathway, lastp_for_truncate, save_truncated_dendrogram, save_dendrogram)

Step 3: Merging clustered attractors

** Function: Merge_Similar_Attractors **

This function merges similar attractors within each cluster to determine representative attractors for each cluster. It utilizes the output from the Attractors_Clustering function.

** Parameters: **

  • set_of_clusters_per_dataset: A dictionary with dataset names as keys and values being dictionaries of cluster IDs and their respective attractors.
  • loaded_dist_dfs: A dictionary with dataset-signaling pathway pairs as keys and dataframes of distances between attractors and cells as values.
  • attractors_per_dtst_ntrk_saving_path: The directory where CSV files with cluster IDs and representative attractors will be saved.

** Returns: **

  • set_of_clusters_with_representative_attractors_per_dataset: A dictionary with dataset names as keys and values being dictionaries of cluster ID and its representative attractor.

** Example Usage: **

# Where figures generated using the Merge_Similar_Attractors function will be saved
attractors_per_dtst_ntrk_saving_path = "Example_Dataset/attractors_per_dtst_ntrk/"

# Running the function
set_of_clusters_with_representative_attractors_per_dataset = Merge_Similar_Attractors(set_of_clusters_per_dataset, loaded_dist_dfs, attractors_per_dtst_ntrk_saving_path)

Step 4: Creating plots

** Function: Create_Bar_Plot_And_Frequency_Plot **

This function generates box plots and bar plots mapping attractors to B cells taken from healthy or ill patients. The function creates combined plots for attractors.

** Parameters: **

  • set_of_clusters_with_representative_attractors_per_dataset: A dictionary with dataset names as keys and values being dictionaries of cluster IDs and their respective representative attractors.
  • loaded_dist_dfs: A dictionary with dataset-signaling pathway pairs as keys and dataframes of distances between attractors and cells as values.
  • plots_saving_path: The directory where generated plots will be saved.
  • csv_saving_path: The directory where generated csv files that include cell names per representative attractor wil be saved.
  • attractors_representing_clusters_indices_to_plot: A list of attractor indices to plot (empty list to plot all).
  • datasets_cells_labels: A dictionary specifying the phenotypes/source of B cells in each of the datasets.
  • restrict_attractors_plotted: A boolean value to specify if plotting should be restricted based on attractors_representing_clusters_indices_to_plot.
  • Combined_Plot: A boolean to specify whether to create a combined plot or not.
  • bar_box_plots_fig_size: A tuple specifying the size of the generated figure (width, height).

** Example Usage: **

# Attractors to plot (leave empty to plot all)
attractors_representing_clusters_indices_to_plot = []

# Should attractors be restricted based on the list above
restrict_attractors_plotted = False

# Datasets and cell labels
datasets_cells_labels = {
    "HIV_dataset": {"Label1": "Healthy", "Label2": "HIV"},
    "Lung_Cancer_dataset": {"Label1": "Normal", "Label2": "Tumor"},
    "Breast_Cancer_dataset": {"Label1": "Before", "Label2": "After"},
    "Mild_Severe_Covid_dataset": {"Label1": "Healthy", "Label2": "COVID"},
    "Severe_Covid_dataset": {"Label1": "Healthy", "Label2": "COVID"},
}

# Where figures will be saved
plots_saving_path = "Example_Dataset/Clustering_Output/"
# where csv files that include cell names per representative attractor wil be saved
csv_saving_path = "Example_Dataset/Cells_Names_Per_Attractors/"

# Running the function
Create_Bar_Plot_And_Frequency_Plot(
    set_of_clusters_with_representative_attractors_per_dataset,
    loaded_dist_dfs,
    plots_saving_path,
    csv_saving_path,
    attractors_representing_clusters_indices_to_plot,
    datasets_cells_labels,
    restrict_attractors_plotted,
    Combined_Plot=True,
    bar_box_plots_fig_size=(12, 4)
)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0