Your code runs without error on my laptop (macOS 13.2.1; R v4.2.2; Rstudio 2022.07.2), so I have some further questions that might help with troubleshooting (too many to include in a comment):
- Does the example from the docs run without errors/warnings on your system?
- Did you install the sangeranalyseR package via Bioconductor (per the docs)?
- Do you have the most up-to-date Bioconducter installed?
- Have you tried running the example code in a 'fresh' session?
- Are you able to please run the command
sessionInfo()
and edit your question to include the output?
- If you run your example via the reprex package, are there any differences between your output and my output?
The code from your question run on my laptop:
# BiocManager::install("sangeranalyseR")
library(sangeranalyseR)
#> Loading required package: stringr
#> Loading required package: ape
#> Loading required package: Biostrings
#> Loading required package: BiocGenerics
#>
#> Attaching package: 'BiocGenerics'
#> The following objects are masked from 'package:stats':
#>
#> IQR, mad, sd, var, xtabs
#> The following objects are masked from 'package:base':
#>
#> anyDuplicated, aperm, append, as.data.frame, basename, cbind,
#> colnames, dirname, do.call, duplicated, eval, evalq, Filter, Find,
#> get, grep, grepl, intersect, is.unsorted, lapply, Map, mapply,
#> match, mget, order, paste, pmax, pmax.int, pmin, pmin.int,
#> Position, rank, rbind, Reduce, rownames, sapply, setdiff, sort,
#> table, tapply, union, unique, unsplit, which.max, which.min
#> Loading required package: S4Vectors
#> Loading required package: stats4
#>
#> Attaching package: 'S4Vectors'
#> The following objects are masked from 'package:base':
#>
#> expand.grid, I, unname
#> Loading required package: IRanges
#> Loading required package: XVector
#> Loading required package: GenomeInfoDb
#>
#> Attaching package: 'Biostrings'
#> The following object is masked from 'package:ape':
#>
#> complement
#> The following object is masked from 'package:base':
#>
#> strsplit
#> Loading required package: DECIPHER
#> Loading required package: RSQLite
#> Loading required package: parallel
#> Loading required package: reshape2
#> Loading required package: phangorn
#> Loading required package: sangerseqR
#> Loading required package: gridExtra
#>
#> Attaching package: 'gridExtra'
#> The following object is masked from 'package:BiocGenerics':
#>
#> combine
#> Loading required package: shiny
#> Loading required package: shinydashboard
#>
#> Attaching package: 'shinydashboard'
#> The following object is masked from 'package:graphics':
#>
#> box
#> Loading required package: shinyjs
#>
#> Attaching package: 'shinyjs'
#> The following object is masked from 'package:shiny':
#>
#> runExample
#> The following object is masked from 'package:RSQLite':
#>
#> show
#> The following object is masked from 'package:Biostrings':
#>
#> show
#> The following object is masked from 'package:GenomeInfoDb':
#>
#> show
#> The following object is masked from 'package:XVector':
#>
#> show
#> The following object is masked from 'package:IRanges':
#>
#> show
#> The following object is masked from 'package:S4Vectors':
#>
#> show
#> The following object is masked from 'package:stats4':
#>
#> show
#> The following objects are masked from 'package:methods':
#>
#> removeClass, show
#> Loading required package: data.table
#>
#> Attaching package: 'data.table'
#> The following objects are masked from 'package:reshape2':
#>
#> dcast, melt
#> The following object is masked from 'package:IRanges':
#>
#> shift
#> The following objects are masked from 'package:S4Vectors':
#>
#> first, second
#> Loading required package: plotly
#> Loading required package: ggplot2
#>
#> Attaching package: 'plotly'
#> The following object is masked from 'package:ggplot2':
#>
#> last_plot
#> The following object is masked from 'package:phangorn':
#>
#> add_boxplot
#> The following object is masked from 'package:XVector':
#>
#> slice
#> The following object is masked from 'package:IRanges':
#>
#> slice
#> The following object is masked from 'package:S4Vectors':
#>
#> rename
#> The following object is masked from 'package:stats':
#>
#> filter
#> The following object is masked from 'package:graphics':
#>
#> layout
#> Loading required package: DT
#>
#> Attaching package: 'DT'
#> The following objects are masked from 'package:shiny':
#>
#> dataTableOutput, renderDataTable
#> Loading required package: zeallot
#> Loading required package: excelR
#> Loading required package: shinycssloaders
#> Loading required package: ggdendro
#> Loading required package: shinyWidgets
#>
#> Attaching package: 'shinyWidgets'
#> The following object is masked from 'package:shinyjs':
#>
#> alert
#> Loading required package: openxlsx
#> Loading required package: tools
#> Loading required package: rmarkdown
#> Loading required package: knitr
#> Loading required package: seqinr
#>
#> Attaching package: 'seqinr'
#> The following object is masked from 'package:shiny':
#>
#> a
#> The following object is masked from 'package:sangerseqR':
#>
#> read.abif
#> The following object is masked from 'package:Biostrings':
#>
#> translate
#> The following objects are masked from 'package:ape':
#>
#> as.alignment, consensus
#> Loading required package: BiocStyle
#>
#> Attaching package: 'BiocStyle'
#> The following objects are masked from 'package:rmarkdown':
#>
#> html_document, md_document, pdf_document
#> The following object is masked from 'package:shiny':
#>
#> markdown
#> Loading required package: logger
#> Welcome to sangeranalyseR
data("sangerAlignmentData")
data("sangerContigData")
data("sangerReadFData")
rawDataDir <- system.file("extdata", package = "sangeranalyseR")
fastaFN <- file.path(rawDataDir, "fasta", "SangerAlignment", "Sanger_all_reads.fa")
my_sangerAlignmentFa <- new("SangerAlignment",
inputSource = "FASTA",
processMethod = "REGEX",
FASTA_File = fastaFN,
REGEX_SuffixForward = "_[0-9]*_F$",
REGEX_SuffixReverse = "_[0-9]*_R$",
refAminoAcidSeq = "SRQWLFSTNHKDIGTLYFIFGAWAGMVGTSLSILIRAELGHPGALIGDDQIYNVIVTAHAFIMIFFMVMPIMIGGFGNWLVPLMLGAPDMAFPRMNNMSFWLLPPALSLLLVSSMVENGAGTGWTVYPPLSAGIAHGGASVDLAIFSLHLAGISSILGAVNFITTVINMRSTGISLDRMPLFVWSVVITALLLLLSLPVLAGAITMLLTDRNLNTSFFDPAGGGDPILYQHLFWFFGHPEVYILILPGFGMISHIISQESGKKETFGSLGMIYAMLAIGLLGFIVWAHHMFTVGMDVDTRAYFTSATMIIAVPTGIKIFSWLATLHGTQLSYSPAILWALGFVFLFTVGGLTGVVLANSSVDIILHDTYYVVAHFHYVLSMGAVFAIMAGFIHWYPLFTGLTLNNKWLKSHFIIMFIGVNLTFFPQHFLGLAGMPRRYSDYPDAYTTWNIVSTIGSTISLLGILFFFFIIWESLVSQRQVIYPIQLNSSIEWYQNTPPAEHSYSELPLLTN",
minReadsNum = 2,
minReadLength = 20,
minFractionCall = 0.5,
maxFractionLost = 0.5,
geneticCode = GENETIC_CODE,
acceptStopCodons = TRUE,
readingFrame = 1,
processorsNum = 2)
#> Assessing frameshifts in nucleotide sequences:
#> ================================================================================
#>
#> Time difference of 0.05 secs
#> Assessing frameshifts in nucleotide sequences:
#> ================================================================================
#>
#> Time difference of 0.03 secs
#> Assessing frameshifts in nucleotide sequences:
#> ================================================================================
#>
#> Time difference of 0.03 secs
#> Assessing frameshifts in nucleotide sequences:
#> ================================================================================
#>
#> Time difference of 0.03 secs
writeFasta(my_sangerAlignmentFa,
outputDir = tempdir(),
compress = FALSE,
compression_level = NA,
selection = "all")
generateReport(my_sangerAlignmentFa,
outputDir = tempdir(),
includeSangerRead = TRUE,
includeSangerContig = TRUE)
#> processing file: SangerRead_Report_fasta.Rmd
#> output file: SangerRead_Report_fasta.knit.md
#> /usr/local/bin/pandoc +RTS -K512m -RTS SangerRead_Report_fasta.knit.md --to html4 --from markdown+autolink_bare_uris+tex_math_single_backslash --output /private/var/folders/gf/3p_ynkts411bs238rtw3y0b40000gn/T/Rtmplj2Uy8/SangerAlignment/Achl_ACHLO006-09/Sanger_all_reads/SangerRead_Report_fasta.html --lua-filter /Library/Frameworks/R.framework/Versions/4.2/Resources/library/rmarkdown/rmarkdown/lua/pagebreak.lua --lua-filter /Library/Frameworks/R.framework/Versions/4.2/Resources/library/rmarkdown/rmarkdown/lua/latex-div.lua --embed-resources --standalone --variable bs3=TRUE --section-divs --table-of-contents --toc-depth 3 --variable toc_float=1 --variable toc_selectors=h1,h2,h3 --variable toc_collapsed=1 --variable toc_smooth_scroll=1 --variable toc_print=1 --template /Library/Frameworks/R.framework/Versions/4.2/Resources/library/rmarkdown/rmd/h/default.html --no-highlight --variable highlightjs=1 --variable theme=bootstrap --mathjax --variable 'mathjax-url=https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML' --include-in-header /var/folders/gf/3p_ynkts411bs238rtw3y0b40000gn/T//Rtmplj2Uy8/rmarkdown-str3926187706b9.html
#>
#> Output created: /private/var/folders/gf/3p_ynkts411bs238rtw3y0b40000gn/T/RtmplI8nQX/SangerAlignment/SangerAlignment_Report.html
#> [1] "/private/var/folders/gf/3p_ynkts411bs238rtw3y0b40000gn/T/RtmplI8nQX/SangerAlignment/SangerAlignment_Report.html"
Created on 2023-03-02 with reprex v2.0.2
Example from the docs:
library(sangeranalyseR)
#> Loading required package: stringr
#> Loading required package: ape
#> Loading required package: Biostrings
#> Loading required package: BiocGenerics
#>
#> Attaching package: 'BiocGenerics'
#> The following objects are masked from 'package:stats':
#>
#> IQR, mad, sd, var, xtabs
#> The following objects are masked from 'package:base':
#>
#> anyDuplicated, aperm, append, as.data.frame, basename, cbind,
#> colnames, dirname, do.call, duplicated, eval, evalq, Filter, Find,
#> get, grep, grepl, intersect, is.unsorted, lapply, Map, mapply,
#> match, mget, order, paste, pmax, pmax.int, pmin, pmin.int,
#> Position, rank, rbind, Reduce, rownames, sapply, setdiff, sort,
#> table, tapply, union, unique, unsplit, which.max, which.min
#> Loading required package: S4Vectors
#> Loading required package: stats4
#>
#> Attaching package: 'S4Vectors'
#> The following objects are masked from 'package:base':
#>
#> expand.grid, I, unname
#> Loading required package: IRanges
#> Loading required package: XVector
#> Loading required package: GenomeInfoDb
#>
#> Attaching package: 'Biostrings'
#> The following object is masked from 'package:ape':
#>
#> complement
#> The following object is masked from 'package:base':
#>
#> strsplit
#> Loading required package: DECIPHER
#> Loading required package: RSQLite
#> Loading required package: parallel
#> Loading required package: reshape2
#> Loading required package: phangorn
#> Loading required package: sangerseqR
#> Loading required package: gridExtra
#>
#> Attaching package: 'gridExtra'
#> The following object is masked from 'package:BiocGenerics':
#>
#> combine
#> Loading required package: shiny
#> Loading required package: shinydashboard
#>
#> Attaching package: 'shinydashboard'
#> The following object is masked from 'package:graphics':
#>
#> box
#> Loading required package: shinyjs
#>
#> Attaching package: 'shinyjs'
#> The following object is masked from 'package:shiny':
#>
#> runExample
#> The following object is masked from 'package:RSQLite':
#>
#> show
#> The following object is masked from 'package:Biostrings':
#>
#> show
#> The following object is masked from 'package:GenomeInfoDb':
#>
#> show
#> The following object is masked from 'package:XVector':
#>
#> show
#> The following object is masked from 'package:IRanges':
#>
#> show
#> The following object is masked from 'package:S4Vectors':
#>
#> show
#> The following object is masked from 'package:stats4':
#>
#> show
#> The following objects are masked from 'package:methods':
#>
#> removeClass, show
#> Loading required package: data.table
#>
#> Attaching package: 'data.table'
#> The following objects are masked from 'package:reshape2':
#>
#> dcast, melt
#> The following object is masked from 'package:IRanges':
#>
#> shift
#> The following objects are masked from 'package:S4Vectors':
#>
#> first, second
#> Loading required package: plotly
#> Loading required package: ggplot2
#>
#> Attaching package: 'plotly'
#> The following object is masked from 'package:ggplot2':
#>
#> last_plot
#> The following object is masked from 'package:phangorn':
#>
#> add_boxplot
#> The following object is masked from 'package:XVector':
#>
#> slice
#> The following object is masked from 'package:IRanges':
#>
#> slice
#> The following object is masked from 'package:S4Vectors':
#>
#> rename
#> The following object is masked from 'package:stats':
#>
#> filter
#> The following object is masked from 'package:graphics':
#>
#> layout
#> Loading required package: DT
#>
#> Attaching package: 'DT'
#> The following objects are masked from 'package:shiny':
#>
#> dataTableOutput, renderDataTable
#> Loading required package: zeallot
#> Loading required package: excelR
#> Loading required package: shinycssloaders
#> Loading required package: ggdendro
#> Loading required package: shinyWidgets
#>
#> Attaching package: 'shinyWidgets'
#> The following object is masked from 'package:shinyjs':
#>
#> alert
#> Loading required package: openxlsx
#> Loading required package: tools
#> Loading required package: rmarkdown
#> Loading required package: knitr
#> Loading required package: seqinr
#>
#> Attaching package: 'seqinr'
#> The following object is masked from 'package:shiny':
#>
#> a
#> The following object is masked from 'package:sangerseqR':
#>
#> read.abif
#> The following object is masked from 'package:Biostrings':
#>
#> translate
#> The following objects are masked from 'package:ape':
#>
#> as.alignment, consensus
#> Loading required package: BiocStyle
#>
#> Attaching package: 'BiocStyle'
#> The following objects are masked from 'package:rmarkdown':
#>
#> html_document, md_document, pdf_document
#> The following object is masked from 'package:shiny':
#>
#> markdown
#> Loading required package: logger
#> Welcome to sangeranalyseR
rawDataDir <- system.file("extdata", package = "sangeranalyseR")
parentDir <- file.path(rawDataDir, 'Allolobophora_chlorotica', 'ACHLO')
ACHLO_contigs <- SangerAlignment(ABIF_Directory = parentDir,
REGEX_SuffixForward = "_[0-9]*_F.ab1$",
REGEX_SuffixReverse = "_[0-9]*_R.ab1$")
launchApp(ACHLO_contigs)
writeFasta(ACHLO_contigs)
generateReport(ACHLO_contigs)
Created on 2023-03-02 with reprex v2.0.2
My sessionInfo output:
sessionInfo()
#> R version 4.2.2 (2022-10-31)
#> Platform: x86_64-apple-darwin17.0 (64-bit)
#> Running under: macOS Big Sur ... 10.16
#>
#> Matrix products: default
#> BLAS: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRblas.0.dylib
#> LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib
#>
#> locale:
#> [1] en_AU.UTF-8/en_AU.UTF-8/en_AU.UTF-8/C/en_AU.UTF-8/en_AU.UTF-8
#>
#> attached base packages:
#> [1] tools parallel stats4 stats graphics grDevices utils
#> [8] datasets methods base
#>
#> other attached packages:
#> [1] sangeranalyseR_1.8.0 logger_0.2.2 BiocStyle_2.26.0
#> [4] seqinr_4.2-23 knitr_1.42 rmarkdown_2.20
#> [7] openxlsx_4.2.5.2 shinyWidgets_0.7.6 ggdendro_0.1.23
#> [10] shinycssloaders_1.0.0 excelR_0.4.0 zeallot_0.1.0
#> [13] DT_0.27 plotly_4.10.1 ggplot2_3.4.1
#> [16] data.table_1.14.8 shinyjs_2.1.0 shinydashboard_0.7.2
#> [19] shiny_1.7.4 gridExtra_2.3 sangerseqR_1.34.0
#> [22] phangorn_2.11.1 reshape2_1.4.4 DECIPHER_2.26.0
#> [25] RSQLite_2.3.0 Biostrings_2.66.0 GenomeInfoDb_1.34.9
#> [28] XVector_0.38.0 IRanges_2.32.0 S4Vectors_0.36.2
#> [31] BiocGenerics_0.44.0 ape_5.7 stringr_1.5.0
#>
#> loaded via a namespace (and not attached):
#> [1] nlme_3.1-162 bitops_1.0-7 fs_1.6.1
#> [4] bit64_4.0.5 httr_1.4.5 R.cache_0.16.0
#> [7] bslib_0.4.2 utf8_1.2.3 R6_2.5.1
#> [10] DBI_1.1.3 lazyeval_0.2.2 colorspace_2.1-0
#> [13] ade4_1.7-22 withr_2.5.0 tidyselect_1.2.0
#> [16] bit_4.0.5 compiler_4.2.2 cli_3.6.0
#> [19] sass_0.4.5 scales_1.2.1 quadprog_1.5-8
#> [22] digest_0.6.31 R.utils_2.12.2 pkgconfig_2.0.3
#> [25] htmltools_0.5.4 styler_1.9.0 fastmap_1.1.1
#> [28] htmlwidgets_1.6.1 rlang_1.0.6 rstudioapi_0.14
#> [31] jquerylib_0.1.4 generics_0.1.3 jsonlite_1.8.4
#> [34] zip_2.2.2 dplyr_1.1.0 R.oo_1.25.0
#> [37] RCurl_1.98-1.10 magrittr_2.0.3 GenomeInfoDbData_1.2.9
#> [40] Matrix_1.5-3 Rcpp_1.0.10 munsell_0.5.0
#> [43] fansi_1.0.4 lifecycle_1.0.3 R.methodsS3_1.8.2
#> [46] stringi_1.7.12 yaml_2.3.7 MASS_7.3-58.2
#> [49] zlibbioc_1.44.0 plyr_1.8.8 grid_4.2.2
#> [52] blob_1.2.3 promises_1.2.0.1 crayon_1.5.2
#> [55] lattice_0.20-45 pillar_1.8.1 igraph_1.4.1
#> [58] codetools_0.2-19 fastmatch_1.1-3 reprex_2.0.2
#> [61] glue_1.6.2 evaluate_0.20 BiocManager_1.30.20
#> [64] vctrs_0.5.2 httpuv_1.6.9 gtable_0.3.1
#> [67] purrr_1.0.1 tidyr_1.3.0 cachem_1.0.7
#> [70] xfun_0.37 mime_0.12 xtable_1.8-4
#> [73] later_1.3.0 viridisLite_0.4.1 tibble_3.1.8
#> [76] memoise_2.0.1 ellipsis_0.3.2