Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,7 @@ vocabularies:
url: 'https://agroportal.lirmm.fr/ontologies/PBO'
idSpaces:
- name: 'PBO'
description: 'Plant Breeding Ontology'
description: 'Plant Breeding Ontology (PBO): an ontology for the plant breeding community which captures more than 2200 entries where 80 represent the core terms.'
urlPrefix: 'https://agroportal.lirmm.fr/ontologies/PBO/PBO_{accession}'
terms:
- id: 'PBO:0000065'
Expand Down
18 changes: 14 additions & 4 deletions tripal_chado/tests/fixtures/fill_chado_test_prepare.sql
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ INSERT INTO chado.cv VALUES (29, 'sep', 'A structured controlled vocabulary for
INSERT INTO chado.cv VALUES (30, 'SIO', 'The Semanticscience Integrated Ontology (SIO) provides a simple, integrated ontology of types and relations for rich description of objects, processes and their attributes.');
INSERT INTO chado.cv VALUES (31, 'cellular_component', NULL);
INSERT INTO chado.cv VALUES (32, 'synonym_type', NULL);
INSERT INTO chado.cv VALUES (33, 'PBO', 'Plant Breeding Ontology');
INSERT INTO chado.db VALUES (19, 'UO', 'Units of Measurement Ontology', 'http://purl.obolibrary.org/obo/UO_{accession}', 'http://purl.obolibrary.org/obo/uo');
INSERT INTO chado.db VALUES (2, 'CO_010', 'Crop Germplasm Ontology', 'http://www.cropontology.org/terms/CO_010:{accession}', 'http://www.cropontology.org/get-ontology/CO_010');
INSERT INTO chado.db VALUES (11, 'OBCS', 'Ontology of Biological and Clinical Statistics', 'http://purl.obolibrary.org/obo/{db}_{accession}', 'https://github.com/obcs/obcs');
Expand Down Expand Up @@ -163,6 +164,7 @@ INSERT INTO chado.db VALUES (35, 'BS', '', NULL, '');
INSERT INTO chado.db VALUES (36, 'RNAMOD', '', NULL, '');
INSERT INTO chado.db VALUES (37, 'MOD', '', NULL, '');
INSERT INTO chado.db VALUES (38, 'wikipedia', '', NULL, '');
INSERT INTO chado.db VALUES (41, 'PBO', 'Plant Breeding Ontology (PBO): an ontology for the plant breeding community which captures more than 2200 entries where 80 represent the core terms.', 'https://agroportal.lirmm.fr/ontologies/PBO/PBO_{accession}', 'https://agroportal.lirmm.fr/ontologies/PBO');
INSERT INTO chado.dbxref VALUES (1, 1, 'local:null', '', NULL);
INSERT INTO chado.dbxref VALUES (2, 1, 'chado_properties:version', '', NULL);
INSERT INTO chado.dbxref VALUES (3, 2, '0000044', '', NULL);
Expand Down Expand Up @@ -3652,6 +3654,10 @@ INSERT INTO chado.dbxref VALUES (3486, 15, 'lineageex', '', NULL);
INSERT INTO chado.dbxref VALUES (3487, 20, 'C16493', '', NULL);
INSERT INTO chado.dbxref VALUES (3488, 31, '001377', '', NULL);
INSERT INTO chado.dbxref VALUES (3489, 4, '1122', '', NULL);
INSERT INTO chado.dbxref VALUES (3490, 8, '0007059', '', NULL);
INSERT INTO chado.dbxref VALUES (3491, 8, '0005136', '', NULL);
INSERT INTO chado.dbxref VALUES (3492, 12, '0002076', '', NULL);
INSERT INTO chado.dbxref VALUES (3493, 41, '0000065', '', NULL);
INSERT INTO chado.cvterm VALUES (1, 1, 'null', NULL, 1, 0, 0);
INSERT INTO chado.cvterm VALUES (2, 4, 'version', 'Chado schema version', 2, 0, 0);
INSERT INTO chado.cvterm VALUES (3, 5, 'accession', '', 3, 0, 0);
Expand Down Expand Up @@ -6834,6 +6840,10 @@ INSERT INTO chado.cvterm VALUES (3179, 2, 'lineageex', '', 3486, 0, 0);
INSERT INTO chado.cvterm VALUES (3180, 19, 'Data Source', 'The person or authoritative body who provided the information.', 3487, 0, 0);
INSERT INTO chado.cvterm VALUES (3181, 30, 'versioned dataset', 'a versioned dataset is a dataset with a particular release date or release number.', 3488, 0, 0);
INSERT INTO chado.cvterm VALUES (3182, 7, 'Phylogenetic tree type', 'Phylogenetic tree type | A label (text token) describing the type of a phylogenetic tree. [http://edamontology.org]', 3489, 0, 0);
INSERT INTO chado.cvterm VALUES (3183, 8, 'germplasm', 'Germplasm is the living genetic resources such as seeds or tissue that is maintained for the purpose of animal and plant breeding, preservation, and other research uses. These resources may take the form of seed collections stored in seed banks, trees growing in nurseries, animal breeding lines maintained in animal breeding programs or gene banks, etc. Germplasm collections can range from collections of wild species to elite, domesticated breeding lines that have undergone extensive human selection.', 3490, 0, 0);
INSERT INTO chado.cvterm VALUES (3184, 8, 'cultivar', 'A cultivated plant variety selected and given a name because it has desirable characteristics that distinguish it from otherwise similar plants of the same species.', 3491, 0, 0);
INSERT INTO chado.cvterm VALUES (3185, 12, 'collection of specimens', 'A material entity that has two or more specimens as its parts.', 3492, 0, 0);
INSERT INTO chado.cvterm VALUES (3186, 33, 'progeny', '', 3493, 0, 0);
INSERT INTO chado.contact VALUES (1, NULL, 'null', 'null');
INSERT INTO chado.pub VALUES (1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'null', 'null', 1, false, NULL, NULL);
INSERT INTO chado.chadoprop VALUES (1, 2, '1.3', 0);
Expand Down Expand Up @@ -16525,12 +16535,12 @@ INSERT INTO chado.db2cv_mview VALUES (29, 'sep', 30, 'sep', 2);
INSERT INTO chado.db2cv_mview VALUES (32, 'synonym_type', 33, 'synonym_type', 4);
SELECT pg_catalog.setval('chado.chadoprop_chadoprop_id_seq', 1, true);
SELECT pg_catalog.setval('chado.contact_contact_id_seq', 1, true);
SELECT pg_catalog.setval('chado.cv_cv_id_seq', 32, true);
SELECT pg_catalog.setval('chado.cvterm_cvterm_id_seq', 3182, true);
SELECT pg_catalog.setval('chado.cv_cv_id_seq', 33, true);
SELECT pg_catalog.setval('chado.cvterm_cvterm_id_seq', 3186, true);
SELECT pg_catalog.setval('chado.cvterm_dbxref_cvterm_dbxref_id_seq', 308, true);
SELECT pg_catalog.setval('chado.cvterm_relationship_cvterm_relationship_id_seq', 3435, true);
SELECT pg_catalog.setval('chado.cvtermprop_cvtermprop_id_seq', 1346, true);
SELECT pg_catalog.setval('chado.cvtermsynonym_cvtermsynonym_id_seq', 4559, true);
SELECT pg_catalog.setval('chado.db_db_id_seq', 40, true);
SELECT pg_catalog.setval('chado.dbxref_dbxref_id_seq', 3489, true);
SELECT pg_catalog.setval('chado.db_db_id_seq', 41, true);
SELECT pg_catalog.setval('chado.dbxref_dbxref_id_seq', 3493, true);
SELECT pg_catalog.setval('chado.pub_pub_id_seq', 1, true);
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ scenarios:
name: 'TO'
path: '{tripal_chado}/tests/fixtures/obo_loader/test_to.obo'
expect_message: 'a lookup will be performed with the EBI Ontology Lookup Service'
expect_db2cv_count: 31
expect_cv_root_count: 10
expect_db2cv_count: 3
expect_cv_root_count: 1
expect:
- table: 'db'
column: 'name'
Expand Down Expand Up @@ -51,8 +51,8 @@ scenarios:
tripal_cv_obo:
name: 'EDAM'
path: '{tripal_chado}/tests/fixtures/obo_loader/test_EDAM.obo'
expect_db2cv_count: 31
expect_cv_root_count: 9
expect_db2cv_count: 3
expect_cv_root_count: 0
expect:
- table: 'cvterm'
column: 'name'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,19 +308,22 @@ public function testOboImporter(int $current_scenario_key, string $current_scena
$this->assertEquals($expected_count, $count, 'Did not create a ' . $expect['table'] . '.' . $expect['column'] . ' record with the expected value');
}

$db_query = $this->chado_connection->select('1:db2cv_mview', 't');
$db_query->fields('t', ['cv_id', 'cvname', 'db_id', 'dbname', 'num_terms']);
$db_initial_count = $db_query->countQuery()->execute()->fetchField();
$cv_query = $this->chado_connection->select('1:cv_root_mview', 't');
$cv_query->fields('t', ['name', 'cvterm_id', 'cv_id', 'name']);
$cv_initial_count = $cv_query->countQuery()->execute()->fetchField();

// Postrun of the obo importer populates materialized views.
$obo_importer->postRun();

// Test that the materialized views have been populated.
$query = $this->chado_connection->select('1:db2cv_mview', 't');
$query->fields('t', ['cv_id', 'cvname', 'db_id', 'dbname', 'num_terms']);
$count = $query->countQuery()->execute()->fetchField();
$this->assertEquals($current_scenario['expect_db2cv_count'], $count, 'Expected number of records in db2cv_mview not found');

$query = $this->chado_connection->select('1:cv_root_mview', 't');
$query->fields('t', ['name', 'cvterm_id', 'cv_id', 'name']);
$count = $query->countQuery()->execute()->fetchField();
$this->assertEquals($current_scenario['expect_cv_root_count'], $count, 'Expected number of records in cv_root_mview not found');
$db_num_added = $db_query->countQuery()->execute()->fetchField() - $db_initial_count;
$this->assertEquals($current_scenario['expect_db2cv_count'], $db_num_added, 'Expected number of records in db2cv_mview not found');

$cv_num_added = $cv_query->countQuery()->execute()->fetchField() - $cv_initial_count;
$this->assertEquals($current_scenario['expect_cv_root_count'], $cv_num_added, 'Expected number of records in cv_root_mview not found');

}

Expand Down