Blampey Quentin commited on
Commit
1734776
·
1 Parent(s): 640d242

add script to add missing data files

Browse files
Files changed (2) hide show
  1. add_files.py +49 -0
  2. metadata_all.csv +79 -79
add_files.py ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import argparse
2
+ import shutil
3
+ from pathlib import Path
4
+
5
+ import numpy as np
6
+ import pandas as pd
7
+
8
+
9
+ def main(args):
10
+ path = Path(args.path)
11
+
12
+ df_all = pd.read_csv("metadata_all.csv", index_col=0)
13
+ df = pd.read_csv("metadata.csv", index_col=0)
14
+
15
+ missing_files = np.array(list(set(df_all.index) - set(df.index)))
16
+ exists = np.array([(path / f"{f}.h5ad").exists() for f in missing_files])
17
+
18
+ print(f"Found {exists.sum()} missing files out of {len(exists)}")
19
+
20
+ existing_files = missing_files[exists]
21
+
22
+ for name in existing_files:
23
+ species, tissue = df_all.loc[name, ["species", "tissue"]].values
24
+
25
+ src = path / f"{name}.h5ad"
26
+ dst_dir: Path = Path(__file__).parent / species / tissue
27
+ dst = dst_dir / f"{name}.h5ad"
28
+
29
+ dst_dir.mkdir(parents=True, exist_ok=True)
30
+
31
+ print(f"Copying {src} to {dst}")
32
+ shutil.copyfile(src, dst)
33
+
34
+ df_all.loc[existing_files].to_csv(
35
+ Path(__file__).parent / "metadata.csv", mode="a", header=False
36
+ )
37
+
38
+
39
+ if __name__ == "__main__":
40
+ parser = argparse.ArgumentParser()
41
+ parser.add_argument(
42
+ "-p",
43
+ "--path",
44
+ type=str,
45
+ required=True,
46
+ help="Path to the data directories containing h5ad files to add",
47
+ )
48
+
49
+ main(parser.parse_args())
metadata_all.csv CHANGED
@@ -1,79 +1,79 @@
1
- name,n_cells,n_genes,technology,tissue,species
2
- Xenium_Prime_Human_Lymph_Node_Reactive_FFPE_outs,708983,4622,xenium,lymph_node,human
3
- Xenium_V1_hLiver_nondiseased_section_FFPE_outs,239271,377,xenium,liver,human
4
- HumanUterineCancerPatient2-ROCostain_region_0,758506,500,merscope,uterine,human
5
- Xenium_V1_hPancreas_Cancer_Add_on_FFPE_outs,190965,474,xenium,pancreas,human
6
- Xenium_V1_hTonsil_reactive_follicular_hyperplasia_section_FFPE_outs,1349620,377,xenium,tonsil,human
7
- Xenium_V1_hLung_cancer_section_outs,150365,377,xenium,lung,human
8
- Xenium_V1_FFPE_Human_Brain_Healthy_With_Addon_outs,24406,313,xenium,brain,human
9
- Xenium_V1_hSkin_Melanoma_Base_FFPE_outs,106980,282,xenium,skin,human
10
- cosmx_cancer_liver,463972,1197,cosmx,liver,human
11
- HumanOvarianCancerPatient2Slice3_region_0,212425,500,merscope,ovarian,human
12
- Xenium_V1_mouse_pup_outs,1355849,379,xenium,whole_mouse,mouse
13
- cosmx_pancreas,48944,21569,cosmx,pancreas,human
14
- Xenium_V1_Human_Brain_GBM_FFPE_outs,816769,480,xenium,brain,human
15
- HumanUterineCancerPatient2-RACostain_region_0,741749,500,merscope,uterine,human
16
- Xenium_V1_hColon_Non_diseased_Base_FFPE_outs,270984,325,xenium,colon,human
17
- Xenium_V1_FFPE_TgCRND8_17_9_months_outs,62268,347,xenium,brain,mouse
18
- Xenium_V1_Human_Ovarian_Cancer_Addon_FFPE_outs,247636,480,xenium,ovarian,human
19
- Xenium_V1_hLymphNode_nondiseased_section_outs,377985,377,xenium,lymph_node,human
20
- Xenium_V1_Human_Colon_Cancer_P1_CRC_Add_on_FFPE_outs,307762,422,xenium,colon,human
21
- Xenium_V1_hPancreas_nondiseased_section_outs,103901,377,xenium,pancreas,human
22
- Xenium_V1_Human_Colorectal_Cancer_Addon_FFPE_outs,388175,480,xenium,colon,human
23
- Xenium_V1_humanLung_Cancer_FFPE_outs,162254,377,xenium,lung,human
24
- Xenium_V1_hKidney_nondiseased_section_outs,97560,377,xenium,kidney,human
25
- HumanUterineCancerPatient1_region_0,843285,500,merscope,uterine,human
26
- Xenium_V1_Human_Ductal_Adenocarcinoma_FFPE_outs,235099,380,xenium,pancreas,human
27
- HumanLiverCancerPatient2_region_0,598141,500,merscope,liver,human
28
- HumanColonCancerPatient2_region_0,817588,500,merscope,colon,human
29
- HumanOvarianCancerPatient1_region_0,358485,500,merscope,ovarian,human
30
- Xenium_V1_human_Pancreas_FFPE_outs,140702,377,xenium,pancreas,human
31
- HumanOvarianCancerPatient2Slice1_region_0,254347,500,merscope,ovarian,human
32
- HumanProstateCancerPatient1_region_0,721668,500,merscope,prostate,human
33
- Xenium_V1_hBoneMarrow_acute_lymphoid_leukemia_section_outs,225906,477,xenium,bone_marrow,human
34
- Xenium_V1_Human_Lung_Cancer_Addon_FFPE_outs,161000,480,xenium,lung,human
35
- HumanMelanomaPatient2_region_0,207869,500,merscope,skin,human
36
- HumanOvarianCancerPatient2Slice2_region_0,71381,500,merscope,ovarian,human
37
- cosmx_normal_liver,340706,1197,cosmx,liver,human
38
- HumanProstateCancerPatient2_region_0,993825,500,merscope,prostate,human
39
- Xenium_V1_hSkin_nondiseased_section_1_FFPE_outs,68476,376,xenium,skin,human
40
- HumanMelanomaPatient1_region_0,468138,500,merscope,skin,human
41
- Xenium_Preview_Human_Non_diseased_Lung_With_Add_on_FFPE_outs,295883,392,xenium,lung,human
42
- HumanLiverCancerPatient1_region_0,568355,500,merscope,liver,human
43
- HumanColonCancerPatient1_region_0,677451,500,merscope,colon,human
44
- Xenium_V1_Human_Colon_Cancer_P2_CRC_Add_on_FFPE_outs,340837,422,xenium,colon,human
45
- HumanLungCancerPatient1_region_0,353762,500,merscope,lung,human
46
- Xeniumranger_V1_hSkin_Melanoma_Add_on_FFPE_outs,87499,382,xenium,skin,human
47
- Xenium_V1_mFemur_formic_acid_24hrdecal_section_outs,253560,477,xenium,femur,mouse
48
- HumanLungCancerPatient2_region_0,836739,500,merscope,lung,human
49
- Xenium_V1_Human_Colon_Cancer_P5_CRC_Add_on_FFPE_outs,275998,422,xenium,colon,human
50
- Xenium_V1_mouse_Colon_FF_outs,219797,378,xenium,colon,mouse
51
- HumanBreastCancerPatient1_region_0,713121,500,merscope,breast,human
52
- Xenium_V1_mFemur_EDTA_3daydecal_section_outs,348141,476,xenium,femur,mouse
53
- Xenium_V1_FFPE_Human_Breast_IDC_Big_1_outs,892966,280,xenium,breast,human
54
- Xenium_V1_FFPE_Human_Breast_IDC_With_Addon_outs,576963,380,xenium,breast,human
55
- Xenium_V1_FFPE_Human_Breast_ILC_With_Addon_outs,365604,379,xenium,breast,human
56
- Xenium_Prime_Mouse_Brain_Coronal_FF_outs,63173,4593,xenium,brain,mouse
57
- Xenium_V1_hLiver_cancer_section_FFPE_outs,162628,473,xenium,liver,human
58
- Xenium_V1_hColon_Cancer_Add_on_FFPE_outs,587115,425,xenium,colon,human
59
- Xenium_V1_hColon_Cancer_Base_FFPE_outs,647524,325,xenium,colon,human
60
- Xenium_V1_hColon_Non_diseased_Add_on_FFPE_outs,275822,425,xenium,colon,human
61
- Xenium_V1_FFPE_wildtype_5_7_months_outs,58685,347,xenium,brain,mouse
62
- Xenium_V1_FFPE_wildtype_2_5_months_outs,58231,347,xenium,brain,mouse
63
- Xenium_V1_hKidney_cancer_section_outs,56510,377,xenium,kidney,human
64
- Xenium_V1_hTonsil_follicular_lymphoid_hyperplasia_section_FFPE_outs,864388,377,xenium,tonsil,human
65
- Xenium_Prime_Human_Skin_FFPE_outs,112551,4705,xenium,skin,human
66
- Xenium_V1_FF_Mouse_Brain_MultiSection_1_outs,162033,248,xenium,brain,mouse
67
- Xenium_V1_FFPE_wildtype_13_4_months_outs,59935,347,xenium,brain,mouse
68
- Xenium_Preview_Human_Lung_Cancer_With_Add_on_2_FFPE_outs,531165,392,xenium,lung,human
69
- Xenium_V1_FFPE_Human_Breast_ILC_outs,356746,280,xenium,breast,human
70
- Xenium_V1_FF_Mouse_Brain_MultiSection_2_outs,154654,248,xenium,brain,mouse
71
- Xenium_V1_FFPE_Human_Breast_IDC_outs,574852,280,xenium,breast,human
72
- Xenium_V1_FFPE_TgCRND8_2_5_months_outs,53913,346,xenium,brain,mouse
73
- Xenium_V1_FFPE_TgCRND8_5_7_months_outs,58682,347,xenium,brain,mouse
74
- Xenium_Prime_Human_Prostate_FFPE_outs,193000,5002,xenium,prostate,human
75
- Xenium_V1_FFPE_Human_Breast_IDC_Big_2_outs,885523,280,xenium,breast,human
76
- Xenium_V1_FFPE_Human_Brain_Glioblastoma_With_Addon_outs,40887,318,xenium,brain,human
77
- Xenium_V1_mFemur_EDTA_PFA_3daydecal_section_outs,247876,474,xenium,femur,mouse
78
- Xenium_V1_FF_Mouse_Brain_MultiSection_3_outs,158047,248,xenium,brain,mouse
79
- Xenium_V1_FFPE_Human_Brain_Alzheimers_With_Addon_outs,44955,352,xenium,brain,human
 
1
+ name,n_cells,n_spots,n_genes,n_proteins,technology,tissue,species
2
+ Xenium_Prime_Human_Lymph_Node_Reactive_FFPE_outs,708983,0,4622,0,xenium,lymph_node,human
3
+ Xenium_V1_hLiver_nondiseased_section_FFPE_outs,239271,0,377,0,xenium,liver,human
4
+ HumanUterineCancerPatient2-ROCostain_region_0,758506,0,500,0,merscope,uterine,human
5
+ Xenium_V1_hPancreas_Cancer_Add_on_FFPE_outs,190965,0,474,0,xenium,pancreas,human
6
+ Xenium_V1_hTonsil_reactive_follicular_hyperplasia_section_FFPE_outs,1349620,0,377,0,xenium,tonsil,human
7
+ Xenium_V1_hLung_cancer_section_outs,150365,0,377,0,xenium,lung,human
8
+ Xenium_V1_FFPE_Human_Brain_Healthy_With_Addon_outs,24406,0,313,0,xenium,brain,human
9
+ Xenium_V1_hSkin_Melanoma_Base_FFPE_outs,106980,0,282,0,xenium,skin,human
10
+ cosmx_cancer_liver,463972,0,1197,0,cosmx,liver,human
11
+ HumanOvarianCancerPatient2Slice3_region_0,212425,0,500,0,merscope,ovarian,human
12
+ Xenium_V1_mouse_pup_outs,1355849,0,379,0,xenium,whole_mouse,mouse
13
+ cosmx_pancreas,48944,0,21569,0,cosmx,pancreas,human
14
+ Xenium_V1_Human_Brain_GBM_FFPE_outs,816769,0,480,0,xenium,brain,human
15
+ HumanUterineCancerPatient2-RACostain_region_0,741749,0,500,0,merscope,uterine,human
16
+ Xenium_V1_hColon_Non_diseased_Base_FFPE_outs,270984,0,325,0,xenium,colon,human
17
+ Xenium_V1_FFPE_TgCRND8_17_9_months_outs,62268,0,347,0,xenium,brain,mouse
18
+ Xenium_V1_Human_Ovarian_Cancer_Addon_FFPE_outs,247636,0,480,0,xenium,ovarian,human
19
+ Xenium_V1_hLymphNode_nondiseased_section_outs,377985,0,377,0,xenium,lymph_node,human
20
+ Xenium_V1_Human_Colon_Cancer_P1_CRC_Add_on_FFPE_outs,307762,0,422,0,xenium,colon,human
21
+ Xenium_V1_hPancreas_nondiseased_section_outs,103901,0,377,0,xenium,pancreas,human
22
+ Xenium_V1_Human_Colorectal_Cancer_Addon_FFPE_outs,388175,0,480,0,xenium,colon,human
23
+ Xenium_V1_humanLung_Cancer_FFPE_outs,162254,0,377,0,xenium,lung,human
24
+ Xenium_V1_hKidney_nondiseased_section_outs,97560,0,377,0,xenium,kidney,human
25
+ HumanUterineCancerPatient1_region_0,843285,0,500,0,merscope,uterine,human
26
+ Xenium_V1_Human_Ductal_Adenocarcinoma_FFPE_outs,235099,0,380,0,xenium,pancreas,human
27
+ HumanLiverCancerPatient2_region_0,598141,0,500,0,merscope,liver,human
28
+ HumanColonCancerPatient2_region_0,817588,0,500,0,merscope,colon,human
29
+ HumanOvarianCancerPatient1_region_0,358485,0,500,0,merscope,ovarian,human
30
+ Xenium_V1_human_Pancreas_FFPE_outs,140702,0,377,0,xenium,pancreas,human
31
+ HumanOvarianCancerPatient2Slice1_region_0,254347,0,500,0,merscope,ovarian,human
32
+ HumanProstateCancerPatient1_region_0,721668,0,500,0,merscope,prostate,human
33
+ Xenium_V1_hBoneMarrow_acute_lymphoid_leukemia_section_outs,225906,0,477,0,xenium,bone_marrow,human
34
+ Xenium_V1_Human_Lung_Cancer_Addon_FFPE_outs,161000,0,480,0,xenium,lung,human
35
+ HumanMelanomaPatient2_region_0,207869,0,500,0,merscope,skin,human
36
+ HumanOvarianCancerPatient2Slice2_region_0,71381,0,500,0,merscope,ovarian,human
37
+ cosmx_normal_liver,340706,0,1197,0,cosmx,liver,human
38
+ HumanProstateCancerPatient2_region_0,993825,0,500,0,merscope,prostate,human
39
+ Xenium_V1_hSkin_nondiseased_section_1_FFPE_outs,68476,0,376,0,xenium,skin,human
40
+ HumanMelanomaPatient1_region_0,468138,0,500,0,merscope,skin,human
41
+ Xenium_Preview_Human_Non_diseased_Lung_With_Add_on_FFPE_outs,295883,0,392,0,xenium,lung,human
42
+ HumanLiverCancerPatient1_region_0,568355,0,500,0,merscope,liver,human
43
+ HumanColonCancerPatient1_region_0,677451,0,500,0,merscope,colon,human
44
+ Xenium_V1_Human_Colon_Cancer_P2_CRC_Add_on_FFPE_outs,340837,0,422,0,xenium,colon,human
45
+ HumanLungCancerPatient1_region_0,353762,0,500,0,merscope,lung,human
46
+ Xeniumranger_V1_hSkin_Melanoma_Add_on_FFPE_outs,87499,0,382,0,xenium,skin,human
47
+ Xenium_V1_mFemur_formic_acid_24hrdecal_section_outs,253560,0,477,0,xenium,femur,mouse
48
+ HumanLungCancerPatient2_region_0,836739,0,500,0,merscope,lung,human
49
+ Xenium_V1_Human_Colon_Cancer_P5_CRC_Add_on_FFPE_outs,275998,0,422,0,xenium,colon,human
50
+ Xenium_V1_mouse_Colon_FF_outs,219797,0,378,0,xenium,colon,mouse
51
+ HumanBreastCancerPatient1_region_0,713121,0,500,0,merscope,breast,human
52
+ Xenium_V1_mFemur_EDTA_3daydecal_section_outs,348141,0,476,0,xenium,femur,mouse
53
+ Xenium_V1_FFPE_Human_Breast_IDC_Big_1_outs,892966,0,280,0,xenium,breast,human
54
+ Xenium_V1_FFPE_Human_Breast_IDC_With_Addon_outs,576963,0,380,0,xenium,breast,human
55
+ Xenium_V1_FFPE_Human_Breast_ILC_With_Addon_outs,365604,0,379,0,xenium,breast,human
56
+ Xenium_Prime_Mouse_Brain_Coronal_FF_outs,63173,0,4593,0,xenium,brain,mouse
57
+ Xenium_V1_hLiver_cancer_section_FFPE_outs,162628,0,473,0,xenium,liver,human
58
+ Xenium_V1_hColon_Cancer_Add_on_FFPE_outs,587115,0,425,0,xenium,colon,human
59
+ Xenium_V1_hColon_Cancer_Base_FFPE_outs,647524,0,325,0,xenium,colon,human
60
+ Xenium_V1_hColon_Non_diseased_Add_on_FFPE_outs,275822,0,425,0,xenium,colon,human
61
+ Xenium_V1_FFPE_wildtype_5_7_months_outs,58685,0,347,0,xenium,brain,mouse
62
+ Xenium_V1_FFPE_wildtype_2_5_months_outs,58231,0,347,0,xenium,brain,mouse
63
+ Xenium_V1_hKidney_cancer_section_outs,56510,0,377,0,xenium,kidney,human
64
+ Xenium_V1_hTonsil_follicular_lymphoid_hyperplasia_section_FFPE_outs,864388,0,377,0,xenium,tonsil,human
65
+ Xenium_Prime_Human_Skin_FFPE_outs,112551,0,4705,0,xenium,skin,human
66
+ Xenium_V1_FF_Mouse_Brain_MultiSection_1_outs,162033,0,248,0,xenium,brain,mouse
67
+ Xenium_V1_FFPE_wildtype_13_4_months_outs,59935,0,347,0,xenium,brain,mouse
68
+ Xenium_Preview_Human_Lung_Cancer_With_Add_on_2_FFPE_outs,531165,0,392,0,xenium,lung,human
69
+ Xenium_V1_FFPE_Human_Breast_ILC_outs,356746,0,280,0,xenium,breast,human
70
+ Xenium_V1_FF_Mouse_Brain_MultiSection_2_outs,154654,0,248,0,xenium,brain,mouse
71
+ Xenium_V1_FFPE_Human_Breast_IDC_outs,574852,0,280,0,xenium,breast,human
72
+ Xenium_V1_FFPE_TgCRND8_2_5_months_outs,53913,0,346,0,xenium,brain,mouse
73
+ Xenium_V1_FFPE_TgCRND8_5_7_months_outs,58682,0,347,0,xenium,brain,mouse
74
+ Xenium_Prime_Human_Prostate_FFPE_outs,193000,0,5002,0,xenium,prostate,human
75
+ Xenium_V1_FFPE_Human_Breast_IDC_Big_2_outs,885523,0,280,0,xenium,breast,human
76
+ Xenium_V1_FFPE_Human_Brain_Glioblastoma_With_Addon_outs,40887,0,318,0,xenium,brain,human
77
+ Xenium_V1_mFemur_EDTA_PFA_3daydecal_section_outs,247876,0,474,0,xenium,femur,mouse
78
+ Xenium_V1_FF_Mouse_Brain_MultiSection_3_outs,158047,0,248,0,xenium,brain,mouse
79
+ Xenium_V1_FFPE_Human_Brain_Alzheimers_With_Addon_outs,44955,0,352,0,xenium,brain,human