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

          Hide
          Mdavis4290 Molly Davis added a comment -

          Thanks [~RobertReid]

          Moving to Done!

          Show
          Mdavis4290 Molly Davis added a comment - Thanks [~RobertReid] Moving to Done!
          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?
          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.
          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.
          Show
          Mdavis4290 Molly Davis added a comment - PR : https://bitbucket.org/hotpollen/flavonoid-rnaseq/pull-requests/32
          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]
          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.
          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.

            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: