could not find function "tximport"
0
Entering edit mode
s.corley • 30
@scorley-6735
Last seen 20 months ago
Australia

I am trying to use the library"tximportData" to read in data produced from salmon (quant_sf files). However I am getting an error message saying function tximport could not be found. I was firstly just using the package example: 

library("tximportData")
library("readr")

### test from package
dir <- system.file("extdata", package="tximportData")
samples <- read.table(file.path(dir,"samples.txt"), header=TRUE)
files <- file.path(dir,"salmon", samples$run, "quant.sf")
names(files) <- paste0("sample",1:6)

# tx2gene links transcript IDs to gene IDs for summarization
tx2gene <- read.csv(file.path(dir, "tx2gene.csv"))
head(tx2gene)
txi <- tximport(files, type="salmon", tx2gene=tx2gene) 

Error in tximport(files, type = "salmon", tx2gene = tx2gene) : 
  could not find function "tximport" 

> sessionInfo()
R version 3.4.0 (2017-04-21)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: OS X El Capitan 10.11.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_AU.UTF-8/en_AU.UTF-8/en_AU.UTF-8/C/en_AU.UTF-8/en_AU.UTF-8

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

other attached packages:
[1] BiocInstaller_1.28.0 readr_1.1.1          tximportData_1.6.0  

loaded via a namespace (and not attached):
[1] compiler_3.4.0  R6_2.2.2        hms_0.4.1       tools_3.4.0     pillar_1.2.0    tibble_1.4.2    Rcpp_0.12.15    pkgconfig_2.0.1
[9] rlang_0.2.0    

 

tximportdata • 736 views
ADD COMMENTlink
0
Entering edit mode
@gordon-smyth
Last seen 35 minutes ago
WEHI, Melbourne, Australia

You haven't loaded the tximport package:

library(tximport)
ADD COMMENTlink

Login before adding your answer.

Similar Posts
Loading Similar Posts
Traffic: 196 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.4