Giter Club home page Giter Club logo

Comments (11)

AMChalkie avatar AMChalkie commented on May 25, 2024 1

Thanks for the coding note. I'm still not used to the tidy way, so much appreciated.

from tidybulk.

AMChalkie avatar AMChalkie commented on May 25, 2024 1

That worked just fine, excellent :) Nice work.

I would still change the error message to be:

tidybulk says: for DESeq2 the list of constrasts should be given in the form list(c("condition_column","condition1","condition2")) i.e. list(c("genotype","knockout","wildtype")).

rather than

tidybulk says: for DESeq2 the list of constrasts should be given of the form list(c("condition","C","B"))

from tidybulk.

stemangiola avatar stemangiola commented on May 25, 2024

Hello @AMChalkie . We though we fixed it. Indeed the workshop material shows expected results.

Could you please execute the section

https://stemangiola.github.io/biocasia2020_tidytranscriptomics/articles/tidytranscriptomics.html#differential-expression-1

and tell us if you still see the opposite results. In this way we can understand where the issue lies.

[EDIT]

I see, you are defining contrasts. Sorry this is bad bug! I will take care of it ASAP, also adding those tests.

from tidybulk.

stemangiola avatar stemangiola commented on May 25, 2024

Some notes on coding.

You don't necessarily need to replicate code. This would suffice:

counts_de.voom <-
   tt.aggr %>% 

   identify_abundant(factor_of_interest = genotype) %>% 

   test_differential_abundance(
      .formula = ~ 0 + genotype, # + cell,
      .contrasts = c("genotypeKI - genotypeWT"),
      method = "limma_voom", # edgeR_quasi_likelihood", # Alternative method. "limma_voom",
      omit_contrast_in_colnames = TRUE,
      prefix= "limma_voom."
   ) %>%

   test_differential_abundance(
      .formula = ~ 0 + genotype, # + cell,
.      contrasts = c("genotypeKI - genotypeWT"),
      method = "edgeR_quasi_likelihood", # Alternative method. "limma_voom",
      omit_contrast_in_colnames = TRUE,
      prefix= "edgeR_quasi_likelihood."
  ) %>%

  test_differential_abundance(
    .formula = ~ 0 + genotype, # + cell,
.    contrasts = c("genotypeKI - genotypeWT"),
    method = "DESeq2", # Alternative method. "limma_voom",
    omit_contrast_in_colnames = TRUE,
    prefix= "DESeq2."
 )

from tidybulk.

stemangiola avatar stemangiola commented on May 25, 2024

Hello @AMChalkie I have created a pull request. Could you please check that the respective branch leads to expected results on your side?

That would be much appreciated.

from tidybulk.

AMChalkie avatar AMChalkie commented on May 25, 2024

Not yet:

tidybulk says: All methods use raw counts,
irrespective of if scale_abundance or adjust_abundance have been calculated,
therefore it is essential to add covariates such as batch effects (if applicable) in the formula.
Error in get_differential_transcript_abundance_deseq2(., .formula, .sample = !!.sample, :
tidybulk says: for the moment, the .contrasts argument for
DESeq2 gets directly passed to DESeq2 method.
Contrasts must be a list that contains contrasts of
the form c("condition","C","B")
Called from: get_differential_transcript_abundance_deseq2(., .formula, .sample = !!.sample,
.transcript = !!.transcript, .abundance = !!.abundance, .contrasts = .contrasts,
method = method, scaling_method = scaling_method, omit_contrast_in_colnames = omit_contrast_in_colnames,
prefix = prefix)

from tidybulk.

stemangiola avatar stemangiola commented on May 25, 2024

Maybe I should improve this message

for the moment, the .contrasts argument for
DESeq2 gets directly passed to DESeq2 method.
Contrasts must be a list that contains contrasts of
the form c("condition","C","B")

Is not self-explanatory? Feel also free to edit it directly in the repo if you can think about something clearer for users.

from tidybulk.

AMChalkie avatar AMChalkie commented on May 25, 2024

For documentation:

for the moment, the .contrasts argument for
DESeq2 gets directly passed to DESeq2 method.
Contrasts must be a list that contains contrasts of
the form c("factorName","numeratorLevel","denominatorLevel")

I would have expected that this would work, but no...:

tt.aggr %>% identify_abundant(factor_of_interest = genotype) %>%
test_differential_abundance(
.formula = ~ 0 + genotype,
.contrasts = c('genotype','KI','WT'),
method = "DESeq2",
omit_contrast_in_colnames = TRUE,
prefix= "DESeq2."
)
tidybulk says: All methods use raw counts,
irrespective of if scale_abundance or adjust_abundance have been calculated,
therefore it is essential to add covariates such as batch effects (if applicable) in the formula.
estimating size factors
estimating dispersions
gene-wise dispersion estimates
mean-dispersion relationship
final dispersion estimates
fitting model and testing
Error in checkContrast(contrast, resNames) :
'contrast', as a character vector of length 3, should have the form:
contrast = c('factorName','numeratorLevel','denominatorLevel'),
see the manual page of ?results for more information
In addition: Warning message:
In get_differential_transcript_abundance_deseq2(., .formula, .sample = !!.sample, :
tidybulk says: you can omit contrasts in column names only when maximum one contrast is present
Called from: checkContrast(contrast, resNames)

Also, this is after removing the check for equals("list") as it failed here otherwise.

.contrasts %>% is.null %>% not() &
.contrasts %>% class %>% equals("list") #%>% not()

from tidybulk.

stemangiola avatar stemangiola commented on May 25, 2024

"a list that contains contrasts"

list(c('genotype','KI','WT'))

As you can specify many contrast combinations (similarly to edgeR)

Maybe I should be more explicit

from tidybulk.

stemangiola avatar stemangiola commented on May 25, 2024

I see the other problem. Tomorrow I fix everything

from tidybulk.

stemangiola avatar stemangiola commented on May 25, 2024

Hello @AMChalkie could you please reinstall this branch and try again? I have improve error messages. Let's see if it guides you better.

from tidybulk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.