spacr 0.0.70__py3-none-any.whl → 0.0.80__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
spacr/sim.py CHANGED
@@ -204,16 +204,12 @@ def power_law_dist_gen(df, avg, well_ineq_coeff):
204
204
  Generate a power-law distribution for wells.
205
205
 
206
206
  Parameters:
207
- - df: DataFrame
208
- The input DataFrame containing the wells.
209
- - avg: float
210
- The average value for the distribution.
211
- - well_ineq_coeff: float
212
- The inequality coefficient for the power-law distribution.
207
+ - df: DataFrame: The input DataFrame containing the wells.
208
+ - avg: float: The average value for the distribution.
209
+ - well_ineq_coeff: float: The inequality coefficient for the power-law distribution.
213
210
 
214
211
  Returns:
215
- - dist: ndarray
216
- The generated power-law distribution for the wells.
212
+ - dist: ndarray: The generated power-law distribution for the wells.
217
213
  """
218
214
  # Generate a power-law distribution for wells
219
215
  distribution = generate_power_law_distribution(len(df), well_ineq_coeff)
@@ -405,8 +401,7 @@ def compute_roc_auc(cell_scores):
405
401
  - cell_scores (DataFrame): DataFrame containing cell scores with columns 'is_active' and 'score'.
406
402
 
407
403
  Returns:
408
- - cell_roc_dict (dict): Dictionary containing the ROC curve information, including the threshold, true positive rate (TPR),
409
- false positive rate (FPR), and ROC AUC.
404
+ - cell_roc_dict (dict): Dictionary containing the ROC curve information, including the threshold, true positive rate (TPR), false positive rate (FPR), and ROC AUC.
410
405
 
411
406
  """
412
407
  fpr, tpr, thresh = roc_curve(cell_scores['is_active'], cell_scores['score'], pos_label=1)
@@ -567,11 +562,11 @@ def regression_roc_auc(results_df, active_gene_list, control_gene_list, alpha =
567
562
 
568
563
  Returns:
569
564
  tuple: A tuple containing the following:
570
- - results_df (DataFrame): Updated DataFrame with additional columns.
571
- - reg_roc_dict_df (DataFrame): DataFrame containing regression ROC curve data.
572
- - reg_pr_dict_df (DataFrame): DataFrame containing precision-recall curve data.
573
- - reg_cm (ndarray): Confusion matrix.
574
- - sim_stats (DataFrame): DataFrame containing simulation statistics.
565
+ - results_df (DataFrame): Updated DataFrame with additional columns.
566
+ - reg_roc_dict_df (DataFrame): DataFrame containing regression ROC curve data.
567
+ - reg_pr_dict_df (DataFrame): DataFrame containing precision-recall curve data.
568
+ - reg_cm (ndarray): Confusion matrix.
569
+ - sim_stats (DataFrame): DataFrame containing simulation statistics.
575
570
  """
576
571
  results_df = results_df.rename(columns={"P>|t|": "p"})
577
572
 
@@ -737,20 +732,20 @@ def run_simulation(settings):
737
732
 
738
733
  Returns:
739
734
  tuple: A tuple containing the simulation results and distances.
740
- - cell_scores (DataFrame): Scores for each cell.
741
- - cell_roc_dict_df (DataFrame): ROC AUC scores for each cell.
742
- - cell_pr_dict_df (DataFrame): Precision-Recall AUC scores for each cell.
743
- - cell_cm (DataFrame): Confusion matrix for each cell.
744
- - well_score (DataFrame): Scores for each well.
745
- - gene_fraction_map (DataFrame): Fraction of genes for each well.
746
- - metadata (DataFrame): Metadata for each well.
747
- - results_df (DataFrame): Results of the regression analysis.
748
- - reg_roc_dict_df (DataFrame): ROC AUC scores for each gene.
749
- - reg_pr_dict_df (DataFrame): Precision-Recall AUC scores for each gene.
750
- - reg_cm (DataFrame): Confusion matrix for each gene.
751
- - sim_stats (dict): Additional simulation statistics.
752
- - genes_per_well_df (DataFrame): Number of genes per well.
753
- - wells_per_gene_df (DataFrame): Number of wells per gene.
735
+ - cell_scores (DataFrame): Scores for each cell.
736
+ - cell_roc_dict_df (DataFrame): ROC AUC scores for each cell.
737
+ - cell_pr_dict_df (DataFrame): Precision-Recall AUC scores for each cell.
738
+ - cell_cm (DataFrame): Confusion matrix for each cell.
739
+ - well_score (DataFrame): Scores for each well.
740
+ - gene_fraction_map (DataFrame): Fraction of genes for each well.
741
+ - metadata (DataFrame): Metadata for each well.
742
+ - results_df (DataFrame): Results of the regression analysis.
743
+ - reg_roc_dict_df (DataFrame): ROC AUC scores for each gene.
744
+ - reg_pr_dict_df (DataFrame): Precision-Recall AUC scores for each gene.
745
+ - reg_cm (DataFrame): Confusion matrix for each gene.
746
+ - sim_stats (dict): Additional simulation statistics.
747
+ - genes_per_well_df (DataFrame): Number of genes per well.
748
+ - wells_per_gene_df (DataFrame): Number of wells per gene.
754
749
  dists (list): List of distances.
755
750
  """
756
751
  #try: