-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1f242f4
commit 0c2b37d
Showing
17 changed files
with
890 additions
and
659 deletions.
There are no files selected for viewing
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
Empty file.
This file was deleted.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
examples/atlas/sc_similarity_examples/data_processing/merge_result_metadata.py
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,18 @@ | ||
tissues = ["blood", "brain", "heart", "intestine", "kidney", "lung", "pancreas"] | ||
import pandas as pd | ||
|
||
from dance.settings import ATLASDIR, SIMILARITYDIR | ||
|
||
if __name__ == "__main__": | ||
for tissue in tissues: | ||
metadata_df = pd.read_csv(ATLASDIR / f"metadatas/{tissue}_metadata.csv") | ||
sweep_result_df = pd.read_csv(ATLASDIR / f"sweep_results/{tissue.capitalize()}_ans.csv") | ||
sweep_result_df = sweep_result_df.rename(columns={"Dataset_id": "dataset_id"}) | ||
sweep_result_df["dataset_id"] = sweep_result_df["dataset_id"].str.split('(').str[0] | ||
result_df = metadata_df.merge(sweep_result_df, how="outer", on="dataset_id") | ||
# result_df.to_csv(SIMILARITYDIR / f"data/results/{tissue}_result.csv") | ||
# for tissue in tissues: | ||
# df=pd.read_csv(SIMILARITYDIR / f"data/results/{tissue}_result.csv") | ||
with pd.ExcelWriter(SIMILARITYDIR / "data/Cell Type Annotation Atlas.xlsx", mode='a', | ||
if_sheet_exists='replace') as writer: | ||
result_df.to_excel(writer, sheet_name=tissue) |
79 changes: 0 additions & 79 deletions
79
examples/atlas/sc_similarity_examples/process_similarity.py
This file was deleted.
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,8 @@ | ||
\[scGPT->metadatas\]+\[get_result_web->sweep_results\]+\[data_processing/merge_result_metadata.py\]->\[data/cell_type_annotation_atlas.xlsx\] | ||
\[data/cell_type_annotation_atlas.xlsx\]+\[similarity/analyze_atlas_accuracy.py\]->\[data/in_atlas_datas\] | ||
\[similarity/example_usage_anndata.py\]+\[data/in_atlas_datas\]+\[data/cell_type_annotation_atlas.xlsx\]->\[data/dataset_similarity\] | ||
\[data/dataset_similarity\]+\[similarity/process_tissue_similarity_matrices.py\]->\[data/new_sim\] | ||
|
||
#run_similarity_optimization.sh | ||
\[data/new_sim\]+\[similarity/optimize_similarity_weights.py\]+\[cache/sweep_cache.json\]->\[data/similarity_weights_results\] | ||
\[data/similarity_weights_results\]+\[similarity/visualize_atlas_performance.py\]+\[cache/sweep_cache.json\]->\[data/imgs\] |
23 changes: 23 additions & 0 deletions
23
examples/atlas/sc_similarity_examples/run_similarity_optimization.sh
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,23 @@ | ||
#!/bin/bash | ||
|
||
# 定义数组 | ||
array=("blood" "brain" "heart" "intestine" "kidney" "lung" "pancreas") | ||
# 循环数组并在后台运行 Python 脚本 | ||
for tissue in "${array[@]}" | ||
do | ||
python similarity/example_usage_anndata.py --tissue "$tissue" | ||
# python similarity/optimize_similarity_weights.py --tissue "$tissue" | ||
# python visualization/visualize_atlas_performance.py --tissue "$tissue" | ||
# python similarity/optimize_similarity_weights.py --tissue "$tissue" --in_query | ||
# python visualization/visualize_atlas_performance.py --tissue "$tissue" --in_query | ||
# python similarity/optimize_similarity_weights.py --tissue "$tissue" --reduce_error | ||
# python visualization/visualize_atlas_performance.py --tissue "$tissue" --reduce_error | ||
# python similarity/optimize_similarity_weights.py --tissue "$tissue" --in_query --reduce_error | ||
# python visualization/visualize_atlas_performance.py --tissue "$tissue" --in_query --reduce_error | ||
echo "启动处理 tissue: $tissue" | ||
done | ||
|
||
# 等待所有后台进程完成 | ||
wait | ||
|
||
echo "所有 Python 脚本已执行完成" |
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.