-
Notifications
You must be signed in to change notification settings - Fork 51
Remove deprecated functions from importers #2297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove deprecated functions from importers #2297
Conversation
2 new issues
|
…I' into tv4g0-issue2295-remove-deprecated-functions-from-importers
|
Diff Coverage: The code coverage on the diff in this pull request is 41.8%. Total Coverage: This PR will not change total coverage. File Coverage Changes
🛟 Help
|
…-deprecated-functions-from-importers
…I' into tv4g0-issue2295-remove-deprecated-functions-from-importers
…HPUnit 11.5). This should not fail on PHPUnit deprecations such as the getMockForAbstractClass().
|
I made this PR dependant on #2294 so that we can check the deprecations right now. I also added a setting to PHPUnit 11.5 config to ensure that our tests will fail when deprecations are encountered outside of tests with |
…ers' of github.com:/tripal/tripal into tv4g0-issue2295-remove-deprecated-functions-from-importers
…-deprecated-functions-from-importers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code review is looking mostly good :-) Just one backwards incompatible change that we should resolve.
I added the parameter to avoid loading chado again, and it is only called by one other function. However, you are right about compatibility breaking, even if unlikely, so your proposed change is the best solution. Someday this API should be redone anyway. Co-authored-by: Lacey-Anne Sanderson <[email protected]>
Co-authored-by: Lacey-Anne Sanderson <[email protected]>
Co-authored-by: Lacey-Anne Sanderson <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Manual Testing
GFF3 importer.
The change was in insertFeatureSeqs() so I tested
- using this test fixture
tripal_chado/tests/fixtures/gff3_loader/small_gene_with_fasta.gff - imported it with a default srcfeature type of scaffold
- created a scaffold content type and published it
- ✅ The residues and associated metadata showed up as expected
Newick Tree Loader
The change here was in the form when the sequence ontology is not present so I tested
- by updating the name of the sequence ontology to
Fredwhich did trigger the code... However, apparently the original code was checking too late and other errors appeared. - As such I make the code change in commit f73a8e6 with @dsenalik blessing
- ✅ Now loading the form shows the warning as expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Manual Testing
OBO Importer
The change here was in the stanza caching. This should be impacted on most obo loads so I tested by
- I used the local EDAM subset suggested by Doug
- On the obo imporer I selected "Add a New Ontology", included the path provided by Doug and set the same to "Local EDAM"
- ✅ I then ran the job and confirmed there were no errors as expected. If the changes had not worked, there would have been PDO errors.
Taxonomy Importer
Changes here were made in the following methods: findOrganism(), addOrganism(), and importRecord(). These will be hit on all jobs for this importer that has at least one organism. As such I tested by
-
Created the organism
Daucus muricatuswhich matches one of the ids in the next step through the Add Organism form (to test find when one exists). -
Imported the following ids
48026 48106 79170 79196 79200 180796using the "NCBI Taxonomy Importer" form and selected "Import details for existing species" -
When I ran the job it failed with the following error showing the updated query in addOrganism() did not work.
-
❌ I fixed this by adding the field to be selected to one of the queries (see commit 37bbd17) but it still failed as follows. Note: While I did add the one organism ahead of time and it does have an organism_id of 5, it did not have a dbxref_id assigned via organism_dbxref before the import.
sitedb=# select * from teapot.organism; organism_id | abbreviation | genus | species | common_name | infraspecific_name | type_id | comment -------------+--------------+----------+------------+-------------+--------------------+---------+--------- 1 | | Tripalus | databasica | | | | 5 | | Daucus | muricatus | | | | (2 rows) sitedb=# select * from teapot.organism_dbxref; organism_dbxref_id | organism_id | dbxref_id --------------------+-------------+----------- (0 rows)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Manual Testing
✅ GFF3 Importer
✅ Newick Tree Loader
✅ OBO Importer
✅ Taxonomy importer
✅ Tree Generator
✅ FASTA Importer
Taxonomy Importer
Changes here were made in the following methods: findOrganism(), addOrganism(), and importRecord(). These will be hit on all jobs for this importer that has at least one organism. As such I tested by
- Created the organism
Daucus muricatuswhich matches one of the ids in the next step through the Add Organism form (to test find when one exists). - Imported the following ids
48026 48106 79170 79196 79200 180796using the "NCBI Taxonomy Importer" form and selected "Import details for existing species" - When I ran the job, it completed without error as expected :-)
- ✅ After finding the new fields and re-publishing, I was able to confirm all the details are present both on the pre-existing
Daucus muricatusand one other organism.
Taxonomy Tree Generator
Changes were made in the run(), retrieveLineage(), removeTree(), and queryPhylonode(). I believe these changes will be best fit by regenerating an existing tree and trying to generate a tree that doesn't have an appropriate root organism.
- Tried to generate tree where the root taxon was "fabaceae" despite there being no organisms in the site for this family.
- ✅ Confirmed that the job ran with the expected error and that the initial record added by the importer was removed leaving an empty
phylotreetable.
- Used the importer to generate a tree for
Daucusgenus which there are 4 organism in the site. - ✅ the job ran without error, confirmed there were 4 organism which should be included and 2 which should not. Selecting from the database shows there are the expected phylonode records 🎉
FASTA Importer
Changes are made to loadFastaFeature(), specifically with reference to updating an existing feature. As such we are testing by
- Import features using the GFF3 importer and
/var/www/drupal/web/modules/contrib/tripal/tripal_chado/tests/fixtures/gff3_loader/gff_Citrus_sinensis-orange1.1g015632m.g.gff3 - Import the sequence for orange1.1g015632m using the FASTA importing using the
/var/www/drupal/web/modules/contrib/tripal/tripal_chado/tests/fixtures/fasta_loader/Citrus_sinensis-orange1.1g015632m.g.fasta - ✅ I confirmed that the sequence was imported and assigned to the residues field of the existing gene.
Tripal 4 Core Dev Task
Closes #2295
Depends on #2221(Merged)Depends on #2294(Merged)Description
PR #2294 will deprecate a number of
chado_api functions inherited from Tripal 3.This PR replaces them in various importers.
Testing?
Before testinggit merge origin/tv4g2-1341-deprecateChadoQueryAPIso that deprecated functions show up in testing.Automated tests should now catch any missed deprecations
Run each of the importers to verify that I have not broken anything.
To test obo importer on a local file you can use
modules/contrib/tripal/tripal_chado/tests/fixtures/obo_loader/test_EDAM.obo