Skip to content

Commit

Permalink
errors_correction
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiomarco25 committed Dec 19, 2024
1 parent 237329e commit 57f05ea
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@
"\n",
"\n",
"input_data=sdata.points['transcripts'][['missegmentation_associated']].compute()\n",
"troutpy.pl.pie_of_positive(input_data,groupby='missegmentation_associated',figures_path=output_path,save=True)"
"troutpy.pl.pie_of_positive(input_data,groupby='missegmentation_associated',save=True)"
]
}
],
Expand Down
16 changes: 7 additions & 9 deletions notebooks/spatialdata_tutorials/4_explore_comunication.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -267,23 +267,21 @@
"outputs": [],
"source": [
"def communicating_genes_per_celltype(sdata,proportion_threshold: float = 0.2,cell_type_key='cell type'):\n",
" \"\"\"\n",
" Computes the number of significant genes exchanged between source and target cell types\n",
" based on their proportions in the dataset.\n",
" \"\"\"Computes the number of significant genes exchanged between source and target cell types based on their proportions in the dataset.\n",
"\n",
" Parameters:\n",
" - sdata: AnnData object\n",
" A spatial data object containing the 'table' and 'xrna_metadata' components.\n",
" A spatial data object containing the 'table' and 'xrna_metadata' components.\n",
" - proportion_threshold: float, optional (default=0.2)\n",
" The threshold for filtering significant gene proportions. Genes with proportions \n",
" above this value are considered significant.\n",
" The threshold for filtering significant gene proportions. Genes with proportions \n",
" above this value are considered significant.\n",
" - cell_type_key: str, optional (default='cell type')\n",
" The key in `adata.obs` that contains the cell type annotations.\n",
" The key in `adata.obs` that contains the cell type annotations.\n",
"\n",
" Returns:\n",
" - number_interactions_df: pandas.DataFrame\n",
" A DataFrame where rows represent source cell types, columns represent target cell \n",
" types, and values indicate the number of significant genes shared between them.\n",
" A DataFrame where rows represent source cell types, columns represent target cell \n",
" types, and values indicate the number of significant genes shared between them.\n",
" \"\"\"\n",
" adata=sdata['table']\n",
" source_proportions=pd.DataFrame(sdata['xrna_metadata'].varm['source'],index=sdata['xrna_metadata'].var.index,columns=adata.obs[cell_type_key].unique().dropna())\n",
Expand Down
24 changes: 0 additions & 24 deletions notebooks/spatialdata_tutorials/7_image_params.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -255,30 +255,6 @@
"# The transcripts DataFrame now has a column for each channel's intensity\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['DAPI',\n",
" 'ATP1A1/CD45/E-Cadherin',\n",
" '18S',\n",
" 'AlphaSMA/Vimentin',\n",
" 'dummy',\n",
" 'feature_name',\n",
" 'feature_name']"
]
},
"execution_count": 75,
"metadata": {},
"output_type": "execute_result"
}
],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
Expand Down

0 comments on commit 57f05ea

Please sign in to comment.