Skip to content

RefineSchema reimplementation#135

Open
rfm-targa wants to merge 10 commits into
mainfrom
Refactor
Open

RefineSchema reimplementation#135
rfm-targa wants to merge 10 commits into
mainfrom
Refactor

Conversation

@rfm-targa

Copy link
Copy Markdown
Collaborator

This PR adds a reimplementation of the RefineSchema/IdentifySpuriousLoci module.

The new implementation aims to simplify and optimize the whole process. This was achieved by reducing the complexity of the workflow, which had multiple intermediate steps that were redundant or unnecessary to efficiently determine the end results, and of the data structures used, which were too nested, affecting readability and the long-term maintainability of the code. The reimplementation aims to improve the accuracy of the results and to provide output files with the most relevant data for users to be able to make well-informed decisions when evaluating the recommendations.

The main changes added by this PR are the following:

  • Implemented a more simple approach to evaluate the loci in schemas or a FASTA file with CDSs.
  • Removed the majority of the code used by the previous implementation.
  • Removed the schema_vs_schema run mode. The schema run mode now accepts any number of schemas.
  • Add parameters to define and exclude loci based on the percentage of special classifications in the allelic profiles and the frequency of the loci in the dataset.
  • Add an integer identifier to the group separators in the recommendations file to allow searching for specific groups.
  • Add the creation of a TSV file with data for all Query-Subject matches evaluated to determine the final recommendations. This file includes data that can help users decide the action to apply for each specific locus/representative CDS in the recommendations file.
  • Updated class assignment to better match the logic flow described in the documentation. Added assignment of class 6 for cases that only match through BLASTn, class 7 to cases that have no matches, and class 8 for all loci/representative CDSs that are excluded due to having a high percentage of special classifications and/or being infrequent.

rfm-targa added 7 commits May 5, 2026 09:24
… to store the relevant values for the unclassified_cds run mode. Improve class assignment compared to previous commit. Remove deprecated code.
…CDS and loci frequencies. Add prints with information about class and action counts. Add final cleanup. Start working on the simplification of the schema run mode.
…nt and locus exclusion based on the fraction of special classifications. Store data about why a locus was excluded. Remove the schema_vs_schema run mode. The schema run mode now accepts any number of schemas. Add creation of a TSV file with data about all BLAST matches. Add class 6 to classify alignment pairs that only matched through BLASTn.
… data for all matches. Remove deprecated code.
…tive seqids/loci. Compartmentalize code into functions that are called at different points. Add code to create FASTA files for the final groups in the 'cds' run mode.
@rfm-targa rfm-targa self-assigned this May 19, 2026
@rfm-targa rfm-targa added the enhancement New feature or request label May 19, 2026
rfm-targa added 3 commits May 19, 2026 18:04
… reduce redundancy. Add the -qcov_hsp_perc and -subject_besthit to run BLAST and get fewer low-scoring matches.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant