Question: DESeq2 Dose not work
1
gravatar for 21464321
8 months ago by
214643210
214643210 wrote:

Hey Michael

DESeq2 dose not work and I receive this message when I try to run library(DESeq2)

library(DESeq2)
Loading required package: S4Vectors
Loading required package: stats4
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: ‘BiocGenerics’

The following objects are masked from ‘package:parallel’:

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ, clusterExport,
    clusterMap, parApply, parCapply, parLapply, parLapplyLB, parRapply, parSapply,
    parSapplyLB

The following objects are masked from ‘package:stats’:

    IQR, mad, sd, var, xtabs

The following objects are masked from ‘package:base’:

    anyDuplicated, append, as.data.frame, basename, cbind, colMeans, colnames,
    colSums, dirname, do.call, duplicated, eval, evalq, Filter, Find, get, grep,
    grepl, intersect, is.unsorted, lapply, lengths, Map, mapply, match, mget,
    order, paste, pmax, pmax.int, pmin, pmin.int, Position, rank, rbind, Reduce,
    rowMeans, rownames, rowSums, sapply, setdiff, sort, table, tapply, union,
    unique, unsplit, which, which.max, which.min


Attaching package: ‘S4Vectors’

The following object is masked from ‘package:base’:

    expand.grid

Loading required package: IRanges

Attaching package: ‘IRanges’

The following object is masked from ‘package:grDevices’:

    windows

Loading required package: GenomicRanges
Loading required package: GenomeInfoDb
Loading required package: SummarizedExperiment
Loading required package: Biobase
Welcome to Bioconductor

    Vignettes contain introductory material; view with 'browseVignettes()'. To
    cite Bioconductor, see 'citation("Biobase")', and for packages
    'citation("pkgname")'.

Loading required package: DelayedArray
Loading required package: matrixStats

Attaching package: ‘matrixStats’

The following objects are masked from ‘package:Biobase’:

    anyMissing, rowMedians

Loading required package: BiocParallel

Attaching package: ‘DelayedArray’

The following objects are masked from ‘package:matrixStats’:

    colMaxs, colMins, colRanges, rowMaxs, rowMins, rowRanges

The following objects are masked from ‘package:base’:

    aperm, apply

Error: package or namespace load failed for ‘DESeq2’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
 there is no package called ‘colorspace’
In addition: Warning messages:
1: package ‘DESeq2’ was built under R version 3.5.2 
2: package ‘matrixStats’ was built under R version 3.5.2

and when I try to run the following script

  data <- read.table("Single.cntTable",header=T,row.names=1)
groups <- factor(c(rep("TGroup",6),rep("CGroup",6)))
min_read <- 1
data <- data[apply(data,1,function(x){max(x)}) > min_read,]
sampleInfo <- data.frame(groups,row.names=colnames(data))
library(DESeq2, quietly=T)
dds <- DESeqDataSetFromMatrix(countData = data, colData = sampleInfo, design = ~ groups)
dds$condition = relevel(dds$groups,"CGroup")
dds <- DESeq(dds)
res <- results(dds,independentFiltering=F)
write.table(res, file="Single_gene_TE_analysis.txt", sep="\t",quote=F)

I receive this output

> data <- read.table("Single.cntTable",header=T,row.names=1)
> groups <- factor(c(rep("TGroup",6),rep("CGroup",6)))
> min_read <- 1
> data <- data[apply(data,1,function(x){max(x)}) > min_read,]
> sampleInfo <- data.frame(groups,row.names=colnames(data))
> library(DESeq2, quietly=T)
Error: package or namespace load failed for ‘DESeq2’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
 there is no package called ‘colorspace’
In addition: Warning message:
package ‘DESeq2’ was built under R version 3.5.2 
> dds <- DESeqDataSetFromMatrix(countData = data, colData = sampleInfo, design = ~ groups)
Error in DESeqDataSetFromMatrix(countData = data, colData = sampleInfo,  : 
  could not find function "DESeqDataSetFromMatrix"
> dds$condition = relevel(dds$groups,"CGroup")
Error in relevel(dds$groups, "CGroup") : object 'dds' not found
> dds <- DESeq(dds)
Error in DESeq(dds) : could not find function "DESeq"
> res <- results(dds,independentFiltering=F)
Error in results(dds, independentFiltering = F) : 
  could not find function "results"
> write.table(res, file="Single_gene_TE_analysis.txt", sep="\t",quote=F)
Error in is.data.frame(x) : object 'res' not found

I wonder if you could help me please

thanks

Sam

deseq2 • 429 views
ADD COMMENTlink modified 8 months ago by Martin Morgan ♦♦ 23k • written 8 months ago by 214643210
Answer: DESeq2 Dose not work
0
gravatar for Michael Love
8 months ago by
Michael Love25k
United States
Michael Love25k wrote:

Try reinstalling Bioconductor

ADD COMMENTlink written 8 months ago by Michael Love25k

Thanks Michael, I've already done that but nothing changed. DESeq2 does not work. I've reinstalled R and R studio, I've tried to run this code which I run it successfully many times before

>     data <- read.table("Single.cntTable",header=T,row.names=1)
groups <- factor(c(rep("TGroup",6),rep("CGroup",6)))
min_read <- 1
data <- data[apply(data,1,function(x){max(x)}) > min_read,]
sampleInfo <- data.frame(groups,row.names=colnames(data))
library(DESeq2, quietly=T)
dds <- DESeqDataSetFromMatrix(countData = data, colData = sampleInfo, design = ~ groups)
dds$condition = relevel(dds$groups,"CGroup")
dds <- DESeq(dds)
res <- results(dds,independentFiltering=F)
write.table(res, file="Single_gene_TE_analysis.txt", sep="\t",quote=F)
resSig <- res[(!is.na(res$padj) & (res$padj < 0.050000) & (abs(res$log2FoldChange)> 0.000000)), ]
resSig
write.table(resSig, file="Single_sigdiff_gene_TE.txt",sep="\t", quote=F)enter code here

I got this output whenever try to run it again

 > data <- read.table("Single.cntTable",header=T,row.names=1)
> groups <- factor(c(rep("TGroup",6),rep("CGroup",6)))
> min_read <- 1
> data <- data[apply(data,1,function(x){max(x)}) > min_read,]
> sampleInfo <- data.frame(groups,row.names=colnames(data))
> library(DESeq2, quietly=T)
Error: package or namespace load failed for ‘DESeq2’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
 there is no package called ‘rlang’
> dds <- DESeqDataSetFromMatrix(countData = data, colData = sampleInfo, design = ~ groups)
Error in DESeqDataSetFromMatrix(countData = data, colData = sampleInfo,  : 
  could not find function "DESeqDataSetFromMatrix"
> dds$condition = relevel(dds$groups,"CGroup")
Error in relevel(dds$groups, "CGroup") : object 'dds' not found
> dds <- DESeq(dds)
Error in DESeq(dds) : could not find function "DESeq"
> res <- results(dds,independentFiltering=F)
Error in results(dds, independentFiltering = F) : 
  could not find function "results"
> write.table(res, file="Single_gene_TE_analysis.txt", sep="\t",quote=F)
Error in is.data.frame(x) : object 'res' not found
> resSig <- res[(!is.na(res$padj) & (res$padj < 0.050000) & (abs(res$log2FoldChange)> 0.000000)), ]
Error: object 'res' not found
> resSig
Error: object 'resSig' not found
> write.table(resSig, file="Single_sigdiff_gene_TE.txt",sep="\t", quote=F)
Error in is.data.frame(x) : object 'resSig' not found
>
ADD REPLYlink written 8 months ago by 214643210

All I can see from this code is that DESeq2 isn’t installled. All the errors are that the software isn’t loaded. Not sure how to help any more.

ADD REPLYlink written 8 months ago by Michael Love25k

I feel like I've had a similar problem with another package before. It had something to do with only source version of the package being available. Try installing the packages that give you an error manually. For example, where it says: there is no package called ‘rlang’ dds Manually install rlang and then re-try DESeq2.

ADD REPLYlink modified 8 months ago • written 8 months ago by lefeverde10

Start at the first error

> library(DESeq2, quietly=T)
Error: package or namespace load failed for ‘DESeq2’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
 there is no package called ‘rlang’

and fix it (by installing rlang).

ADD REPLYlink written 8 months ago by Martin Morgan ♦♦ 23k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 161 users visited in the last hour