Update regex patterns for feature ID extraction#9
Closed
AbhirupaGhosh wants to merge 9 commits intomainfrom
Closed
Update regex patterns for feature ID extraction#9AbhirupaGhosh wants to merge 9 commits intomainfrom
AbhirupaGhosh wants to merge 9 commits intomainfrom
Conversation
epbrenner
reviewed
Jan 28, 2026
Contributor
epbrenner
left a comment
There was a problem hiding this comment.
Lots of reformatting, so this is going to take me a little longer than I expected, but the regex parse fix looks appropriate. Will test tomorrow to confirm and then approve or fix as needed. Thanks for getting to the bottom of this latest quirk.
| DBI::dbExecute( | ||
| con, | ||
| glue::glue('CREATE TABLE IF NOT EXISTS {meta_table} ( | ||
| glue::glue("CREATE TABLE IF NOT EXISTS {meta_table} ( |
Contributor
There was a problem hiding this comment.
I can run this in the morning, but I think DuckDB requires single quotes for these strings to be interpreted as strings, and if we're gluing this into a command then double quotes might not work properly. Will check.
Comment on lines
+825
to
+826
| proteinID = stringr::str_extract(value, "^fig\\|[0-9]+\\.[0-9]+\\.peg(?:sc)?\\.[0-9]+"), | ||
| locus_tag = stringr::str_match(value, "peg(?:sc)?\\.[0-9]+\\|([^\\s]+)")[, 2], |
Contributor
There was a problem hiding this comment.
Makes sense as a fix. Again, will run ASAP and confirm before approving.
Rename the original cleanData to cleanMetaData and add roxygen skeleton. Introduce a writeCompressedParquet helper and export cleaned metadata, AMR phenotype, genome data and original metadata to compressed Parquet files, then create a separate DuckDB (parquet-backed) with views for metadata, amr_phenotype, genome_data and original_metadata. Reintroduce a new cleanData function focused on feature matrices (genes/proteins/domains/etc.) that writes feature tables to Parquet and creates corresponding views; remove duplicated metadata parquet exports from the feature-matrix flow. Minor whitespace and path-handling adjustments to normalize paths and ensure output directories exist.
Fixed trailing zero bug, fixed FTP timeout bug (?), fixed empty files hanging downloads, fixed imbalanced genome data sets (e.g., no .fna, yes .faa, yes .gff)
Added a function to parse CD-HIT .clstr output into a long-format mapping of clusters to member feature ids. Updated database writing logic to include the new protein members table.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
fixing #8
What kind of change(s) are included?
Checklist
Please ensure that all boxes are checked before indicating that this pull request is ready for review.