tximport allfile.exists(files)--> FALSE
1
0
Entering edit mode
@gillescharpigny-16618
Last seen 5.7 years ago

Using "tximport package" I get the same error message reported 22 months ago by "ctl" but i am not able to resolve the problem with the Michael's answer.

When I specify all(file.exists(files)), I get FALSE. I even get this message with the tutorial command lines:

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

[1] FALSE

Where am I wrong?

Thank you very for your help

GCH

tximport • 2.4k views
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 2 days ago
United States

You might have a borked installation of tximportData. Your code works for me:

 library(tximportData)
dir <- system.file("extdata", package ="tximportData")
list.files(dir)
samples <- read.table(file.path(dir, "samples.txt"), header = TRUE)
samples
files <- file.path(dir, "salmon", samples$run, "quant.sf.gz")
names(files) <- paste0("sample", 1:6)
all(file.exists(files))
library(tximportData)
> dir <- system.file("extdata", package ="tximportData")
> list.files(dir)
 [1] "cufflinks"               "derivedTxome"           
 [3] "kallisto"                "kallisto_boot"          
 [5] "rsem"                    "sailfish"               
 [7] "salmon"                  "salmon_gibbs"           
 [9] "samples.txt"             "samples_extended.txt"   
[11] "tx2gene.csv"             "tx2gene.gencode.v27.csv"
> samples <- read.table(file.path(dir, "samples.txt"), header = TRUE)
> samples
  pop center                assay    sample experiment       run
1 TSI  UNIGE NA20503.1.M_111124_5 ERS185497  ERX163094 ERR188297
2 TSI  UNIGE NA20504.1.M_111124_7 ERS185242  ERX162972 ERR188088
3 TSI  UNIGE NA20505.1.M_111124_6 ERS185048  ERX163009 ERR188329
4 TSI  UNIGE NA20507.1.M_111124_7 ERS185412  ERX163158 ERR188288
5 TSI  UNIGE NA20508.1.M_111124_2 ERS185362  ERX163159 ERR188021
6 TSI  UNIGE NA20514.1.M_111124_4 ERS185217  ERX163062 ERR188356
> files <- file.path(dir, "salmon", samples$run, "quant.sf.gz")
> names(files) <- paste0("sample", 1:6)
> all(file.exists(files))
[1] TRUE

What does your files object contain? Are there six files?

ADD COMMENT
0
Entering edit mode

I removed tximport/tximportData and reloaded.
The erreu code remains the same. Below is a copy of the output. I added a line to see the object file as requested.
(The version is R3.4.4)

> library(tximportData)
> dir <- system.file("extdata", package ="tximportData")
> list.files(dir)
 [1] "cufflinks"            "kallisto"             "kallisto_boot"        "rsem"                 "sailfish"            
 [6] "salmon"               "salmon_gibbs"         "samples.txt"          "samples_extended.txt" "tx2gene.csv"         
> samples <- read.table(file.path(dir, "samples.txt"), header = TRUE)
> samples
  pop center                assay    sample experiment       run
1 TSI  UNIGE NA20503.1.M_111124_5 ERS185497  ERX163094 ERR188297
2 TSI  UNIGE NA20504.1.M_111124_7 ERS185242  ERX162972 ERR188088
3 TSI  UNIGE NA20505.1.M_111124_6 ERS185048  ERX163009 ERR188329
4 TSI  UNIGE NA20507.1.M_111124_7 ERS185412  ERX163158 ERR188288
5 TSI  UNIGE NA20508.1.M_111124_2 ERS185362  ERX163159 ERR188021
6 TSI  UNIGE NA20514.1.M_111124_4 ERS185217  ERX163062 ERR188356
> files <- file.path(dir, "salmon", samples$run, "quant.sf.gz")
> nameFile<-names(files) <- paste0("sample", 1:6)
> nameFile
[1] "sample1" "sample2" "sample3" "sample4" "sample5" "sample6"
> all(file.exists(files))
[1] FALSE

 

ADD REPLY
0
Entering edit mode

What do you get from

data.frame(thefiles = files, doihave = file.exists(files))
                                                                                        thefiles
sample1 C:/Users/aajm-mobile/R/win-library/3.5/tximportData/extdata/salmon/ERR188297/quant.sf.gz
sample2 C:/Users/aajm-mobile/R/win-library/3.5/tximportData/extdata/salmon/ERR188088/quant.sf.gz
sample3 C:/Users/aajm-mobile/R/win-library/3.5/tximportData/extdata/salmon/ERR188329/quant.sf.gz
sample4 C:/Users/aajm-mobile/R/win-library/3.5/tximportData/extdata/salmon/ERR188288/quant.sf.gz
sample5 C:/Users/aajm-mobile/R/win-library/3.5/tximportData/extdata/salmon/ERR188021/quant.sf.gz
sample6 C:/Users/aajm-mobile/R/win-library/3.5/tximportData/extdata/salmon/ERR188356/quant.sf.gz
        doihave
sample1    TRUE
sample2    TRUE
sample3    TRUE
sample4    TRUE
sample5    TRUE
sample6    TRUE
ADD REPLY
0
Entering edit mode

what i get

> data.frame(thefiles = files, doihave = file.exists(files))
                                                                                thefiles doihave
sample1 F:/Documents/R/win-library/3.4/tximportData/extdata/salmon/ERR188297/quant.sf.gz   FALSE
sample2 F:/Documents/R/win-library/3.4/tximportData/extdata/salmon/ERR188088/quant.sf.gz   FALSE
sample3 F:/Documents/R/win-library/3.4/tximportData/extdata/salmon/ERR188329/quant.sf.gz   FALSE
sample4 F:/Documents/R/win-library/3.4/tximportData/extdata/salmon/ERR188288/quant.sf.gz   FALSE
sample5 F:/Documents/R/win-library/3.4/tximportData/extdata/salmon/ERR188021/quant.sf.gz   FALSE
sample6 F:/Documents/R/win-library/3.4/tximportData/extdata/salmon/ERR188356/quant.sf.gz   FALSE
 

>

 

ADD REPLY
0
Entering edit mode

You have an old version of R and Bioconductor. On my old version I get FALSE for all as well, so you need to upgrade to R-3.5.x and the release version of Bioc

ADD REPLY
0
Entering edit mode

Thank you vry much.

I updated R to R3.5. with the latest release of  Bioc and it's ok; I have now difficulties with tximport with Bovine database. I added another question on the forum.

ADD REPLY

Login before adding your answer.

Traffic: 555 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.6