Rtracklayer fails to export TxDb as GFF3 without CDS
1
0
Entering edit mode
@alexisweinreb-22919
Last seen 4 months ago
United States

Hello,

rtracklayer can export a GRange as GFF3 even when there is no CDS defined, however when trying to do the same from a TxDb it fails with this error message:

Error in `[[<-`(`*tmp*`, name, value = NA) : 
  1 elements in value to replace 0 elements

I think it happens while applying asGFF().

I believe this is not the expected behavior for GFF3, even though there is a simple workaround using transcriptsBy().

Minimal example:

library(GenomicRanges)
library(GenomicFeatures)
library(rtracklayer)

gr <- GRanges("chrI", IRanges(c(1,5,8), c(3,7,12)), strand = "+")
mcols(gr)$type <- "exon"
mcols(gr)$exon_id <- 1:3
mcols(gr)$transcript_id <- 1
mcols(gr)$transcript_name <- "1"
mcols(gr)$gene_id <- 1
mcols(gr)$gene_name <- "1"
txdb <- makeTxDbFromGRanges(gr)

# fails in asGFF:
rtracklayer::export(txdb, "example.gff3")

# works:
rtracklayer::export(transcriptsBy(txdb), "example.gff3")

And here is the sessionInfo.

> sessionInfo()
R version 3.6.2 (2019-12-12)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17763)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    

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

other attached packages:
[1] rtracklayer_1.46.0     GenomicFeatures_1.38.1 AnnotationDbi_1.48.0   Biobase_2.46.0         GenomicRanges_1.38.0   GenomeInfoDb_1.22.0   
[7] IRanges_2.20.2         S4Vectors_0.24.3       BiocGenerics_0.32.0   

loaded via a namespace (and not attached):
 [1] SummarizedExperiment_1.16.1 progress_1.2.2              tidyselect_1.0.0            purrr_0.3.3                
 [5] lattice_0.20-38             vctrs_0.2.2                 BiocFileCache_1.10.2        blob_1.2.1                 
 [9] XML_3.99-0.3                rlang_0.4.4                 pillar_1.4.3                glue_1.3.1                 
[13] DBI_1.1.0                   BiocParallel_1.20.1         rappdirs_0.3.1              bit64_0.9-7                
[17] dbplyr_1.4.2                matrixStats_0.55.0          GenomeInfoDbData_1.2.2      stringr_1.4.0              
[21] zlibbioc_1.32.0             Biostrings_2.54.0           memoise_1.1.0               biomaRt_2.42.0             
[25] curl_4.3                    Rcpp_1.0.3                  openssl_1.4.1               DelayedArray_0.12.2        
[29] XVector_0.26.0              bit_1.1-15.1                Rsamtools_2.2.1             hms_0.5.3                  
[33] askpass_1.1                 digest_0.6.23               stringi_1.4.4               dplyr_0.8.4                
[37] grid_3.6.2                  tools_3.6.2                 bitops_1.0-6                magrittr_1.5               
[41] RCurl_1.98-1.1              RSQLite_2.2.0               tibble_2.1.3                crayon_1.3.4               
[45] pkgconfig_2.0.3             Matrix_1.2-18               prettyunits_1.1.1           assertthat_0.2.1           
[49] httr_1.4.1                  rstudioapi_0.11             R6_2.4.1                    GenomicAlignments_1.22.1   
[53] compiler_3.6.2
rtracklayer • 295 views
ADD COMMENT
1
Entering edit mode
@michael-lawrence-3846
Last seen 9 months ago
United States

Thanks, fixed in rtracklayer 1.38.2.

ADD COMMENT

Login before adding your answer.

Traffic: 229 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