-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtier1_to_dcp_dict.py
134 lines (132 loc) · 7.23 KB
/
tier1_to_dcp_dict.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
"""
Dictionary with keys Tier 1 fields, and values, the corresponding DCP fields
Fields that are conditionally changed are not part of the dictionary to avoid duplications
"""
tier1_to_dcp = {
'title': 'project.project_core.project_title',
'study_pi': 'project.contributors.name',
# batch_condition
# default_embedding
# comments
'sample_id': 'specimen_from_organism.biomaterial_core.biomaterial_id',
'donor_id': 'donor_organism.biomaterial_core.biomaterial_id',
'protocol_url': 'library_preparation_protocol.protocol_core.protocols_io_doi',
# 'institute': 'project.contributors.institute',
# 'sample_collection_site': 'sample_collection_site',
# 'sample_collection_relative_time_point': 'specimen_from_organism.biomaterial_core.timecourse.value',
'library_id': 'cell_suspension.biomaterial_core.biomaterial_id',
'library_id_repository': 'cell_suspension.biomaterial_core.biomaterial_name',
# 'author_batch_notes': 'cell_suspension.biomaterial_core.biomaterial_description',
# 'organism_ontology_term_id': 'donor_organism.biomaterial_core.ncbi_taxon_id',
# 'manner_of_death': 'donor_organism.death.hardy_scale',
# 'sample_source': 'donor_organism.is_living',
# 'sex_ontology_term_id': 'donor_organism.sex',
'sample_collection_method': 'collection_protocol.method.text',
# tissue_type
# 'sampled_site_condition': 'specimen_from_organism.diseases.text', # if is healthy PATO, if adjacent PATO & adjacent disease_ontology_term_id, else disease_ontology_term_id
'tissue_ontology_term_id': 'specimen_from_organism.organ.ontology',
'tissue_free_text': 'specimen_from_organism.organ_parts.text',
'sample_preservation_method': 'specimen_from_organism.preservation_storage.storage_method',
'suspension_type': 'library_preparation_protocol.nucleic_acid_source',
# 'cell_enrichment': 'enrichment_protocol.markers', # if CL ontology add CL label
'cell_viability_percentage': 'cell_suspension.cell_morphology.percent_cell_viability',
'cell_number_loaded': 'cell_suspension.estimated_cell_count',
'sample_collection_year': 'specimen_from_organism.collection_time',
'assay_ontology_term_id': 'library_preparation_protocol.library_construction_method.ontology',
'library_preparation_batch': 'sequence_file.library_prep_id',
# 'library_sequencing_run': 'library_sequencing_run',
# 'library_sequencing_run': 'sequence_file.insdc_run_accessions',
'sequenced_fragment': 'library_preparation_protocol.end_bias',
'sequencing_platform': 'sequencing_protocol.instrument_manufacturer_model.ontology',
# is_primary_data
'reference_genome': 'analysis_file.genome_assembly_version',
'gene_annotation_version': 'analysis_protocol.gene_annotation_version',
# 'alignment_software': 'analysis_protocol.alignment_software',
'intron_inclusion': 'analysis_protocol.intron_inclusion',
# author_cell_type
# cell_type_ontology_term_id
'disease_ontology_term_id': 'donor_organism.diseases.ontology',
'self_reported_ethnicity_ontology_term_id': 'donor_organism.human_specific.ethnicity.ontology',
'development_stage_ontology_term_id': 'donor_organism.development_stage.ontology'
}
tier1 = {'uns': {
'MUST':
['title', 'study_pi'],
'RECOMMENDED':
['batch_condition', 'default_embedding', 'comments']
},
'obs': {
'MUST':
['sample_id', 'donor_id', 'institute', 'library_id', 'organism_ontology_term_id',
'manner_of_death', 'sample_source', 'sex_ontology_term_id', 'sample_collection_method',
'tissue_type', 'sampled_site_condition', 'tissue_ontology_term_id',
'sample_preservation_method', 'suspension_type',
'cell_enrichment', 'assay_ontology_term_id', 'library_preparation_batch',
'library_sequencing_run', 'sequenced_fragment',
'is_primary_data', 'reference_genome',
'gene_annotation_version', 'alignment_software',
'author_cell_type', 'cell_type_ontology_term_id',
'disease_ontology_term_id',
'self_reported_ethnicity_ontology_term_id', 'development_stage_ontology_term_id'],
'RECOMMENDED':
['protocol_url', 'sample_collection_site', 'sample_collection_relative_time_point',
'library_id_repository', 'author_batch_notes', 'tissue_free_text',
'cell_viability_percentage', 'cell_number_loaded', 'sample_collection_year',
'sequencing_platform', 'intron_inclusion']
}
}
tier1_list = ['title', 'study_pi',
'batch_condition', 'default_embedding', 'comments',
'sample_id', 'donor_id', 'protocol_url', 'institute',
'sample_collection_site', 'sample_collection_relative_time_point',
'library_id', 'library_id_repository', 'author_batch_notes',
'organism_ontology_term_id', 'manner_of_death', 'sample_source',
'sex_ontology_term_id', 'sample_collection_method', 'tissue_type',
'sampled_site_condition', 'tissue_ontology_term_id',
'tissue_free_text', 'sample_preservation_method',
'suspension_type', 'cell_enrichment',
'cell_viability_percentage', 'cell_number_loaded',
'sample_collection_year', 'assay_ontology_term_id',
'library_preparation_batch', 'library_sequencing_run',
'sequenced_fragment', 'sequencing_platform', 'is_primary_data',
'reference_genome', 'gene_annotation_version',
'alignment_software', 'intron_inclusion',
# 'author_cell_type', 'cell_type_ontology_term_id',
'disease_ontology_term_id',
'self_reported_ethnicity_ontology_term_id',
'development_stage_ontology_term_id']
"""
Dictionary with fields that could potentially generate a meaninigful protocol name like i.e. 10x_3_v2_protocol, biopsy_protocol etc.
"""
protocol_ids = {
'Collection protocol':
{
'tier1_key': 'sample_collection_method',
'dcp_key': 'collection_protocol.method.text',
'dcp_fields': ['collection_protocol.method.text', 'collection_protocol.protocol_core.protocol_id']
},
'Library preparation protocol':
{
'tier1_key': 'assay_ontology_term_id',
'dcp_key': 'library_preparation_protocol.library_construction_method.ontology',
'dcp_fields': ['library_preparation_protocol.library_construction_method.ontology', 'library_preparation_protocol.protocol_core.protocol_id']
},
'Sequencing protocol':
{
'tier1_key': 'sequencing_platform',
'dcp_key': 'sequencing_protocol.instrument_manufacturer_model.ontology',
'dcp_fields': ['sequencing_protocol.instrument_manufacturer_model.ontology', 'sequencing_protocol.protocol_core.protocol_id']
},
'Analysis protocol':
{
'tier1_key': 'analysis_software',
'dcp_key': 'analysis_protocol.alignment_software_version',
'dcp_fields': ['analysis_protocol.alignment_software_version', 'analysis_protocol.protocol_core.protocol_id']
},
'Enrichment protocol':
{
'tier1_key': 'cell_enrichment',
'dcp_key': 'enrichment_protocol.markers',
'dcp_fields': ['enrichment_protocol.markers', 'enrichment_protocol.protocol_core.protocol_id']
}
}