Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in prepare_annotation_files with latetst version of R #21

Open
sgraindorge opened this issue May 17, 2022 · 22 comments
Open

Error in prepare_annotation_files with latetst version of R #21

sgraindorge opened this issue May 17, 2022 · 22 comments

Comments

@sgraindorge
Copy link

Hi !

I got this message while running the prepare_annotation_files command.
Could you tell me what I should change to make it work ?
Thanks

Stefanie

Creating the TxDb object --- Done! Tue May 17 11:36:29 2022
Extracting genomic regions ... Tue May 17 11:36:29 2022
Erreur : disjointExons() is defunct in BioC 3.15. Please use exonicParts() instead.
De plus : Messages d'avis :
1: Dans forgeBSgenomeDataPkg(y, seqs_srcdir = seqs_srcdir, destdir = destdir,  :
  field 'provider_version' is deprecated in favor of 'genome'
2: Dans forgeBSgenomeDataPkg(y, seqs_srcdir = seqs_srcdir, destdir = destdir,  :
  field 'release_name' is deprecated
@bribibel
Copy link

bribibel commented Aug 6, 2022

I am getting the same error message (in English). Thanks in advance

@Tim-Yu
Copy link
Contributor

Tim-Yu commented Sep 8, 2022

Hi,

I faced a similar error in another package they wrote, it seems that Bioc updated some packages and changed some functions (disjointExons). I fixed the package I was using and I think my quick fix may also work here (by replacing disjointExons with exonicParts and changing the format back). You may want to try installing my modified version via Tim-Yu/RiboseQC?

install_github(repo = "Tim-Yu/RiboseQC")

BW,
Tim

@bribibel
Copy link

bribibel commented Sep 9, 2022

Thanks! I will have to try that out. Best of luck with your experiments!

@hsinyenwu
Copy link

hsinyenwu commented Sep 14, 2022

It seems that modified RiboseQC does not work for me (but thanks Tim for trying!). The output was bigger than before. It seems that the BS genome object was not created properly using Arabidopsis genome and annotation and cannot be used for RiboseQC_analysis (see below for error message). RiboseQC ran okay with R4.1.3. Hopefully it got fixed soon.

#The Araport11_20220629.gtf_Rannot was created by the updated RiboseQC.
RiboseQC_analysis(annotation_file="~/Desktop/Araport11_20220629.gtf_Rannot",bam_files = "~/Desktop/star_2016_ribo_R1Aligned.chr1_1to10M.bam",report_file = "Root1_test.html",write_tmp_files = F)

Loading annotation files in ~/Desktop/Araport11_20220629.gtf_Rannot ... Wed Sep 14 12:58:39 2022
Error in get(library(GTF_annotation$genome, character.only = TRUE)) : 
  first argument has length > 1

@hsinyenwu
Copy link

Okay it worked after using Tim's modification and also removed this line genome_sequence<-get(library(GTF_annotation$genome,character.only = TRUE)) from the load_annotation function. Thanks Tim!

@sgraindorge
Copy link
Author

Hi everybody.
I downloaded Tim's version this morning. No genome_sequence in the code ...
So I run it as is and get this new error message :

prepare_annotation_files(annotation_directory, twobit_file, gtf_file,
+                          scientific_name = "Arabidopsis.thaliana", annotation_name = "TAIR10.1",
+                          export_bed_tables_TxDb = T, forge_BSgenome = T, create_TxDb = T)
Creating the BSgenome package ... Tue Sep 20 11:07:47 2022
Error in download.file(url, destfile, quiet = TRUE) : 
  cannot open URL 'ftp://ftp.ncbi.nlm.nih.gov/genomes/all/GCF/000/001/735/GCF_000001735.4_TAIR10.1/GCF_000001735.4_TAIR10.1_assembly_report.txt'
In addition: Warning messages:
1: In forgeBSgenomeDataPkg(y, seqs_srcdir = seqs_srcdir, destdir = destdir,  :
  field 'provider_version' is deprecated in favor of 'genome'
2: In forgeBSgenomeDataPkg(y, seqs_srcdir = seqs_srcdir, destdir = destdir,  :
  field 'release_name' is deprecated`

I don't know why it is trying to download stuff knowing I give him the files he needs...
If you have any idea I would be very grateful
Thanks

@Tim-Yu
Copy link
Contributor

Tim-Yu commented Sep 20, 2022

Hi everybody. I downloaded Tim's version this morning. No genome_sequence in the code ... So I run it as is and get this new error message :

prepare_annotation_files(annotation_directory, twobit_file, gtf_file,
+                          scientific_name = "Arabidopsis.thaliana", annotation_name = "TAIR10.1",
+                          export_bed_tables_TxDb = T, forge_BSgenome = T, create_TxDb = T)
Creating the BSgenome package ... Tue Sep 20 11:07:47 2022
Error in download.file(url, destfile, quiet = TRUE) : 
  cannot open URL 'ftp://ftp.ncbi.nlm.nih.gov/genomes/all/GCF/000/001/735/GCF_000001735.4_TAIR10.1/GCF_000001735.4_TAIR10.1_assembly_report.txt'
In addition: Warning messages:
1: In forgeBSgenomeDataPkg(y, seqs_srcdir = seqs_srcdir, destdir = destdir,  :
  field 'provider_version' is deprecated in favor of 'genome'
2: In forgeBSgenomeDataPkg(y, seqs_srcdir = seqs_srcdir, destdir = destdir,  :
  field 'release_name' is deprecated`

I don't know why it is trying to download stuff knowing I give him the files he needs... If you have any idea I would be very grateful Thanks

Hi, I am confused with the error above. This should be an offline function I think? The warnings were fine.

@sgraindorge
Copy link
Author

Hi !

I found that by just removing the =NULL from the first line : prepare_annotation_files(annotation_directory, twobit_file = NULL, gtf_file,... it didn't try to download files on internet anymore.

damhof added a commit to damhof/RiboseQC that referenced this issue Sep 29, 2022
see ohlerlab#21 (comment); fixed by commenting out the line that causes the error
@mahabubp
Copy link

Hi everyone,

I installed Tim-Yu's version of RiboseQC today and I got the following error while preparing the annotation files. Could someone please look into this error and help me generate the annotation files. Thanks.

Error in prepare_annotation_files("~/annotation", "/home/lrge/Homo_sapiens.2bit", :
length(unique(gtfdata$transcript_id)) == n_transcripts is not TRUE
In addition: Warning messages:
1: In forgeBSgenomeDataPkg(y, seqs_srcdir = seqs_srcdir, destdir = destdir, :
field 'provider_version' is deprecated in favor of 'genome'
2: In forgeBSgenomeDataPkg(y, seqs_srcdir = seqs_srcdir, destdir = destdir, :
field 'release_name' is deprecated
3: In .get_cds_IDX(mcols0$type, mcols0$phase) :
The "phase" metadata column contains non-NA values for features of type stop_codon. This information was ignored.

@Tyuewww
Copy link

Tyuewww commented Apr 7, 2023

Hi everyone,

I installed Tim-Yu's version of RiboseQC today and I got the following error while preparing the annotation files. Could someone please look into this error and help me generate the annotation files. Thanks.

Error in prepare_annotation_files("~/annotation", "/home/lrge/Homo_sapiens.2bit", : length(unique(gtfdata$transcript_id)) == n_transcripts is not TRUE In addition: Warning messages: 1: In forgeBSgenomeDataPkg(y, seqs_srcdir = seqs_srcdir, destdir = destdir, : field 'provider_version' is deprecated in favor of 'genome' 2: In forgeBSgenomeDataPkg(y, seqs_srcdir = seqs_srcdir, destdir = destdir, : field 'release_name' is deprecated 3: In .get_cds_IDX(mcols0$type, mcols0$phase) : The "phase" metadata column contains non-NA values for features of type stop_codon. This information was ignored.

Hi !
I just ran into the same problem. Have you solved it? Could you give me some advice please?
Thank you very much!

@mahabubp
Copy link

Hi, sorry for the super delayed response. If you haven't solved this issue, here is the solution.

I downloaded the latest version (RiboseQC_1.1.tar.gz ) from here https://github.com/ohlerlab/RiboseQC/releases. I just removed the line 2283 (genome_sequence<-get(library(GTF_annotation$genome,character.only = TRUE)) from the load_annotation function in the riboseqc.R file in R folder and installed the package locally. Magically it worked. Give it a try. Hope it works for you too. Good luck.

@Tyuewww
Copy link

Tyuewww commented Apr 21, 2023 via email

@polklin
Copy link

polklin commented Apr 24, 2023

Hi @mahabubp,

thank you very much for the suggestion !
I am not very familiar with R, could you elaborate a bit more the installation process ?
Do I need to install dependencies beforehand in order to make the installation work ?

I downloaded the "RiboseQC_1.1.tar.gz" you mentioned, and commented the line 2283.
I then create a new tar.gz file after this modification.

Trying

install.packages("/data/users/pklein/projects/riboseQC/RiboseQC.tar.gz", repos = NULL, type="source")

gives me a:

ERROR: cannot extract package from ‘/data/users/pklein/projects/riboseQC/RiboseQC.tar.gz’

Cheers

@mahabubp
Copy link

Hi, I installed it directly on R studio. In R studio click on Tools -> install packages -> install from Package Archive File (tar.gz). Package archive: select the Archive file from your folder and install it. If any dependencies are missing please try to install them before you could install RiboseQC. Hope this information helps you. Good luck.

@polklin
Copy link

polklin commented Apr 27, 2023

thanks @mahabubp

@z626093820
Copy link

Hi, I installed it directly on R studio. In R studio click on Tools -> install packages -> install from Package Archive File (tar.gz). Package archive: select the Archive file from your folder and install it. If any dependencies are missing please try to install them before you could install RiboseQC. Hope this information helps you. Good luck.

hello, i have error in install RiboseQC, What is your R version? THANK YOU!

@mahabubp
Copy link

mahabubp commented Apr 27, 2023

Its R 4.3.0. May be you have an old version of R. Try to update it first then install RiboseQC.

@z626093820
Copy link

Its R 4.3.0. May be you have an old version of R. Try to update it first then install RiboseQC.

I reinstalled R4.3 and got the following error in the manual installation of RiboseQC, did you encounter it and how to solve it, thank you very much!

Error: object 'DEFAULT_CIRC_SEQS' is not exported by 'namespace:GenomicFeatures'
Execution halted

@mahabubp
Copy link

No, I didn't face this issue during installation. I have no clue what this issue about even. May be try to install the package from github and see if it works. If not please contact the admin of this package. Good luck.

@polklin
Copy link

polklin commented Apr 28, 2023

Sorry to disturb again @mahabubp, may I ask the libraries version you have please ?
Especially the dependencies versions when you load RiboseQC ?

That would help a lot !
Best,
Paul

@mahabubp
Copy link

Hi @z626093820,
I updated my RStudio (4.3.0) recently and I totally forgot to install RiboseQC on it before. But today I did install the package with no issues. I think you forgot to install devtools (install.packages("devtools")) on your new RStudio. Please do that first before you can install RiboseQC package (install.packages("~/RiboseQC", repos = NULL, type = "source")). Good luck.

@mahabubp
Copy link

Hi Paul (@polklin),

Here is the session info of my RiboseQC run. FYI: I installed the Bioconductor package 3.17 on my RStudio.

sessionInfo()
R version 4.3.0 (2023-04-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04.2 LTS

Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.10.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0

locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=cs_CZ.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=cs_CZ.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_PAPER=cs_CZ.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=cs_CZ.UTF-8 LC_IDENTIFICATION=C

time zone: Europe/Prague
tzcode source: system (glibc)

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

other attached packages:
[1] BSgenome.Homo.sapiens.genc25_1.0 RiboseQC_0.99.0 jsonlite_1.8.4
[4] GenomicFeatures_1.52.0 AnnotationDbi_1.62.0 viridis_0.6.2
[7] viridisLite_0.4.1 ggpubr_0.6.0 gridExtra_2.3
[10] DT_0.27 knitr_1.42 ggplot2_3.4.2
[13] reshape2_1.4.4 GenomicFiles_1.36.0 BiocParallel_1.34.0
[16] BSgenome_1.68.0 GenomicAlignments_1.36.0 SummarizedExperiment_1.30.0
[19] Biobase_2.60.0 MatrixGenerics_1.12.0 matrixStats_0.63.0
[22] rtracklayer_1.60.0 rmarkdown_2.21 Rsamtools_2.16.0
[25] Biostrings_2.68.0 XVector_0.40.0 GenomicRanges_1.52.0
[28] GenomeInfoDb_1.36.0 IRanges_2.34.0 S4Vectors_0.38.0
[31] BiocGenerics_0.46.0 devtools_2.4.5 usethis_2.1.6

loaded via a namespace (and not attached):
[1] RColorBrewer_1.1-3 rstudioapi_0.14 magrittr_2.0.3 farver_2.1.1 fs_1.6.2
[6] BiocIO_1.10.0 zlibbioc_1.46.0 vctrs_0.6.2 memoise_2.0.1 RCurl_1.98-1.12
[11] rstatix_0.7.2 htmltools_0.5.5 progress_1.2.2 curl_5.0.0 broom_1.0.4
[16] sass_0.4.5 bslib_0.4.2 desc_1.4.2 htmlwidgets_1.6.2 plyr_1.8.8
[21] cachem_1.0.7 mime_0.12 lifecycle_1.0.3 pkgconfig_2.0.3 Matrix_1.5-4
[26] R6_2.5.1 fastmap_1.1.1 GenomeInfoDbData_1.2.10 shiny_1.7.4 digest_0.6.31
[31] colorspace_2.1-0 ps_1.7.5 rprojroot_2.0.3 pkgload_1.3.2 crosstalk_1.2.0
[36] RSQLite_2.3.1 labeling_0.4.2 filelock_1.0.2 fansi_1.0.4 httr_1.4.5
[41] abind_1.4-5 compiler_4.3.0 remotes_2.4.2 bit64_4.0.5 withr_2.5.0
[46] backports_1.4.1 carData_3.0-5 DBI_1.1.3 highr_0.10 pkgbuild_1.4.0
[51] ggsignif_0.6.4 biomaRt_2.56.0 rappdirs_0.3.3 DelayedArray_0.25.0 sessioninfo_1.2.2
[56] rjson_0.2.21 tools_4.3.0 httpuv_1.6.9 glue_1.6.2 restfulr_0.0.15
[61] callr_3.7.3 promises_1.2.0.1 grid_4.3.0 generics_0.1.3 gtable_0.3.3
[66] tidyr_1.3.0 hms_1.1.3 xml2_1.3.4 car_3.1-2 utf8_1.2.3
[71] pillar_1.9.0 stringr_1.5.0 later_1.3.0 dplyr_1.1.2 BiocFileCache_2.8.0
[76] lattice_0.21-8 bit_4.0.5 tidyselect_1.2.0 miniUI_0.1.1.1 xfun_0.39
[81] stringi_1.7.12 yaml_2.3.7 evaluate_0.20 codetools_0.2-19 tibble_3.2.1
[86] BiocManager_1.30.20 cli_3.6.1 xtable_1.8-4 jquerylib_0.1.4 munsell_0.5.0
[91] processx_3.8.1 Rcpp_1.0.10 dbplyr_2.3.2 png_0.1-8 XML_3.99-0.14
[96] parallel_4.3.0 ellipsis_0.3.2 blob_1.2.4 prettyunits_1.1.1 profvis_0.3.7
[101] urlchecker_1.0.1 bitops_1.0-7 VariantAnnotation_1.46.0 scales_1.2.1 purrr_1.0.1
[106] crayon_1.5.2 rlang_1.1.0 cowplot_1.1.1 KEGGREST_1.40.0

sjl added a commit to Prensner-Lab/RiboseQC that referenced this issue Mar 29, 2024
After running into this[1] issue, I saw a proposed solution of removing
the offending line entirely.  Looking at the code it seems like that
should be fine to do — the current code does this:

    genome_sequence<-get(library(GTF_annotation$genome,character.only = TRUE))
    library(GTF_annotation$genome,character.only = TRUE)
    genome_sequence<-get(GTF_annotation$genome)

This fails because `library(…)` returns a vector of attached libraries,
not just the single one loaded, which `get` can't deal with.  `git
blame` says this line has been there since 2019, and I'm not sure how
this has ever worked.  Maybe no one has ever gone through this branch of
the enclosing `if` statement, or maybe R's `library` function changed at
some point?  I'm not sure, and I'm still a newbie at R so I don't know
how to nail that down further.

Returning to the code, the two lines following that problematic line
just seem to do effectively the same thing, but in two steps instead of
one (indentation mine):

    genome_sequence<-get(library(GTF_annotation$genome,character.only = TRUE))

                         library(GTF_annotation$genome,character.only = TRUE)
    genome_sequence<-get(GTF_annotation$genome)

So I think it's safe to just remove this line entirely.

[1] ohlerlab#21 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants