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

Fix bug in MutantvsWildtype markdown

    Details

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

      Description

      Markdown: FindMutantVsWildtypeDEGenes-DESeq2.Rmd

      Code issue: v = rs$padj<=Q & rs$log2FoldChange>=lfcThreshold

      The issue with this code is that it only includes the greater than or equal to log2foldchange of just 1 and we want to include -1 as well. To fix this use the abs() function. The comps values (# of genes) should be higher after this is fixed.

        Attachments

          Activity

          Mdavis4290 Molly Davis created issue -
          Mdavis4290 Molly Davis made changes -
          Field Original Value New Value
          Epic Link IGBF-3446 [ 22548 ]
          Mdavis4290 Molly Davis made changes -
          Rank Ranked higher
          Mdavis4290 Molly Davis made changes -
          Summary Fix bug in MutantvsWildtype markdown and include absolute value for log2foldchange Fix bug in MutantvsWildtype markdown which includes adding absolute value for log2foldchange
          Mdavis4290 Molly Davis made changes -
          Status To-Do [ 10305 ] In Progress [ 3 ]
          Hide
          Mdavis4290 Molly Davis added a comment - - edited

          Bug Update: The abolsute value function, abs(), worked with the code and counts genes with a -1 and 1 log2foldchange threshold.

          Edits in markdown:

          v = rs$padj<=Q & abs(rs$log2FoldChange)>=lfcThreshold
          

          Checking the method code: To check if this method was working accurately, I made a separate script that grabbed just one group and performed the same strategy and saved the results as a csv and went through the file and saw that the statement was true and that the adjusted pvalues were all less than or equal to 0.01 and the log2fold change threshold was >= 1 or <=-1.

          res= read.csv('MvW-SL5.txt',sep = "\t",stringsAsFactors = F,
                            header=T)
          
          V.34.75 <- res[res$group1 == 'V.34.75',]
          V.34.75
          
          V.34.75 <-data.frame(V.34.75)
          final1 <- subset(V.34.75, padj<=0.01 & log2FoldChange>=1)
          final2 <- subset(V.34.75, padj<=0.01 & log2FoldChange<=-1)
          final <- rbind(final1, final2)
          final <- data.frame(final)
          nrow(final)
          write.csv(final, "/Users/mollydavis333/Desktop/finalresults.csv", row.names=FALSE, quote=FALSE) 
          

          Note: There are more result conditions required in the markdown compared to my script so numbers my vary by small amounts but the statements are accurate and perform the required task of fixing the threshold bug in the markdown.

          Show
          Mdavis4290 Molly Davis added a comment - - edited Bug Update : The abolsute value function, abs(), worked with the code and counts genes with a -1 and 1 log2foldchange threshold. Edits in markdown : v = rs$padj<=Q & abs(rs$log2FoldChange)>=lfcThreshold Checking the method code : To check if this method was working accurately, I made a separate script that grabbed just one group and performed the same strategy and saved the results as a csv and went through the file and saw that the statement was true and that the adjusted pvalues were all less than or equal to 0.01 and the log2fold change threshold was >= 1 or <=-1. res= read.csv('MvW-SL5.txt',sep = "\t" ,stringsAsFactors = F, header=T) V.34.75 <- res[res$group1 == 'V.34.75',] V.34.75 V.34.75 <-data.frame(V.34.75) final1 <- subset(V.34.75, padj<=0.01 & log2FoldChange>=1) final2 <- subset(V.34.75, padj<=0.01 & log2FoldChange<=-1) final <- rbind(final1, final2) final <- data.frame( final ) nrow( final ) write.csv( final , "/Users/mollydavis333/Desktop/finalresults.csv" , row.names=FALSE, quote=FALSE) Note: There are more result conditions required in the markdown compared to my script so numbers my vary by small amounts but the statements are accurate and perform the required task of fixing the threshold bug in the markdown.
          Mdavis4290 Molly Davis made changes -
          Summary Fix bug in MutantvsWildtype markdown which includes adding absolute value for log2foldchange Fix bug in MutantvsWildtype markdown
          Hide
          Mdavis4290 Molly Davis added a comment -

          Branch: https://bitbucket.org/mdavis4290/molly4-flavonoid-rnaseq/branch/IGBF-3487

          Files to review:

          • FindMutantVsWildtypeDEGenes-DESeq2.Rmd
          • FindMutantVsWildtypeDEGenes-DESeq2.pdf

          Check to see if the data frame 'comps' accurately displays the correct number of genes that have an adjusted pvalue less than or equal to 0.01 and the log2fold change threshold was >= 1 or <=-1.

          Show
          Mdavis4290 Molly Davis added a comment - Branch : https://bitbucket.org/mdavis4290/molly4-flavonoid-rnaseq/branch/IGBF-3487 Files to review: FindMutantVsWildtypeDEGenes-DESeq2.Rmd FindMutantVsWildtypeDEGenes-DESeq2.pdf Check to see if the data frame 'comps' accurately displays the correct number of genes that have an adjusted pvalue less than or equal to 0.01 and the log2fold change threshold was >= 1 or <=-1.
          Mdavis4290 Molly Davis made changes -
          Assignee Molly Davis [ molly ]
          Mdavis4290 Molly Davis made changes -
          Status In Progress [ 3 ] Needs 1st Level Review [ 10005 ]
          ann.loraine Ann Loraine made changes -
          Status Needs 1st Level Review [ 10005 ] First Level Review in Progress [ 10301 ]
          ann.loraine Ann Loraine made changes -
          Status First Level Review in Progress [ 10301 ] Ready for Pull Request [ 10304 ]
          ann.loraine Ann Loraine made changes -
          Assignee Molly Davis [ molly ]
          Hide
          ann.loraine Ann Loraine added a comment - - edited

          Reviewed and ready for pull request.

          However, before you do that, please also fix the same bug that appears earlier in the code.
          Change: :

            vs[[assembly]] = rss[[assembly]]$padj<=Q &
              rss[[assembly]]$log2FoldChange>=lfcThreshold
          

          to:

            vs[[assembly]] = rss[[assembly]]$padj<=Q &
              abs(rss[[assembly]]$log2FoldChange)>=lfcThreshold
          

          attn: [~molly]

          Show
          ann.loraine Ann Loraine added a comment - - edited Reviewed and ready for pull request. However, before you do that, please also fix the same bug that appears earlier in the code. Change: : vs[[assembly]] = rss[[assembly]]$padj<=Q & rss[[assembly]]$log2FoldChange>=lfcThreshold to: vs[[assembly]] = rss[[assembly]]$padj<=Q & abs(rss[[assembly]]$log2FoldChange)>=lfcThreshold attn: [~molly]
          Show
          Mdavis4290 Molly Davis added a comment - PR : https://bitbucket.org/hotpollen/flavonoid-rnaseq/pull-requests/32
          ann.loraine Ann Loraine made changes -
          Status Ready for Pull Request [ 10304 ] Pull Request Submitted [ 10101 ]
          ann.loraine Ann Loraine made changes -
          Status Pull Request Submitted [ 10101 ] Reviewing Pull Request [ 10303 ]
          ann.loraine Ann Loraine made changes -
          Status Reviewing Pull Request [ 10303 ] Merged Needs Testing [ 10002 ]
          ann.loraine Ann Loraine made changes -
          Assignee Molly Davis [ molly ]
          Mdavis4290 Molly Davis made changes -
          Assignee Robert Reid [ robertreid ]
          ann.loraine Ann Loraine made changes -
          Rank Ranked higher
          Hide
          Mdavis4290 Molly Davis added a comment - - edited

          Testing:

          Markdown = FindMutantVsWildtypeDEGenes-DESeq2.Rmd

          • There was a bug with the 'comps' table shown in the knitted markdown. The bug had an issue with the threshold only counting greater than or equal to 1 and not less than or equal to -1 also. This made the sum of DE genes in the table wrong. This ticket fixes this issue and updated the code with the abs() function.
          • Please pull this file down to your machine (https://bitbucket.org/hotpollen/flavonoid-rnaseq/src/main/72_F3H_PollenTube/FindMutantVsWildtypeDEGenes-DESeq2.Rmd) and knit the markdown.
          • If knitting has no errors, next check the FindMutantVsWildtypeDEGenes-DESeq2.pdf out put file and check the 'comps' table in the pdf as well.
          Show
          Mdavis4290 Molly Davis added a comment - - edited Testing : Markdown = FindMutantVsWildtypeDEGenes-DESeq2.Rmd There was a bug with the 'comps' table shown in the knitted markdown. The bug had an issue with the threshold only counting greater than or equal to 1 and not less than or equal to -1 also. This made the sum of DE genes in the table wrong. This ticket fixes this issue and updated the code with the abs() function. Please pull this file down to your machine ( https://bitbucket.org/hotpollen/flavonoid-rnaseq/src/main/72_F3H_PollenTube/FindMutantVsWildtypeDEGenes-DESeq2.Rmd ) and knit the markdown. If knitting has no errors, next check the FindMutantVsWildtypeDEGenes-DESeq2.pdf out put file and check the 'comps' table in the pdf as well.
          Hide
          robofjoy Robert Reid added a comment -

          I pulled the code down.

          I knitted. All good.

          Created a PDF.

          But I have not yet had a chance to look at the details in the PDF.

          And I have been separated from laptop where I do this! (Main campus woes)
          Will recreate on this machine.

          Show
          robofjoy Robert Reid added a comment - I pulled the code down. I knitted. All good. Created a PDF. But I have not yet had a chance to look at the details in the PDF. And I have been separated from laptop where I do this! (Main campus woes) Will recreate on this machine.
          ann.loraine Ann Loraine made changes -
          Sprint Fall 5 [ 181 ] Fall 5, Fall 6 [ 181, 182 ]
          ann.loraine Ann Loraine made changes -
          Rank Ranked higher
          Hide
          robofjoy Robert Reid added a comment -

          I have read through the PDF, and that looks good.

          It is readable and straightforward.

          Let's check it off as done?

          Show
          robofjoy Robert Reid added a comment - I have read through the PDF, and that looks good. It is readable and straightforward. Let's check it off as done?
          robofjoy Robert Reid made changes -
          Assignee Robert Reid [ robertreid ] Molly Davis [ molly ]
          Hide
          Mdavis4290 Molly Davis added a comment -

          Thanks [~RobertReid]

          Moving to Done!

          Show
          Mdavis4290 Molly Davis added a comment - Thanks [~RobertReid] Moving to Done!
          Mdavis4290 Molly Davis made changes -
          Status Merged Needs Testing [ 10002 ] Post-merge Testing In Progress [ 10003 ]
          Mdavis4290 Molly Davis made changes -
          Resolution Done [ 10000 ]
          Status Post-merge Testing In Progress [ 10003 ] Closed [ 6 ]

            People

            • Assignee:
              Mdavis4290 Molly Davis
              Reporter:
              Mdavis4290 Molly Davis
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: