Skip to content

Commit

Permalink
Merge pull request #7 from fcampelo/Update_2024Sep
Browse files Browse the repository at this point in the history
Update 2024 sep
  • Loading branch information
fcampelo authored Sep 3, 2024
2 parents ee17e77 + 2fe798c commit 05e7da2
Show file tree
Hide file tree
Showing 27 changed files with 26,352 additions and 8,902 deletions.
93 changes: 34 additions & 59 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag.
# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
#
# NOTE: This workflow is overkill for most R packages and
# check-standard.yaml is likely a better choice.
# usethis::use_github_action("check-standard") will install it.
on:
push:
branches:
- main
- master
branches: [main, master, Update_2024Sep]
pull_request:
branches:
- main
- master
branches: [main, master, Update_2024Sep]

name: R-CMD-check
name: R-CMD-check.yaml

permissions: read-all

jobs:
R-CMD-check:
Expand All @@ -22,66 +24,39 @@ jobs:
fail-fast: false
matrix:
config:
- {os: macos-latest, r: 'release'}

- {os: windows-latest, r: 'release'}
- {os: macOS-latest, r: 'release'}
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
- {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
# use 4.0 or 4.1 to check with rtools40's older compiler
- {os: windows-latest, r: 'oldrel-3'}

- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}
- {os: ubuntu-latest, r: 'oldrel-2'}
- {os: ubuntu-latest, r: 'oldrel-3'}

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v1
- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-pandoc@v1

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}

- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v2
- uses: r-lib/actions/setup-r-dependencies@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-

- name: Install system dependencies
if: runner.os == 'Linux'
run: |
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
shell: Rscript {0}

- name: Check
env:
_R_CHECK_CRAN_INCOMING_REMOTE_: false
_R_CHECK_FORCE_SUGGESTS_: false
run: |
options(crayon.enabled = TRUE)
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
shell: Rscript {0}
extra-packages: any::rcmdcheck
needs: check

- name: Upload check results
if: failure()
uses: actions/upload-artifact@main
- uses: r-lib/actions/check-r-package@v2
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check
upload-snapshots: true
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
7 changes: 3 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: CALANGO
Type: Package
Title: Comparative Analysis with Annotation-Based Genomic Components
Version: 1.0.16
Date: 2023-04-26
Version: 1.0.20
Date: 2024-09-03
Language: en-US
Authors@R: c(person("Francisco", "Lobo",
email = "franciscolobo@gmail.com",
Expand Down Expand Up @@ -35,7 +35,6 @@ Imports: assertthat (>= 0.2.1),
rmarkdown (>= 2.1.0),
nlme (>= 3.1.0),
BiocManager (>= 1.30.10),
taxize (>= 0.9.92),
dendextend (>= 1.15.2),
heatmaply (>= 1.1.0),
ggplot2 (>= 2.3.2),
Expand All @@ -49,7 +48,7 @@ Suggests: AnnotationDbi,
KEGGREST,
GO.db
Encoding: UTF-8
RoxygenNote: 7.2.3
RoxygenNote: 7.3.2
URL: https://labpackages.github.io/CALANGO/
BugReports: https://github.com/fcampelo/CALANGO/issues/
VignetteBuilder: knitr
Binary file modified Meta/vignette.rds
Binary file not shown.
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
- Regular maintenance update:
- Minor bug fix that resulted in occasional errors on Windows machines
- Minor updates to documentation
- Minor tweak to dependencies
- Fixed problem that resulted in `retrieve_calanguize_genomes()` wiping out
the target folder

# CALANGO 1.0.14

Expand Down
16 changes: 10 additions & 6 deletions R/GenerateTree.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# Function removed since it's not being used anywhere else in the package
# by: F. Campelo, 3 Sept 2024


# Function to generate and plot a taxonomic tree
GenerateTree <- function(taxonIds, db = "ncbi") {
taxize_class <- taxize::classification(taxonIds, db = db)
taxize_tree <- taxize::class2tree(taxize_class, check = TRUE)
# taxize::plot.classtree(taxize_tree)
invisible(taxize_tree)
}
# GenerateTree <- function(taxonIds, db = "ncbi") {
# taxize_class <- taxize::classification(taxonIds, db = db)
# taxize_tree <- class2tree(taxize_class, check = TRUE)
# # taxize::plot.classtree(taxize_tree)
# invisible(taxize_tree)
# }
16 changes: 9 additions & 7 deletions R/retrieve_calanguize_genomes.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
#' documentation of \code{utils::download.file()}.
#' @param unzip The unzip method to be used. See the documentation of
#' \code{utils::unzip()} for details.
#' @param overwrite If TRUE, overwrite existing files in target the folder
#' (the equivalent of unzip -o), otherwise ignore such files (the equivalent of
#' unzip -n).
#'
#' @export
#'
Expand All @@ -29,18 +32,16 @@

retrieve_calanguize_genomes <- function(target.dir,
method = "auto",
unzip = getOption("unzip")){
unzip = getOption("unzip"),
overwrite = TRUE){

# ================== Sanity checks ==================
assertthat::assert_that(is.character(target.dir),
length(url) == 1)

if(!dir.exists(target.dir)){
dir.create(target.dir, recursive = TRUE)
} else {
filelist <- dir(target.dir, full.names = TRUE)
unlink(filelist, recursive = TRUE, force = TRUE)
}
}

url <- "https://github.com/fcampelo/CALANGO/raw/master/inst/extdata/calanguize_genomes.zip"

Expand All @@ -53,8 +54,9 @@ retrieve_calanguize_genomes <- function(target.dir,

utils::unzip(paste0(target.dir, "/tmpdata.zip"),
unzip = unzip,
exdir = target.dir)
unlink(paste0(target.dir, "/__MACOSX"), recursive = TRUE, force = TRUE)
exdir = target.dir,
overwrite = overwrite)
#unlink(paste0(target.dir, "/__MACOSX"), recursive = TRUE, force = TRUE)

file.remove(paste0(target.dir, "/tmpdata.zip"))

Expand Down
Loading

0 comments on commit 05e7da2

Please sign in to comment.