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

Skip to content

Conversation

@dsenalik
Copy link
Contributor

@dsenalik dsenalik commented Sep 24, 2025

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 testing git merge origin/tv4g2-1341-deprecateChadoQueryAPI so 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

@dsenalik dsenalik added bug - potential For issues describing a potential bug that has not yet been shown repeatable by a core developer. Group 0 - Maintenance | Docker | Misc Any issue that doesn't fit into the other groups (i.e. docker, github actions) Group 9 - Automated Testing Any issue related to automated testing including needed test cases, concerns, etc. labels Sep 24, 2025
@qltysh
Copy link

qltysh bot commented Sep 24, 2025

2 new issues

Tool Category Rule Count
qlty Structure Function with many returns (count = 15): loadFastaFeature 2

@qltysh
Copy link

qltysh bot commented Sep 24, 2025

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
Path File Coverage Δ Indirect
tripal_chado/src/Plugin/TripalImporter/FASTAImporter.php 0.2
tripal_chado/src/Plugin/TripalImporter/GFF3Importer.php -0.1
tripal_chado/src/Plugin/TripalImporter/NewickImporter.php -0.2
tripal_chado/src/Plugin/TripalImporter/OBOImporter.php -0.2
tripal_chado/src/Plugin/TripalImporter/TaxonomyImporter.php 0.6
tripal_chado/src/Plugin/TripalImporter/TreeGenerator.php 0.4
tripal_chado/src/api/tripal_chado.organism.api.php 0.4
tripal_chado/src/api/tripal_chado.phylotree.api.php 0.2
tripal_chado/src/api/tripal_chado.query.api.php -0.6
🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

…I' into tv4g0-issue2295-remove-deprecated-functions-from-importers
…HPUnit 11.5). This should not fail on PHPUnit deprecations such as the getMockForAbstractClass().
@laceysanderson
Copy link
Member

laceysanderson commented Sep 25, 2025

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 #[IgnoreDeprecations]. This settings should not fail when the deprecations are caused by third-party code such as PHPunit so the long standing mock deprecations (See Issue #2249) can remain unaddressed for now 😅

…ers' of github.com:/tripal/tripal into tv4g0-issue2295-remove-deprecated-functions-from-importers
@dsenalik dsenalik marked this pull request as ready for review September 26, 2025 12:31
@dsenalik dsenalik added the Priority - Release Blocker Any issue/PR which needs to be addressed before another version of Tripal can be released. label Sep 26, 2025
Copy link
Member

@laceysanderson laceysanderson left a 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.

dsenalik and others added 4 commits September 29, 2025 10:48
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]>
Copy link
Member

@laceysanderson laceysanderson left a 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
Screenshot 2025-09-29 at 12 04 46 PM

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 Fred which 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.
Screenshot 2025-09-29 at 12 21 00 PM

Copy link
Member

@laceysanderson laceysanderson left a 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.
    Screenshot 2025-09-29 at 1 07 10 PM

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 muricatus which 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 180796 using 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.
    Screenshot 2025-09-29 at 1 22 06 PM

  • ❌ 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)
    Screenshot 2025-09-29 at 1 39 41 PM

Copy link
Member

@laceysanderson laceysanderson left a 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 muricatus which 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 180796 using 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 muricatus and one other organism.
    image
    image

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 phylotree table.
    Screenshot 2025-09-29 at 3 44 03 PM
  • Used the importer to generate a tree for Daucus genus 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 🎉
    Screenshot 2025-09-29 at 3 54 01 PM

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.
    image

@laceysanderson laceysanderson added the Ready to Merge 🎉 Any PR which has been approved + is just waiting on branch updates/tests. label Sep 29, 2025
@dsenalik dsenalik merged commit 9bf052f into 4.x Sep 29, 2025
15 of 16 checks passed
@dsenalik dsenalik deleted the tv4g0-issue2295-remove-deprecated-functions-from-importers branch September 29, 2025 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug - potential For issues describing a potential bug that has not yet been shown repeatable by a core developer. Group 0 - Maintenance | Docker | Misc Any issue that doesn't fit into the other groups (i.e. docker, github actions) Group 9 - Automated Testing Any issue related to automated testing including needed test cases, concerns, etc. Includes Deprecations Priority - Release Blocker Any issue/PR which needs to be addressed before another version of Tripal can be released. Ready to Merge 🎉 Any PR which has been approved + is just waiting on branch updates/tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove deprecated functions from importers

2 participants