Question: Error when running ddsHTSeq command in DESeq2
0
gravatar for Gabrielle.corso
14 months ago by
Gabrielle.corso0 wrote:

Hi there- I am trying to analyze RNA seq counts in R and am receiving an error code when running this chunk of code:

    # mRNA profiles of 
    # control group (WT), * 
    # knockout group (PG100), *

sampleNames <- c("WT_A","WT_B","WT_C","PG100_A","PG100_B","PG100_C")
sampleCondition <- c("control","control","control","PG100","PG100","PG100")       

sampleTable <- data.frame(sampleName=sampleNames,
                          fileName=sampleFiles,
                          condition=sampleCondition)

ddsHTSeq <- DESeqDataSetFromHTSeqCount(sampleTable=sampleTable,
                                       directory=directory,
                                       design=~condition)

Error in DESeqDataSetFromHTSeqCount(sampleTable = sampleTable, directory = directory, : could not find function "DESeqDataSetFromHTSeqCount"

Also--- I have already loaded the DESeq2 library and set my working directory to where the .counts files exist previous to running this chunk. Thank you in advance.

rna-seq • 738 views
ADD COMMENTlink modified 14 months ago by h.mon27k • written 14 months ago by Gabrielle.corso0

Did you issue:

library(DESeq2)

I have already loaded the DESeq2 library

How did you load it? Any messages when you loaded it?

ADD REPLYlink modified 14 months ago • written 14 months ago by h.mon27k

Yes- I have attached below. I also just updated my R studio to the most recent version (1.1.453).

> install.packages("DESeq2")
Warning in install.packages :
  package ‘DESeq2’ is not available (for R version 3.4.3)
> 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, cbind, colMeans, colnames, colSums, 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
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


Attaching package: ‘DelayedArray’

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

    colMaxs, colMins, colRanges, rowMaxs, rowMins, rowRanges

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

    apply
ADD REPLYlink modified 14 months ago by h.mon27k • written 14 months ago by Gabrielle.corso0

I added code markup to your post for increased readability. You can do this by selecting the text and clicking the 101010 button. When you compose or edit a post that button is in your toolbar, see image below:

101010 Button

ADD REPLYlink written 14 months ago by h.mon27k
0
gravatar for h.mon
14 months ago by
h.mon27k
Brazil
h.mon27k wrote:

install.packages("DESeq2")

Warning in install.packages : package ‘DESeq2’ is not available (for R version 3.4.3)

Install DESeq2 using BioConductor (you only have to do this once):

source("https://bioconductor.org/biocLite.R")
biocLite("DESeq2")

If installation fails, post the errors here.

EDIT: sorry, I didn't see past the install.packages() error (again, you have to install the package just once, then you can comment out this line of the code).

DESeq2 seems to be loading correctly. What is the output of sessionInfo()? What does ?DESeqDataSetFromHTSeqCount shows?

ADD COMMENTlink modified 14 months ago • written 14 months ago by h.mon27k

Here is my new code chunk and this is the new error : "Error in file.path(directory, fn) : object 'directory' not found"

Sinorhizobium DESeq2

source("https://bioconductor.org/biocLite.R") Bioconductor version 3.6 (BiocInstaller 1.28.0), ?biocLite for help A new version of Bioconductor is available after installing the most recent version of R; see http://bioconductor.org/install biocLite("DESeq2") BioC_mirror: https://bioconductor.org Using Bioconductor 3.6 (BiocInstaller 1.28.0), R 3.4.3 (2017-11-30). Installing package(s) ‘DESeq2’ trying URL 'https://bioconductor.org/packages/3.6/bioc/bin/macosx/el-capitan/contrib/3.4/DESeq2_1.18.1.tgz'

Content type 'application/x-gzip' length 3765534 bytes (3.6 MB)

downloaded 3.6 MB

The downloaded binary packages are in /var/folders/y9/4lq94xwx5_50p3s256r8flrm0000gn/T//RtmpiTFueL/downloaded_packages

library(DESeq2)

Set the working directory

setwd ("/Users/gabriellecorso/Desktop/Sinorhizobium/") getwd() [1] "/Users/gabriellecorso/Desktop/Sinorhizobium" list.files() [1] "PG99_PG98" "sort_trim_PG100_D1413_A.counts" [3] "sort_trim_PG100_D1413_B.counts" "sort_trim_PG100_D1413_C.counts" [5] "sort_trim_PG105_WT_A.counts" "sort_trim_PG105_WT_B.counts"
[7] "sort_trim_PG105_WT_C.counts"

Set the prefix for each output file name

outputPrefix <- "Rhizobium_DESeq2"

sampleFiles<- c("sort_trim_PG100_D1413_A.counts","sort_trim_PG100_D1413_B.counts", + "sort_trim_PG100_D1413_C.counts", "sort_trim_PG105_WT_A.counts", "sort_trim_PG105_WT_B.counts","sort_trim_PG105_WT_C.counts")

mRNA profiles of

control group (WT), *

knockout group (PG100), *

sampleNames <- c("WT_A","WT_B","WT_C","PG100_A","PG100_B","PG100_C") sampleCondition <- c("control","control","control","PG100","PG100","PG100")

sampleTable <- data.frame(sampleName=sampleNames, + fileName=sampleFiles, + condition=sampleCondition)

ddsHTSeq <- DESeqDataSetFromHTSeqCount(sampleTable=sampleTable, + directory=directory, + design=~condition) Error in file.path(directory, fn) : object 'directory' not found

ADD REPLYlink written 14 months ago by Gabrielle.corso0

If you pay attention, you will see the error message has changed - your DESeq2 installation was corrupted somehow, and reinstalling it solved that issue. The current error is self-explanatory: you are trying to use an undeclared variable. You have to declare it with:

directory <- "/path/to/some/directory/"
ADD REPLYlink written 14 months ago by h.mon27k

Ah okay. I already set my working directory and when I use the common getwd() it does have the correct path to where the .counts files exist... Should I be modifying this particular command;

"ddsHTSeq <- DESeqDataSetFromHTSeqCount(sampleTable=sampleTable, directory=directory, design=~condition)"

The R code above this line seems to be working fine and the error file is derived from this code.

ADD REPLYlink written 14 months ago by Gabrielle.corso0

sessionInfo() R version 3.4.3 (2017-11-30) Platform: x86_64-apple-darwin15.6.0 (64-bit) Running under: macOS Sierra 10.12.6

Matrix products: default BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib

locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages: [1] parallel stats4 stats graphics grDevices utils datasets [8] methods base

other attached packages: [1] DESeq2_1.18.1 SummarizedExperiment_1.8.1 [3] DelayedArray_0.4.1 matrixStats_0.53.1
[5] Biobase_2.38.0 GenomicRanges_1.30.3
[7] GenomeInfoDb_1.14.0 IRanges_2.12.0
[9] S4Vectors_0.16.0 BiocGenerics_0.24.0
[11] BiocInstaller_1.28.0

loaded via a namespace (and not attached): [1] bit64_0.9-7 splines_3.4.3 Formula_1.2-3
[4] assertthat_0.2.0 latticeExtra_0.6-28 blob_1.1.1
[7] GenomeInfoDbData_1.0.0 yaml_2.1.19 pillar_1.2.3
[10] RSQLite_2.1.1 backports_1.1.2 lattice_0.20-35
[13] glue_1.2.0 digest_0.6.15 RColorBrewer_1.1-2
[16] XVector_0.18.0 checkmate_1.8.5 colorspace_1.3-2
[19] htmltools_0.3.6 Matrix_1.2-14 plyr_1.8.4
[22] XML_3.98-1.11 pkgconfig_2.0.1 genefilter_1.60.0
[25] zlibbioc_1.24.0 purrr_0.2.5 xtable_1.8-2
[28] scales_0.5.0 BiocParallel_1.12.0 htmlTable_1.12
[31] tibble_1.4.2 annotate_1.56.2 ggplot2_3.0.0
[34] nnet_7.3-12 lazyeval_0.2.1 survival_2.42-4
[37] magrittr_1.5 memoise_1.1.0 foreign_0.8-70
[40] tools_3.4.3 data.table_1.11.4 stringr_1.3.1
[43] locfit_1.5-9.1 munsell_0.5.0 cluster_2.0.7-1
[46] AnnotationDbi_1.40.0 bindrcpp_0.2.2 compiler_3.4.3
[49] rlang_0.2.1 grid_3.4.3 RCurl_1.95-4.10
[52] rstudioapi_0.7 htmlwidgets_1.2 bitops_1.0-6
[55] base64enc_0.1-3 gtable_0.2.0 DBI_1.0.0
[58] R6_2.2.2 gridExtra_2.3 knitr_1.20
[61] dplyr_0.7.6 bit_1.1-14 bindr_0.1.1
[64] Hmisc_4.1-1 stringi_1.2.3 Rcpp_0.12.17
[67] geneplotter_1.56.0 rpart_4.1-13 acepack_1.4.1
[70] tidyselect_0.2.4

ADD REPLYlink written 14 months ago by Gabrielle.corso0
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 2.3.0
Traffic: 2189 users visited in the last hour