-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #73 from EliHei2/fix_cc
fixed prediction to use 3 dims + updated the notebook
- Loading branch information
Showing
7 changed files
with
731 additions
and
271 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
from segger.data.parquet.sample import STSampleParquet | ||
from path import Path | ||
from segger.data.utils import calculate_gene_celltype_abundance_embedding | ||
import scanpy as sc | ||
|
||
xenium_data_dir = Path('data_raw/breast_cancer/Xenium_FFPE_Human_Breast_Cancer_Rep1/outs/') | ||
segger_data_dir = Path('data_tidy/pyg_datasets/bc_fast_data_emb_major') | ||
|
||
|
||
scrnaseq_file = Path('data_tidy/benchmarks/xe_rep1_bc/scRNAseq.h5ad') | ||
celltype_column = 'celltype_major' | ||
gene_celltype_abundance_embedding = calculate_gene_celltype_abundance_embedding( | ||
sc.read(scrnaseq_file), | ||
celltype_column | ||
) | ||
|
||
sample = STSampleParquet( | ||
base_dir=xenium_data_dir, | ||
n_workers=4, | ||
sample_type='xenium', | ||
weights=gene_celltype_abundance_embedding, # uncomment if gene-celltype embeddings are available | ||
) | ||
|
||
sample.save( | ||
data_dir=segger_data_dir, | ||
k_bd=3, | ||
dist_bd=15.0, | ||
k_tx=20, | ||
dist_tx=3, | ||
tile_width=220, | ||
tile_height=220, | ||
neg_sampling_ratio=5.0, | ||
frac=1.0, | ||
val_prob=0.1, | ||
test_prob=0.1, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.