spacr.toxo
==========

.. py:module:: spacr.toxo




Module Contents
---------------

.. py:function:: custom_volcano_plot(data_path, metadata_path, metadata_column='tagm_location', point_size=50, figsize=20, threshold=0, save_path=None, x_lim=[-0.5, 0.5], y_lims=[[0, 6], [9, 20]])

.. py:function:: go_term_enrichment_by_column(significant_df, metadata_path, go_term_columns=['Computed GO Processes', 'Curated GO Components', 'Curated GO Functions', 'Curated GO Processes'])

   Perform GO term enrichment analysis for each GO term column and generate plots.

   Parameters:
   - significant_df: DataFrame containing the significant genes from the screen.
   - metadata_path: Path to the metadata file containing GO terms.
   - go_term_columns: List of columns in the metadata corresponding to GO terms.

   For each GO term column, this function will:
   - Split the GO terms by semicolons.
   - Count the occurrences of GO terms in the hits and in the background.
   - Perform Fisher's exact test for enrichment.
   - Plot the enrichment score vs -log10(p-value).


.. py:function:: plot_gene_phenotypes(data, gene_list, x_column='Gene ID', data_column='T.gondii GT1 CRISPR Phenotype - Mean Phenotype', error_column='T.gondii GT1 CRISPR Phenotype - Standard Error', save_path=None)

   Plot a line graph for the mean phenotype with standard error shading and highlighted genes.

   :param data: The input DataFrame containing gene data.
   :type data: pd.DataFrame
   :param gene_list: A list of gene names to highlight on the plot.
   :type gene_list: list


.. py:function:: plot_gene_heatmaps(data, gene_list, columns, x_column='Gene ID', normalize=False, save_path=None)

   Generate a teal-to-white heatmap with the specified columns and genes.

   :param data: The input DataFrame containing gene data.
   :type data: pd.DataFrame
   :param gene_list: A list of genes to include in the heatmap.
   :type gene_list: list
   :param columns: A list of column names to visualize as heatmaps.
   :type columns: list
   :param normalize: If True, normalize the values for each gene between 0 and 1.
   :type normalize: bool
   :param save_path: Optional. If provided, the plot will be saved to this path.
   :type save_path: str


.. py:function:: generate_score_heatmap(settings)

