Question: tximport allfile.exists(files)--> FALSE
0
gravatar for gilles.charpigny
11 months ago by
gilles.charpigny0 wrote:

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 • 516 views
ADD COMMENTlink modified 11 months ago by James W. MacDonald50k • written 11 months ago by gilles.charpigny0
Answer: tximport allfile.exists(files)--> FALSE
0
gravatar for James W. MacDonald
11 months ago by
United States
James W. MacDonald50k wrote:

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 COMMENTlink written 11 months ago by James W. MacDonald50k

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 REPLYlink written 11 months ago by gilles.charpigny0

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 REPLYlink written 11 months ago by James W. MacDonald50k

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 REPLYlink written 11 months ago by gilles.charpigny0

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 REPLYlink written 11 months ago by James W. MacDonald50k

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 REPLYlink written 11 months ago by gilles.charpigny0
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: 180 users visited in the last hour