lawremi / rtracklayer

R interface to genome annotation files and the UCSC genome browser
Other
29 stars 17 forks source link

invalid class “GFF2File” object #53

Open ericblanc20 opened 3 years ago

ericblanc20 commented 3 years ago

Hi,

I get an error trying to read gif files using rtracklayer::import(< gtf file>, format="gtf"). The same error occurs when I don't specify the format.

> library(rtracklayer)
> rtracklayer::import("test_file.gtf", format="gtf")
Error in h(simpleError(msg, call)) : 
  error in evaluating the argument 'con' in selecting a method for function 'import': invalid class “GFF2File” object: undefined class for slot "resource" ("characterORconnection")

My system is as shown below:

> sessionInfo()
R version 4.0.5 (2021-03-31)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Mojave 10.14.6

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRblas.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib

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

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

other attached packages:
[1] rtracklayer_1.48.0   GenomicRanges_1.40.0 GenomeInfoDb_1.24.2 
[4] IRanges_2.22.2       S4Vectors_0.26.1     BiocGenerics_0.36.1 

loaded via a namespace (and not attached):
 [1] rstudioapi_0.13             XVector_0.28.0             
 [3] zlibbioc_1.34.0             GenomicAlignments_1.24.0   
 [5] BiocParallel_1.22.0         lattice_0.20-41            
 [7] tools_4.0.5                 SummarizedExperiment_1.18.2
 [9] grid_4.0.5                  Biobase_2.50.0             
[11] matrixStats_0.58.0          crayon_1.4.1               
[13] Matrix_1.3-3                GenomeInfoDbData_1.2.3     
[15] bitops_1.0-7                RCurl_1.98-1.3             
[17] DelayedArray_0.14.1         compiler_4.0.5             
[19] Biostrings_2.56.0           Rsamtools_2.4.0            
[21] XML_3.99-0.6    

The gtf file is below, it is taken from the reference provided in the GFFFile-class help page, so I assume it is correct. It is given below:

> cat test_file.gtf
140 Twinscan    inter   5141    8522    .   -   .   gene_id ""; transcript_id "";
140 Twinscan    inter_CNS   8523    9711    .   -   .   gene_id ""; transcript_id "";
140 Twinscan    inter   9712    13182   .   -   .   gene_id ""; transcript_id "";
140 Twinscan    3UTR    65149   65487   .   -   .   gene_id "140.000"; transcript_id "140.000.1";
140 Twinscan    3UTR    66823   66992   .   -   .   gene_id "140.000"; transcript_id "140.000.1";
140 Twinscan    stop_codon  66993   66995   .   -   0   gene_id "140.000"; transcript_id "140.000.1";
140 Twinscan    CDS 66996   66999   .   -   1   gene_id "140.000"; transcript_id "140.000.1";
140 Twinscan    intron_CNS  70103   70151   .   -   .   gene_id "140.000"; transcript_id "140.000.1";
140 Twinscan    CDS 70207   70294   .   -   2   gene_id "140.000"; transcript_id "140.000.1";
140 Twinscan    CDS 71696   71807   .   -   0   gene_id "140.000"; transcript_id "140.000.1";
140 Twinscan    start_codon 71805   71806   .   -   0   gene_id "140.000"; transcript_id "140.000.1";
140 Twinscan    start_codon 73222   73222   .   -   2   gene_id "140.000"; transcript_id "140.000.1";
140 Twinscan    CDS 73222   73222   .   -   0   gene_id "140.000"; transcript_id "140.000.1";
140 Twinscan    5UTR    73223   73504   .   -   .   gene_id "140.000"; transcript_id "140.000.1";

Is there something that I overlook?

Thanks for your help, Eric

lawremi commented 3 years ago

I'm guessing this will go away after updating to R 4.1.0 and the latest version of Bioconductor.