Commit 59a65b9b authored by tekath's avatar tekath
Browse files

change in how numeric group definitions are handled in DTU and DGE compoarison.

parent 0ed40a7e
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -155,11 +155,11 @@ run_deseq2 <- function(counts, pd, id_col=NULL, cond_col, cond_levels=NULL, lfc_

    if(is.null(id_col)){
        assertthat::assert_that(all(rownames(pd) %in% colnames(counts)), msg = "Provided id_col does not match with sample names in counts.")
        samp <- data.frame("sample_id"=rownames(pd), "condition"=pd[[cond_col]],
        samp <- data.frame("sample_id"=rownames(pd), "condition"=as.character(pd[[cond_col]]),
                           pd[,-c(which(colnames(pd)==cond_col)),drop=FALSE],
                           row.names = NULL, stringsAsFactors = FALSE)
    }else{
        samp <- data.frame("sample_id"=pd[[id_col]], "condition"=pd[[cond_col]],
        samp <- data.frame("sample_id"=pd[[id_col]], "condition"=as.character(pd[[cond_col]]),
                           pd[,-c(which(colnames(pd) %in% c(id_col, cond_col))),drop=FALSE],
                           row.names = NULL, stringsAsFactors = FALSE)
    }
@@ -243,7 +243,7 @@ run_deseq2 <- function(counts, pd, id_col=NULL, cond_col, cond_levels=NULL, lfc_
    dds <- do.call(DESeq2::DESeq, c(list("object"=dds), use_deseq_opts))

    #prepare LFC shrinking
    use_lfc_shrink_opts <- list("coef"=make.names(paste0("condition_",cond_levels[[1]],"_vs_",cond_levels[[2]])),
    use_lfc_shrink_opts <- list("coef"=paste0("condition_",make.names(cond_levels[[1]]),"_vs_",make.names(cond_levels[[2]])),
                                "type"="apeglm",
                                "svalue"=TRUE,
                                "lfcThreshold"=lfc_threshold,
+2 −2
Original line number Diff line number Diff line
@@ -339,11 +339,11 @@ run_drimseq <- function(counts, tx2gene, pd, id_col=NULL, cond_col, cond_levels=

    if(is.null(id_col)){
      assertthat::assert_that(all(rownames(pd) %in% colnames(counts)), msg = "Provided id_col does not match with sample names in counts.")
      samp <- data.frame("sample_id"=rownames(pd), "condition"=pd[[cond_col]],
      samp <- data.frame("sample_id"=rownames(pd), "condition"=as.character(pd[[cond_col]]),
                         pd[,-c(which(colnames(pd)==cond_col)),drop=FALSE],
                         row.names = NULL, stringsAsFactors = FALSE)
    }else{
      samp <- data.frame("sample_id"=pd[[id_col]], "condition"=pd[[cond_col]],
      samp <- data.frame("sample_id"=pd[[id_col]], "condition"=as.character(pd[[cond_col]]),
                         pd[,-c(which(colnames(pd) %in% c(id_col, cond_col))),drop=FALSE],
                         row.names = NULL, stringsAsFactors = FALSE)
    }
+13 −13

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1
Original line number Diff line number Diff line
@@ -135,7 +135,7 @@
      <h1 data-toc-skip>Pre-processing of the Hoffman et al. human bulk RNA-seq data</h1>
                        <h4 class="author">Tobias Tekath</h4>
            
            <h4 class="date">2021-07-04</h4>
            <h4 class="date">2021-07-09</h4>
      
      <small class="dont-index">Source: <a href="https://github.com/TobiTekath/DTUrtle/blob/master/vignettes/Hoffman_human_bulk_preprocess.Rmd"><code>vignettes/Hoffman_human_bulk_preprocess.Rmd</code></a></small>
      <div class="hidden name"><code>Hoffman_human_bulk_preprocess.Rmd</code></div>
+36 −35

File changed.

Preview size limit exceeded, changes collapsed.

Loading