Skip to content
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

Fixes Phase 1 of Issue #27 #103

Closed
wants to merge 6 commits into from

Conversation

Cateline
Copy link
Collaborator

Description

What kind of change(s) are included?

  • Feature (adds or updates new capabilities)
  • Bug fix (fixes an issue).
  • Enhancement (adds functionality).
  • Breaking change (these changes would cause existing functionality to not work as expected).

Checklist

Please ensure that all boxes are checked before indicating that this pull request is ready for review.

  • I have read and followed the CONTRIBUTING.md guidelines.
  • I have searched for existing content to ensure this is not a duplicate.
  • I have performed a self-review of these additions (including spelling, grammar, and related).
  • I have added comments to my code to help provide understanding.
  • I have added a test which covers the code changes found within this PR.
  • I have deleted all non-relevant text in this pull request template.
  • Reviewer assignment: Tag a relevant team member to review and approve the changes.
    @jananiravi @epbrenner

- Parsed the file in R.
- Mapped the CARD Short Name column to shortname_antibiotics.tsv and shortname_pathogens.tsv.
- Sorted and grouped the data by pathogens and antibiotics for analysis.
- Filtered for the pathogen "Klebsiella pneumoniae" and drug "CZA" for further analysis.
Created a new branch for cleaner modifications and updates.
Staged and committed the necessary unzipped files
Created a new branch for cleaner modifications and updates.
Staged and committed the necessary unzipped files
Klebsiella CARD Filtering Code.R Show resolved Hide resolved
Klebsiella CARD Filtering Code.R Show resolved Hide resolved
Klebsiella CARD Filtering Code.R Show resolved Hide resolved
R/Staphylococcus_aureus_DAP.R Show resolved Hide resolved
Copy link
Contributor

@falquaddoomi falquaddoomi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution! I think the overarching issue that you're running into is that the code you've added to the R folder isn't in functions and, because of that, is getting executed any time the library is loaded.

The code you're adding also appears to be scripts, not library functions, so I'd consider restructuring your PR as follows:

  • create a folder called case_studies, and one named CARD below that
  • move CARD_data, Klebsiella CARD Filtering Code.R, Klebsiella CARD Filtering Code.R and Staphylococcus_aureus_DAP_sequences4.fasta into the new CARD folder
  • remove CARD_AMR_Data_Integration.R (which appears to be a duplicate of Klebsiella CARD Filtering Code.R) and Staphylococcus_aureus_DAP.R from the R folder

You can at least submit your work at this point without it throwing off the automated checks.

If you'd like to go further and integrate your code into the package, I would do the following:

  1. Review the existing functions in the R folder to see how you'd write a new one
  2. Add a new file, say CARD_analyses.R to the R folder
  3. Create one or more functions that encapsulate what your script's functionality (e.g., downloading a dataset, loading it into a dataset, and/or returning a filtered version of a datatable), being sure to remove the print statements that you were using for debugging
  4. Generally, R packages shouldn't include library() calls, so you should either add #' @importFrom <package> <symbol1> <symbol2> (etc.) lines to your function's docstring, or use fully-qualified references, e.g. <library>::<method>() when calling a method from a specific library.

Hope that helps!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest removing the changes to this file from your PR. You can do so via git checkout main -- MolEvolvR.Rproj to revert it to what it was before your PR, then add and commit that original version.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file should likewise be removed from the PR, since it appears your scripts download it. You can run git rm --cached broadstreet-v3.3.0.tar.bz2 to remove it from the repo without removing your local copy of it.

Comment on lines +178 to +182
#Run FASTA Sequences Through MolEvolvR Web App

library("devtools")

devtools::check()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is likely what's causing that error you saw before about infinite recursion. Since the package is already being run by devtools::check(), running this within the package code is causing it to start a check within the check (and within that check, repeat ad infinitum...) You definitely don't need to call this within code that's part of the package.

@Cateline Cateline closed this Oct 19, 2024
@Cateline Cateline deleted the feature/card-data-processing branch October 19, 2024 11:00
@Cateline Cateline restored the feature/card-data-processing branch October 20, 2024 00:26
@Cateline Cateline reopened this Oct 20, 2024
@jananiravi jananiravi added outreachy for outreachy interns documentation Improvements or additions to documentation, incl. R docstring/roxygen2 labels Oct 20, 2024
Cateline added a commit to Cateline/MolEvolvR that referenced this pull request Oct 21, 2024
@Cateline Cateline closed this Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation, incl. R docstring/roxygen2 outreachy for outreachy interns
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants