Bioconductor / AnnotationForge

Tools for building SQLite-based annotation data packages
https://bioconductor.org/packages/AnnotationForge
4 stars 9 forks source link

A warning message of 'Permission denied'. How should I deal with it? Thanks very much #24

Closed Wull1994 closed 2 years ago

Wull1994 commented 2 years ago

This is the first time I use the package. I want to establish an annotation package of my species (Scophthalmus maximus) with AnnotationForge package in the transcriptome analysis. However, there are something wrong with R: Warning message: In file.remove(dbFileName) : cannot remove file './org.SMbrain.eg.sqlite', reason 'Permission denied' How can I solve the problem?

nturaga commented 2 years ago

Can you submit a reproducible example with code and sessionInfo()?

Wull1994 commented 2 years ago

[Uploading out.emapper.annotations.csv…]()

Thanks very much. The code was as follows:

library(tidyverse) library(AnnotationForge) emapper <- read.csv("out.emapper.annotations.csv", header = T) %>%

  • dplyr::select(GID=query_name,Gene_Symbol=Preferred_name,
  • GO=GOs,KO=KEGG_ko,Pathway =KEGG_Pathway,
  • OG =eggNOG_OGs,Gene_Name =Description) gene_info <- dplyr::select(emapper,GID,Gene_Name) %>%
  • dplyr::filter(!is.na(Gene_Name)) gene2go <- dplyr::select(emapper,GID,GO) %>%
  • separate_rows(GO, sep = ',', convert = F) %>%
  • filter(GO!="-",!is.na(GO)) %>%
  • mutate(EVIDENCE = 'A') Symbol_info <- dplyr::select(emapper,GID,Gene_Symbol)%>%
  • dplyr::filter(!is.na(Gene_Symbol)) AnnotationForge::makeOrgPackage(gene_info=gene_info,
  • go=gene2go,
  • symbol_info=Symbol_info,
  • maintainer='WLL1332958629@qq.com',
  • author='WLL',
  • version="0.1" ,
  • outputDir=".",
  • tax_id="59729",
  • genus="S",
  • species="Mbrain",
  • goTable = "go") Populating genes table: genes table filled Populating gene_info table: gene_info table filled Populating go table: go table filled Populating symbol_info table: symbol_info table filled table metadata filled

'select()' returned many:1 mapping between keys and columns Dropping GO IDs that are too new for the current GO.db Populating go table: go table filled Populating go_bp table: go_bp table filled Populating go_cc table: go_cc table filled Populating go_mf table: go_mf table filled 'select()' returned many:1 mapping between keys and columns Populating go_bp_all table: go_bp_all table filled Populating go_cc_all table: go_cc_all table filled Populating go_mf_all table: go_mf_all table filled Populating go_all table: go_all table filled Creating package in ./org.SMbrain.eg.db Now deleting temporary database file [1] "./org.SMbrain.eg.db" Warning message: In file.remove(dbFileName) : cannot remove file './org.SMbrain.eg.sqlite', reason 'Permission denied'

Thanks very much and I'm looking forward to your constructive comments.

hpages commented 2 years ago

Please put the code of your reproducible example inside a ``` ... ``` block, like this:

your
code
here
```

The current formatting is messed up so it's very hard to read and impossible to copy/paste. Thanks!
hpages commented 2 years ago

and don't forget your sessionInfo() as requested by Nitesh.

Wull1994 commented 2 years ago

I am deeply sorry for the inconvenience caused to you. I want to establish an annotation package of my species (Scophthalmus maximus) with AnnotationForge package with code as follows:

'''

library(tidyverse) library(AnnotationForge)

emapper <- read.csv("out.emapper.annotations.csv", header = T) %>% dplyr::select(GID=query_name,Gene_Symbol=Preferred_name, GO=GOs,KO=KEGG_ko,Pathway =KEGG_Pathway, OG =eggNOG_OGs,Gene_Name =Description)

gene_info <- dplyr::select(emapper,GID,Gene_Name) %>% dplyr::filter(!is.na(Gene_Name))

gene2go <- dplyr::select(emapper,GID,GO) %>% separate_rows(GO, sep = ',', convert = F) %>% filter(GO!="-",!is.na(GO)) %>% mutate(EVIDENCE = 'A')

Symbol_info <- dplyr::select(emapper,GID,Gene_Symbol)%>% dplyr::filter(!is.na(Gene_Symbol))

establish the annotation package

AnnotationForge::makeOrgPackage(gene_info=gene_info, go=gene2go, symbol_info=Symbol_info, maintainer='WLL1332958629@qq.com', author='WLL', version="0.1" , outputDir=".", tax_id="59729", genus="S", species="Mbrain", goTable = "go")

'''

The sessionInfo() and results were as follows:

'''

sessionInfo() '''

R version 4.1.2 (2021-11-01) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 19042)

Matrix products: default

locale: [1] LC_COLLATE=Chinese (Simplified)_China.936 LC_CTYPE=Chinese (Simplified)_China.936 LC_MONETARY=Chinese (Simplified)_China.936 [4] LC_NUMERIC=C LC_TIME=Chinese (Simplified)_China.936

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

other attached packages: [1] AnnotationForge_1.36.0 AnnotationDbi_1.56.2 IRanges_2.28.0 S4Vectors_0.32.3 Biobase_2.54.0 BiocGenerics_0.40.0
[7] forcats_0.5.1 stringr_1.4.0 dplyr_1.0.7 purrr_0.3.4 readr_2.1.1 tidyr_1.1.4
[13] tibble_3.1.6 ggplot2_3.3.5 tidyverse_1.3.1

loaded via a namespace (and not attached): [1] httr_1.4.2 bit64_4.0.5 jsonlite_1.7.2 viridisLite_0.4.0 modelr_0.1.8 assertthat_0.2.1
[7] blob_1.2.2 GenomeInfoDbData_1.2.7 cellranger_1.1.0 pillar_1.6.4 RSQLite_2.2.9 backports_1.4.1
[13] glue_1.6.0 digest_0.6.29 RColorBrewer_1.1-2 XVector_0.34.0 rvest_1.0.2 colorspace_2.0-2
[19] htmltools_0.5.2 XML_3.99-0.8 pkgconfig_2.0.3 broom_0.7.10 haven_2.4.3 zlibbioc_1.40.0
[25] GO.db_3.14.0 scales_1.1.1 tzdb_0.2.0 KEGGREST_1.34.0 generics_0.1.1 ellipsis_0.3.2
[31] cachem_1.0.6 withr_2.4.3 lazyeval_0.2.2 cli_3.1.0 magrittr_2.0.1 crayon_1.4.2
[37] readxl_1.3.1 memoise_2.0.1 fs_1.5.2 fansi_0.5.0 xml2_1.3.3 tools_4.1.0
[43] data.table_1.14.2 hms_1.1.1 lifecycle_1.0.1 plotly_4.10.0 munsell_0.5.0 reprex_2.0.1
[49] Biostrings_2.62.0 compiler_4.1.0 GenomeInfoDb_1.30.0 rlang_0.4.12 grid_4.1.0 RCurl_1.98-1.5
[55] rstudioapi_0.13 htmlwidgets_1.5.4 bitops_1.0-7 gtable_0.3.0 DBI_1.1.2 R6_2.5.1
[61] lubridate_1.8.0 fastmap_1.1.0 bit_4.0.4 utf8_1.2.2 stringi_1.7.6 Rcpp_1.0.7
[67] vctrs_0.3.8 png_0.1-7 dbplyr_2.1.1 tidyselect_1.1.1

Besides, the data has also been submitted. Please see:

out.emapper.annotations.csv

nturaga commented 2 years ago

Hi @Wull1994 ,

I'm unable to reproduce your issue. Can you paste the error exactly please? I don't get a permission denied error on that function. Please try and run the function in a folder you have permissions to write to. Because it creates a new folder called org.SMbrain.eg.db.

>
 + AnnotationForge::makeOrgPackage(gene_info=gene_info,
 +                                 go=gene2go,
 +                                 symbol_info=Symbol_info,
 +                                 maintainer='WLL1332958629@qq.com',
 +                                 author='WLL',
 +                                 version="0.1" ,
 +                                 outputDir=".",
 +                                 tax_id="59729",
 +                                 genus="S",
 +                                 species="Mbrain",
 +                                 goTable = "go")
 +
 + Populating genes table:
 genes table filled
 Populating gene_info table:
 gene_info table filled
 Populating go table:
 go table filled
 Populating symbol_info table:
 symbol_info table filled
 table metadata filled
 'select()' returned many:1 mapping between keys and columns
 Dropping GO IDs that are too new for the current GO.db
 Populating go table:
 go table filled
 Populating go_bp table:
 go_bp table filled
 Populating go_cc table:
 go_cc table filled
 Populating go_mf table:
 go_mf table filled
 'select()' returned many:1 mapping between keys and columns
 Populating go_bp_all table:
 go_bp_all table filled
 Populating go_cc_all table:
 go_cc_all table filled
 Populating go_mf_all table:
 go_mf_all table filled
 Populating go_all table:
 go_all table filled
 Creating package in ./org.SMbrain.eg.db
 Now deleting temporary database file
 [1] "./org.SMbrain.eg.db"

Also, PLEASE format your code properly for us to be able to read it and test it. https://docs.github.com/en/github/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax this document will help if you are not familiar with it.

Wull1994 commented 2 years ago

Hi @nturaga Thanks very much and sorry for didn't reply for so long. I think I have known where the problem is. Indeed, as far as I am concerned, I still have a lot to learn after I have just come into contact with github. Thank you for your patient guidance.

nturaga commented 2 years ago

Hi @Wull1994 , i'm closing the issue since I think it is resolved. Please feel free to reopen it if you think it's not, and make sure to ping me at my handle @nturaga.

permia commented 1 year ago

Hi @nturaga Thanks very much and sorry for didn't reply for so long. I think I have known where the problem is. Indeed, as far as I am concerned, I still have a lot to learn after I have just come into contact with github. Thank you for your patient guidance.

I come across the same error. How do you solve this problems?

lshep commented 1 year ago

@permia -- as requested from previous commenters. Please provide your exact code you are running including the error and your sessionInfo(). Thank you