Search
Question: GenomicFeatures package ERROR
0
gravatar for liangwu887
23 months ago by
liangwu8870
liangwu8870 wrote:

Hi guys;

I get an error when I following the GenomicRanges HOWTOs protocal (http://bioconductor.org/packages/devel/bioc/vignettes/GenomicRanges/inst/doc/GenomicRangesHOWTOs.pdf) to loading my GTF file or the package's extdata using the GenomicFeatures package on linux system. And I had tried to reinstall R and the package, but error was still been report. I also try to use the package on win's R, it's work!

I had compared the sessionInfo() between the win's R and the linux's R, the R version and the packages version are the same, the difference is just install on different system!!! 

It's an bug for linux's R? Thanks For Any Help!!

 

Bests

 

Liang

 

 

The code, the error and sessionInfo() of the linux's R are as following:

> library(GenomicFeatures)

> gtffile=system.file("extdata","GTF_files","test.gtf",package="GenomicFeatures") ## test.gtf is the reference I want to use to counting the gene expression.
> txdb=makeTxDbFromGFF(gtffile,format="gtf")
Import genomic features from the file as a GRanges object ... Error in parseURI("") : cannot parse URI
> gff_file=system.file("extdata","GFF3_files","a.gff3",package="GenomicFeatures")
> gff_file
[1] "/lfs1/ST_PMO2015G/STN11023/software/R-3.2.2/library/GenomicFeatures/extdata/GFF3_files/a.gff3"
> txdb=makeTxDbFromGFF(gff_file,format="gff3")
Import genomic features from the file as a GRanges object ... Error in parseURI("") : cannot parse URI

> sessionInfo()
R version 3.2.2 (2015-08-14)
Platform: x86_64-pc-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_US.iso885915       LC_NUMERIC=C
 [3] LC_TIME=en_US.iso885915        LC_COLLATE=en_US.iso885915
 [5] LC_MONETARY=en_US.iso885915    LC_MESSAGES=en_US.iso885915
 [7] LC_PAPER=en_US.iso885915       LC_NAME=C
 [9] LC_ADDRESS=C                   LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.iso885915 LC_IDENTIFICATION=C

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

other attached packages:
[1] GenomicFeatures_1.22.6 AnnotationDbi_1.32.0   Biobase_2.30.0
[4] GenomicRanges_1.22.1   GenomeInfoDb_1.6.1     IRanges_2.4.5
[7] S4Vectors_0.8.4        BiocGenerics_0.16.1    BiocInstaller_1.20.1

loaded via a namespace (and not attached):
 [1] XVector_0.10.0             zlibbioc_1.16.0
 [3] GenomicAlignments_1.6.1    BiocParallel_1.4.0
 [5] tools_3.2.2                SummarizedExperiment_1.0.1
 [7] DBI_0.3.1                  lambda.r_1.1.7
 [9] futile.logger_1.4.1        rtracklayer_1.30.1
[11] futile.options_1.0.0       bitops_1.0-6
[13] RCurl_1.95-4.7             biomaRt_2.26.1
[15] RSQLite_1.0.0              Biostrings_2.38.2
[17] Rsamtools_1.22.0           XML_3.98-1.3

 

 

 

ADD COMMENTlink modified 5 months ago by Michael Lawrence9.8k • written 23 months ago by liangwu8870
1
gravatar for Hervé Pagès
23 months ago by
Hervé Pagès ♦♦ 13k
United States
Hervé Pagès ♦♦ 13k wrote:

Hi,

Please provide your sessionInfo() as you're probably using an old and unsupported version of Bioconductor.

Your 1st path (system.file("extdata","GTF_files","test.gtf",package="GenomicFeatures")) is invalid: there is no test.gtf file in the GenomicFeatures package, but there is a test1.gtf file. BTW and AFAIK this code does not belong to the GenomicRanges HOWTO.

Your 2nd path (system.file("extdata","GFF3_files","a.gff3",package="GenomicFeatures")) is OK and should work (granted you use the current version of Bioconductor). It works for me.

So make sure you use the latest Bioconductor release (BioC 3.2, released in October). You'll need R-3.2.2 for that. To find out which version you have, just load the BiocInstaller package.

Cheers,

H.

PS: system.file() not failing by default when specifying an invalid path is a silly "feature" but I guess that's how it is and we have to live with it :-/

ADD COMMENTlink modified 23 months ago • written 23 months ago by Hervé Pagès ♦♦ 13k

Hi,Herve. Thanks for your respone.

The test.gtf is the reference which I want to use to counting the genes expression in my analysis. So , it was invalid for you.

And I had tried again to loading the a.gff3, the error was stiil been reported. 

The R verssion is 3.2.2, and I installed the GenomicFeatures by using biocLite("GenomicFeatures").

and the information of sessionInfo() as following:

>sessionInfo()
R version 3.2.2 (2015-08-14)
Platform: x86_64-pc-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_US.iso885915       LC_NUMERIC=C
 [3] LC_TIME=en_US.iso885915        LC_COLLATE=en_US.iso885915
 [5] LC_MONETARY=en_US.iso885915    LC_MESSAGES=en_US.iso885915
 [7] LC_PAPER=en_US.iso885915       LC_NAME=C
 [9] LC_ADDRESS=C                   LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.iso885915 LC_IDENTIFICATION=C

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

other attached packages:
[1] GenomicFeatures_1.22.6 AnnotationDbi_1.32.0   Biobase_2.30.0
[4] GenomicRanges_1.22.1   GenomeInfoDb_1.6.1     IRanges_2.4.4
[7] S4Vectors_0.8.3        BiocGenerics_0.16.1

loaded via a namespace (and not attached):
 [1] XVector_0.10.0             zlibbioc_1.16.0
 [3] GenomicAlignments_1.6.1    BiocParallel_1.4.0
 [5] tools_3.2.2                SummarizedExperiment_1.0.1
 [7] DBI_0.3.1                  lambda.r_1.1.7
 [9] futile.logger_1.4.1        rtracklayer_1.30.1
[11] futile.options_1.0.0       bitops_1.0-6
[13] RCurl_1.95-4.7             biomaRt_2.26.1
[15] RSQLite_1.0.0              Biostrings_2.38.2
[17] Rsamtools_1.22.0           XML_3.98-1.3

Bests 

Liang

ADD REPLYlink written 23 months ago by liangwu8870

Hi,

system.file() is for getting the path to a file that is included in a package. Using system.file("extdata","GTF_files","test.gtf",package="GenomicFeatures") to get the path to your own test.gtf file doesn't work because the file doesn't belong to the GenomicFeatures package. All you need to do is something like:

gtffile <- "path/to/your/test.gtf"  # make sure to replace by the *real*
                                    # path to your test.gtf file
txdb <- makeTxDbFromGFF(gtffile, format="gtf")

Cheers,

H.

ADD REPLYlink written 23 months ago by Hervé Pagès ♦♦ 13k

Hi,

Maybe I didn't express my means clearly. Sorry~

My question is that I can,t use the GenomicFeatures to read the gtf file on the off-line linux system, although I tried the file which provide by the software. But I can use the Function of GenomicFeatures on my windows computer, it work without any error, by using the same command and reading the file on the off-line linux system.

The test.gtf file I had stored at the GTF_file folder of the GenomicFeatures, and I open the file by the path which provide by the system.files(). So the error didn't make by system.files(), makeTxDbFromGFF() make it! 

And I think it maybe as an bug of the GenomicFeatures or R software, because it  work on the windows system, but not on the linux, using the same command and reading the same files.

 

Cheers,

 

Liang

ADD REPLYlink written 23 months ago by liangwu8870
  1. Storing your test.gtf file in the GTF_file folder of the GenomicFeatures package is a very bad idea. Please never do that.
  2. As I said, you should specify the path to your test.gtf file with something like gtffile <- "path/to/your/test.gtf". Do NOT use system.file() for that.
  3. If things still don't work when doing 2., please show us the complete transcript of the following sequence:
library(GenomicFeatures)
gtffile <- "path/to/your/test.gtf"
file.exists(gtffile)  # make sure this is TRUE
makeTxDbFromGFF(gtffile)

Thanks,

H.

ADD REPLYlink modified 23 months ago • written 23 months ago by Hervé Pagès ♦♦ 13k

Hi, Herve.

It's work by following your suggestion, any error hadn't been reported again. And I try the commands which read the a.gff3 file as same as the first time I used, it also work as normal. It make me puzzling!! But, any way, thanks for your helps.

 

Bests 

Liang 

ADD REPLYlink modified 23 months ago • written 23 months ago by liangwu8870
0
gravatar for minie
5 months ago by
minie0
minie0 wrote:

Is there a way to export the gtf file from GenomicRanges

I have calculated intron coordinates from gtf file using exon coordinates and now I need to export it from the range , I tried following code but getting an error:

 

export.gtf(introns,"introns.gtf",format ="gtf")
Error in export.gtf(introns, "introns.gtf", format = "gtf") :
  could not find function "export.gtf"

 

ADD COMMENTlink modified 5 months ago • written 5 months ago by minie0
0
gravatar for Michael Lawrence
5 months ago by
United States
Michael Lawrence9.8k wrote:

There is no export.gtf(). Just call export() with the right file extension, or use the format argument if the file has some non-standard name. Also make sure rtracklayer is loaded.

export(introns, "introns.gtf")

 

ADD COMMENTlink written 5 months ago by Michael Lawrence9.8k
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.2.0
Traffic: 210 users visited in the last hour