Uploaded image for project: 'IGB'
  1. IGB
  2. IGBF-3470

Refactor code to not include library imports into Common.R

    Details

    • Type: Task
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

      To deploy Shiny Apps, we need to provide code for making plots. However, our current shared code in Common.R loads edgeR and DESeq2 libraries. As a result, any time a Shiny app loads the code in Common.R, it also goes through a long process of loading up those two libraries, which it doesn't actually need, since the R Shiny apps are only providing visualization, not statistical processing or analysis. So, let's move code that requires edgeR and/or DESeq2 out of Common.R into a different file.

      To do this, we'll need to modify a lot of the .Rmd files that use Common.R. They may need to now import both Common.R and the new statistical functions .R file instead of just Common.R.

      Suggestion for implementation strategy:

      • Loraine and/or Davis migrate the code out of Common.R?
      • Loraine and/or Davis update the rest of the code base?

        Attachments

          Activity

          Hide
          ann.loraine Ann Loraine added a comment -

          Completed code changes on branch IGBF-3459 (a different but related ticket) and merged to main. Moving to "ready for testing."

          To test:

          • check that all .Rmd files that import Common.R (by running source("Common.R") can still knit.
          Show
          ann.loraine Ann Loraine added a comment - Completed code changes on branch IGBF-3459 (a different but related ticket) and merged to main. Moving to "ready for testing." To test: check that all .Rmd files that import Common.R (by running source("Common.R") can still knit.
          Hide
          Mdavis4290 Molly Davis added a comment - - edited

          Testing:

          • CompareDEGenesByMethod.Rmd = Fail
            getCvS() function not available in new Common.R
          • FindControlVsStressDEGenes-SL4-DESeq2.Rmd = Pass
          • FindControlVsStressDEGenes-SL4-edgeR.Rmd = Pass
          • FindControlVsStressDEGenes-SL5-DESeq2.Rmd = Pass
          • FindControlVsStressDEGenes-SL5-edgeR.Rmd = Fail
            source("StatFuctions.R") doesn't load. The naming was incorrect and needs to be changed to "StatFunctions.R" in the markdown.
          • FindMutantVsWildtypeDEGenes-DESeq2.Rmd = Fail
            DESeqDataSetFromMatrix() function is not present in new Common.R script
          • FindTreatmentEffectAcrossGenotypes-DESeq2.Rmd = Fail
            DESeqDataSetFromMatrix() function is not present in new Common.R script
          • InvestigateF3H-and-MakeScaledCounts.Rmd = Pass
          • MakeMdsPlots.Rmd = Pass
          Show
          Mdavis4290 Molly Davis added a comment - - edited Testing : CompareDEGenesByMethod.Rmd = Fail getCvS() function not available in new Common.R FindControlVsStressDEGenes-SL4-DESeq2.Rmd = Pass FindControlVsStressDEGenes-SL4-edgeR.Rmd = Pass FindControlVsStressDEGenes-SL5-DESeq2.Rmd = Pass FindControlVsStressDEGenes-SL5-edgeR.Rmd = Fail source("StatFuctions.R") doesn't load. The naming was incorrect and needs to be changed to "StatFunctions.R" in the markdown. FindMutantVsWildtypeDEGenes-DESeq2.Rmd = Fail DESeqDataSetFromMatrix() function is not present in new Common.R script FindTreatmentEffectAcrossGenotypes-DESeq2.Rmd = Fail DESeqDataSetFromMatrix() function is not present in new Common.R script InvestigateF3H-and-MakeScaledCounts.Rmd = Pass MakeMdsPlots.Rmd = Pass
          Hide
          ann.loraine Ann Loraine added a comment - - edited

          Addressing above errors:

          • Moved getCvS function to Common.R. CompareDEGenesByMethod.Rmd now passes.
          • Tested FindControlVsStressDEGenes-SL4-DESeq2.Rmd, FindControlVsStressDEGenes-SL4-edgeR.Rmd, FindControlVsStressDEGenes-SL5-DESeq2.Rmd. They passed before and continue to pass now.
          • Edited FindControlVsStressDEGenes-SL5-edgeR.Rmd as recommended. Passes.
          • Edited FindMutantVsWildtypeDEGenes-DESeq2.Rmd. Added load command for DESeq2 library. Now it passes.
          • Edited FindTreatmentEffectAcrossGenotypes-DESeq2.Rmd. Added load command for DESeq2 library. Now it passes.
          • Tested InvestigateF3H-and-MakeScaledCounts.Rmd. Passes.
          • Tested MakeMdsPlots.Rmd. Passes.

          In addition to needing to put back getCvS into Common.R, I also had to add an adapted copy of strsplit2 function from the limma library. This was required for function getSL4GeneNames.

          Show
          ann.loraine Ann Loraine added a comment - - edited Addressing above errors: Moved getCvS function to Common.R. CompareDEGenesByMethod.Rmd now passes. Tested FindControlVsStressDEGenes-SL4-DESeq2.Rmd, FindControlVsStressDEGenes-SL4-edgeR.Rmd, FindControlVsStressDEGenes-SL5-DESeq2.Rmd. They passed before and continue to pass now. Edited FindControlVsStressDEGenes-SL5-edgeR.Rmd as recommended. Passes. Edited FindMutantVsWildtypeDEGenes-DESeq2.Rmd. Added load command for DESeq2 library. Now it passes. Edited FindTreatmentEffectAcrossGenotypes-DESeq2.Rmd. Added load command for DESeq2 library. Now it passes. Tested InvestigateF3H-and-MakeScaledCounts.Rmd. Passes. Tested MakeMdsPlots.Rmd. Passes. In addition to needing to put back getCvS into Common.R, I also had to add an adapted copy of strsplit2 function from the limma library. This was required for function getSL4GeneNames.
          Hide
          ann.loraine Ann Loraine added a comment -

          Merged into main and ready for testing, again.

          Show
          ann.loraine Ann Loraine added a comment - Merged into main and ready for testing, again.
          Hide
          Mdavis4290 Molly Davis added a comment -

          Testing: I pulled the updated code to my machine and tested the markdowns through knitting. I had no issues this time and ran into no errors with the markdowns.

          Moving to done!

          Show
          Mdavis4290 Molly Davis added a comment - Testing : I pulled the updated code to my machine and tested the markdowns through knitting. I had no issues this time and ran into no errors with the markdowns. Moving to done!

            People

            • Assignee:
              ann.loraine Ann Loraine
              Reporter:
              ann.loraine Ann Loraine
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: