def main(server_name, catalog_id, credentials): server = DerivaServer('https', server_name, credentials) catalog = server.connect_ermrest(catalog_id) catalog.dcctx['cid'] = "oneoff/model" model = catalog.getCatalogModel() """ Create the new vocabulary tables """ utils.create_table_if_not_exist( model, 'Vocab', utils.define_Vocab_table('Data_Dictionary_Name', 'Dictionary names')) utils.create_table_if_not_exist( model, 'Vocab', utils.define_Vocab_table('Data_Dictionary_Category', 'Dictionary categories')) """ Load data into the new vocabulary tables """ utils.add_rows_to_vocab_table(catalog, 'Data_Dictionary_Name', Data_Dictionary_Name_rows) utils.add_rows_to_vocab_table(catalog, 'Data_Dictionary_Category', Data_Dictionary_Category_rows) """ Create the acls bindings """ utils.set_table_acl_bindings(catalog, 'Vocab', 'Data_Dictionary_Name', acl_bindings) utils.set_table_acl_bindings(catalog, 'Vocab', 'Data_Dictionary_Category', acl_bindings)
def main(server_name, catalog_id, credentials): server = DerivaServer('https', server_name, credentials) catalog = server.connect_ermrest(catalog_id) catalog.dcctx['cid'] = 'oneoff/model' model = catalog.getCatalogModel() """ Create table """ utils.create_table_if_not_exist(model, 'PDB', define_tdoc_ihm_cross_link_pseudo_site()) #Requires ihm_cross_link_restraint, ihm_model_list, ihm_pseudo_site, cross_link_partner
def main(server_name, catalog_id, credentials): server = DerivaServer('https', server_name, credentials) catalog = server.connect_ermrest(catalog_id) catalog.dcctx['cid'] = 'oneoff/model' model = catalog.getCatalogModel() """ Create table """ utils.create_table_if_not_exist(model, 'PDB', define_tdoc_Supported_Dictionary())
def main(server_name, catalog_id, credentials): server = DerivaServer('https', server_name, credentials) catalog = server.connect_ermrest(catalog_id) catalog.dcctx['cid'] = 'oneoff/model' model = catalog.getCatalogModel() """ Create table """ utils.create_table_if_not_exist(model, 'PDB', define_tdoc_ihm_data_transformation()) """ Update existing model """ update_PDB_ihm_related_datasets(model) #Requires ihm_data_transformation
def main(server_name, catalog_id, credentials): server = DerivaServer('https', server_name, credentials) catalog = server.connect_ermrest(catalog_id) catalog.dcctx['cid'] = 'oneoff/model' model = catalog.getCatalogModel() """ Create table """ utils.create_table_if_not_exist( model, 'PDB', define_tdoc_ihm_hdx_restraint( )) #Requires ihm_feature_list, ihm_dataset_list """ Update existing model """ update_PDB_ihm_derived_distance_restraint(model)
def main(server_name, catalog_id, credentials): server = DerivaServer('https', server_name, credentials) catalog = server.connect_ermrest(catalog_id) catalog.dcctx['cid'] = 'oneoff/model' model = catalog.getCatalogModel() """ Update existing model """ update_PDB_ihm_ensemble_info( model) #Requires sub_sample_flag and sub_sampling_type """ Create table """ utils.create_table_if_not_exist( model, 'PDB', define_tdoc_ihm_ensemble_sub_sample( )) #Requires ihm_ensemble_info, ihm_model_group, ihm_external_files
def main(server_name, catalog_id, credentials): server = DerivaServer('https', server_name, credentials) catalog = server.connect_ermrest(catalog_id) catalog.dcctx['cid'] = "oneoff/model" model = catalog.getCatalogModel() #-- clean up if False: drop_table(catalog, 'PDB', 'ihm_derived_angle_restraint') # new changes if True: model = catalog.getCatalogModel() #utils.create_table_if_not_exist(model, "Vocab", utils.define_Vocab_table('ihm_derived_angle_restraint_group_conditionality', 'Conditionality of a group of angles restrained together')) #utils.create_table_if_not_exist(model, "Vocab", utils.define_Vocab_table('ihm_derived_angle_restraint_restraint_type', 'The type of angle restraint')) #add_rows_to_Vocab_ihm_derived_angle_restraint_group_conditionality(catalog) #add_rows_to_Vocab_ihm_derived_angle_restraint_restraint_type(catalog) utils.create_table_if_not_exist( model, "PDB", define_tdoc_ihm_derived_angle_restraint())
def main(server_name, catalog_id, credentials): server = DerivaServer('https', server_name, credentials) catalog = server.connect_ermrest(catalog_id) catalog.dcctx['cid'] = 'oneoff/model' model = catalog.getCatalogModel() """ Create table """ utils.create_table_if_not_exist(model, 'PDB', define_tdoc_ihm_pseudo_site()) """ Create combo1/combo2 keys in existing tables """ utils.create_key_if_not_exists(model, 'PDB', 'ihm_model_list', ['RID', 'model_id'], 'ihm_model_list_combo2_key') utils.create_key_if_not_exists(model, 'PDB', 'ihm_feature_list', ['RID', 'structure_id', 'feature_id'], 'ihm_feature_list_combo1_key') utils.create_key_if_not_exists(model, 'PDB', 'ihm_dataset_list', ['RID', 'structure_id', 'id'], 'ihm_dataset_list_combo1_key') """ Update existing model """ update_PDB_ihm_cross_link_restraint(model) #Requires pseudo_site_flag update_PDB_ihm_pseudo_site_feature( model) #Requires ihm_pseudo_site and ihm_feature_list_combo1_key """ Rename primary keys """ utils.rename_key_if_exist(model, 'PDB', 'ihm_model_group', 'ihm_model_group_RID_id_key', 'ihm_model_group_combo2_key') utils.rename_key_if_exist(model, 'PDB', 'ihm_external_files', 'ihm_external_files_id_RID_key', 'ihm_external_files_combo2_key')
def main(server_name, catalog_id, credentials): server = DerivaServer('https', server_name, credentials) catalog = server.connect_ermrest(catalog_id) catalog.dcctx['cid'] = "oneoff/model" model = catalog.getCatalogModel() #-- clean up if False: drop_table(catalog, 'PDB', 'struct_ref') drop_table(catalog, 'PDB', 'struct_ref_seq') drop_table(catalog, 'PDB', 'struct_ref_seq_dif') # new changes if True: model = catalog.getCatalogModel() #utils.create_table_if_not_exist(model, "Vocab", utils.define_Vocab_table('struct_ref_db_name', 'The name of the database containing reference information')) #utils.create_table_if_not_exist(model, "Vocab", utils.define_Vocab_table('struct_ref_seq_dif_details', 'Details about the special aspects of point differences in the alignment of the macromolecular sequence in the integrative model and the sequence in the reference database')) #add_rows_to_Vocab_struct_ref_db_name(catalog) #add_rows_to_Vocab_struct_ref_seq_dif_details(catalog) utils.create_key_if_not_exists(model, 'PDB', 'entity', ['RID', 'structure_id', 'id'], 'entity_combo1_key') utils.create_table_if_not_exist(model, "PDB", define_tdoc_struct_ref()) utils.create_table_if_not_exist(model, "PDB", define_tdoc_struct_ref_seq()) utils.create_table_if_not_exist(model, "PDB", define_tdoc_struct_ref_seq_dif())
def main(server_name, catalog_id, credentials): server = DerivaServer('https', server_name, credentials) catalog = server.connect_ermrest(catalog_id) catalog.dcctx['cid'] = "oneoff/model" model = catalog.getCatalogModel() """ Add the Table_Name column to the Vocab.File_Type table """ utils.create_column_if_not_exist( model, 'Vocab', 'File_Type', Column.define('Table_Name', builtin_types.text, nullok=True)) """ Create the new vocabulary tables """ utils.create_table_if_not_exist( model, 'Vocab', utils.define_Vocab_table('cross_link_partner', 'Identity of the crosslink partner')) utils.create_table_if_not_exist( model, 'Vocab', utils.define_Vocab_table( 'sub_sample_flag', 'Flag for ensembles consisting of sub samples')) utils.create_table_if_not_exist( model, 'Vocab', utils.define_Vocab_table('sub_sampling_type', 'Types of sub samples in ensembles')) utils.create_table_if_not_exist( model, 'Vocab', utils.define_Vocab_table('pseudo_site_flag', 'Flag for crosslinks involving pseudo sites')) utils.create_table_if_not_exist( model, 'Vocab', utils.define_Vocab_table( 'ihm_derived_angle_restraint_group_conditionality', 'Conditionality of a group of angles restrained together')) utils.create_table_if_not_exist( model, 'Vocab', utils.define_Vocab_table('ihm_derived_angle_restraint_restraint_type', 'The type of angle restraint')) utils.create_table_if_not_exist( model, 'Vocab', utils.define_Vocab_table( 'ihm_derived_dihedral_restraint_group_conditionality', 'Conditionality of a group of dihedrals restrained together')) utils.create_table_if_not_exist( model, 'Vocab', utils.define_Vocab_table( 'ihm_derived_dihedral_restraint_restraint_type', 'The type of dihedral restraint')) utils.create_table_if_not_exist( model, 'Vocab', utils.define_Vocab_table( 'struct_ref_seq_dif_details', 'Details about the special aspects of point differences in the alignment of the macromolecular sequence in the integrative model and the sequence in the reference database' )) utils.create_table_if_not_exist( model, 'Vocab', utils.define_Vocab_table( 'struct_ref_db_name', 'The name of the database containing reference information')) """ Load data into the new vocabulary tables """ utils.add_rows_to_vocab_table(catalog, 'cross_link_partner', cross_link_partner_rows) utils.add_rows_to_vocab_table(catalog, 'sub_sample_flag', sub_sample_flag_rows) utils.add_rows_to_vocab_table(catalog, 'sub_sampling_type', sub_sampling_type_rows) utils.add_rows_to_vocab_table(catalog, 'pseudo_site_flag', pseudo_site_flag_rows) utils.add_rows_to_vocab_table( catalog, 'ihm_derived_angle_restraint_group_conditionality', ihm_derived_angle_restraint_group_conditionality_rows) utils.add_rows_to_vocab_table( catalog, 'ihm_derived_angle_restraint_restraint_type', ihm_derived_angle_restraint_restraint_type_rows) utils.add_rows_to_vocab_table( catalog, 'ihm_derived_dihedral_restraint_group_conditionality', ihm_derived_dihedral_restraint_group_conditionality_rows) utils.add_rows_to_vocab_table( catalog, 'ihm_derived_dihedral_restraint_restraint_type', ihm_derived_dihedral_restraint_restraint_type_rows) utils.add_rows_to_vocab_table(catalog, 'struct_ref_seq_dif_details', struct_ref_seq_dif_details_rows) utils.add_rows_to_vocab_table(catalog, 'struct_ref_db_name', struct_ref_db_name_rows) """ Load data into existing vocabulary tables """ utils.add_rows_to_vocab_table(catalog, 'ihm_cross_link_list_linker_type', ihm_cross_link_list_linker_type_rows) utils.add_rows_to_vocab_table(catalog, 'ihm_dataset_list_data_type', ihm_dataset_list_data_type_rows) utils.add_rows_to_vocab_table( catalog, 'ihm_dataset_related_db_reference_db_name', ihm_dataset_related_db_reference_db_name_rows) utils.add_rows_to_vocab_table( catalog, 'ihm_derived_distance_restraint_restraint_type', ihm_derived_distance_restraint_restraint_type_rows) utils.add_rows_to_vocab_table(catalog, 'File_Type', File_Type_rows) """ Create the acls bindings """ utils.set_table_acl_bindings(catalog, 'Vocab', 'cross_link_partner', acl_bindings) utils.set_table_acl_bindings(catalog, 'Vocab', 'sub_sample_flag', acl_bindings) utils.set_table_acl_bindings(catalog, 'Vocab', 'sub_sampling_type', acl_bindings) utils.set_table_acl_bindings(catalog, 'Vocab', 'pseudo_site_flag', acl_bindings) utils.set_table_acl_bindings( catalog, 'Vocab', 'ihm_derived_angle_restraint_group_conditionality', acl_bindings) utils.set_table_acl_bindings(catalog, 'Vocab', 'ihm_derived_angle_restraint_restraint_type', acl_bindings) utils.set_table_acl_bindings( catalog, 'Vocab', 'ihm_derived_dihedral_restraint_group_conditionality', acl_bindings) utils.set_table_acl_bindings( catalog, 'Vocab', 'ihm_derived_dihedral_restraint_restraint_type', acl_bindings) utils.set_table_acl_bindings(catalog, 'Vocab', 'struct_ref_seq_dif_details', acl_bindings) utils.set_table_acl_bindings(catalog, 'Vocab', 'struct_ref_db_name', acl_bindings)