Skip to content

Commit

Permalink
Merge pull request #47 from hugheylab/grace
Browse files Browse the repository at this point in the history
added new rhub and more graceful error handling.
  • Loading branch information
jakejh authored Aug 26, 2024
2 parents 235a640 + 16dc6a5 commit b9abf49
Show file tree
Hide file tree
Showing 13 changed files with 120 additions and 20 deletions.
95 changes: 95 additions & 0 deletions .github/workflows/rhub.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# R-hub's generic GitHub Actions workflow file. It's canonical location is at
# https://github.com/r-hub/actions/blob/v1/workflows/rhub.yaml
# You can update this file to a newer version using the rhub2 package:
#
# rhub::rhub_setup()
#
# It is unlikely that you need to modify this file manually.

name: R-hub
run-name: "${{ github.event.inputs.id }}: ${{ github.event.inputs.name || format('Manually run by {0}', github.triggering_actor) }}"

on:
workflow_dispatch:
inputs:
config:
description: 'A comma separated list of R-hub platforms to use.'
type: string
default: 'linux,windows,macos'
name:
description: 'Run name. You can leave this empty now.'
type: string
id:
description: 'Unique ID. You can leave this empty now.'
type: string

jobs:

setup:
runs-on: ubuntu-latest
outputs:
containers: ${{ steps.rhub-setup.outputs.containers }}
platforms: ${{ steps.rhub-setup.outputs.platforms }}

steps:
# NO NEED TO CHECKOUT HERE
- uses: r-hub/actions/setup@v1
with:
config: ${{ github.event.inputs.config }}
id: rhub-setup

linux-containers:
needs: setup
if: ${{ needs.setup.outputs.containers != '[]' }}
runs-on: ubuntu-latest
name: ${{ matrix.config.label }}
strategy:
fail-fast: false
matrix:
config: ${{ fromJson(needs.setup.outputs.containers) }}
container:
image: ${{ matrix.config.container }}

steps:
- uses: r-hub/actions/checkout@v1
- uses: r-hub/actions/platform-info@v1
with:
token: ${{ secrets.RHUB_TOKEN }}
job-config: ${{ matrix.config.job-config }}
- uses: r-hub/actions/setup-deps@v1
with:
token: ${{ secrets.RHUB_TOKEN }}
job-config: ${{ matrix.config.job-config }}
- uses: r-hub/actions/run-check@v1
with:
token: ${{ secrets.RHUB_TOKEN }}
job-config: ${{ matrix.config.job-config }}

other-platforms:
needs: setup
if: ${{ needs.setup.outputs.platforms != '[]' }}
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.label }}
strategy:
fail-fast: false
matrix:
config: ${{ fromJson(needs.setup.outputs.platforms) }}

steps:
- uses: r-hub/actions/checkout@v1
- uses: r-hub/actions/setup-r@v1
with:
job-config: ${{ matrix.config.job-config }}
token: ${{ secrets.RHUB_TOKEN }}
- uses: r-hub/actions/platform-info@v1
with:
token: ${{ secrets.RHUB_TOKEN }}
job-config: ${{ matrix.config.job-config }}
- uses: r-hub/actions/setup-deps@v1
with:
job-config: ${{ matrix.config.job-config }}
token: ${{ secrets.RHUB_TOKEN }}
- uses: r-hub/actions/run-check@v1
with:
job-config: ${{ matrix.config.job-config }}
token: ${{ secrets.RHUB_TOKEN }}
6 changes: 3 additions & 3 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Version: 1.1.3
Date: 2023-05-23 23:24:27 UTC
SHA: 82211b24fe055620ddf60bc02b75576318738495
Version: 1.1.5
Date: 2024-01-22 18:38:12 UTC
SHA: 235a640089660206e3a1cd6489b43dfee2f6ff38
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: seeker
Type: Package
Title: Simplified Fetching and Processing of Microarray and RNA-Seq Data
Version: 1.1.5
Version: 1.1.6
Authors@R: c(
person('Jake', 'Hughey', , '[email protected]', role = c('aut', 'cre')),
person('Josh', 'Schoenbachler', , '[email protected]', role = 'aut'))
Expand All @@ -26,7 +26,7 @@ URL: https://seeker.hugheylab.org, https://github.com/hugheylab/seeker
License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.2.3
RoxygenNote: 7.3.2
Roxygen: list(markdown = TRUE)
Depends: R (>= 3.5)
Imports:
Expand Down
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# seeker 1.1.6
* Made error handling more graceful.

# seeker 1.1.5
* Added support for GPL17811 (thanks to @jacorvar).

Expand Down
7 changes: 6 additions & 1 deletion R/fetch.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ fetchMetadata = function(
'?save=efetch&db=sra&rettype=runinfo&term=', bioproject)
sep = ','}

raw = curl::curl_fetch_memory(url)
raw = tryCatch(curl::curl_fetch_memory(url), error = \(e) e)
metadata = if (inherits(raw, 'error')) {
message('Unable to fetch metadata. Host may be temporarily unavailable.')
return(data.table())
}

metadata = fread(text = rawToChar(raw$content), sep = sep, na.strings = '')
data.table::setorder(metadata)
if (!is.null(file)) fwrite(metadata, file)
Expand Down
7 changes: 6 additions & 1 deletion R/install_sys_deps.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@ installSraToolkit = function(installDir, rprofileDir) {
sraVersion = max(regmatches(x, m))

# Based on operating system, download correct version to correct path
sraOsTar = if (Sys.info()[['sysname']] == 'Darwin') 'mac64' else 'ubuntu64'
sraOsTar = if (Sys.info()[['sysname']] == 'Darwin') {
uname = system('uname -m', intern = TRUE)
if (uname == 'x86_64') 'mac-x86_64' else 'mac-arm64'
} else {
'ubuntu64'
}
sraTar = glue('sratoolkit.{sraVersion}-{sraOsTar}.tar.gz')

# Download based on version and OS, unzip, then rename directory
Expand Down
16 changes: 3 additions & 13 deletions cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,9 @@

### R-hub

`devtools::check_rhub()`:

0 errors ✓ | 0 warnings ✓ | 2 notes ✓

❯ checking for non-standard things in the check directory ... NOTE
Found the following files/directories:
''NULL''

❯ checking for detritus in the temp directory ... NOTE
Found the following files/directories:
'lastMiKTeXException'
0 errors ✓ | 0 warnings ✓ | 0 notes ✓

See results for [Windows](https://builder.r-hub.io/status/seeker_1.1.5.tar.gz-8a323a68035846eb827c4bcdd88625b5), [Ubuntu](https://builder.r-hub.io/status/seeker_1.1.5.tar.gz-0e06ae6f6ad84e0bb98821147bf0488c), and [Fedora](https://builder.r-hub.io/status/seeker_1.1.5.tar.gz-6d6c440ee7bd4a6d98c0b01f1f7fb3af).
See results for Mac, Windows, and Linux [here]().

### GitHub Actions

Expand All @@ -30,4 +20,4 @@ See results for Mac, Windows, and Ubuntu [here]().

## Changes from current CRAN release

* Added support for GPL17811.
* Made error handling related to internet resources more graceful.
Binary file modified tests/testthat/data/GPL6887.qs
Binary file not shown.
Binary file modified tests/testthat/data/GPL7202.qs
Binary file not shown.
Binary file modified tests/testthat/data/map_pkg_ver.qs
Binary file not shown.
Binary file modified tests/testthat/data/multiqc_output.qs
Binary file not shown.
Binary file modified tests/testthat/data/seeker_output_full.qs
Binary file not shown.
2 changes: 2 additions & 0 deletions tests/testthat/test-fetch.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ test_that('fetchMetadata', {
paramsNow = params[[step]]

metadataObs = fetchMetadata(paramsNow$bioproject)
skip_if(nrow(metadataObs) == 0L)

idx = metadataObs[[paramsNow$include$colname]] %in% paramsNow$include$values
metadataObs = metadataObs[idx]

Expand Down

0 comments on commit b9abf49

Please sign in to comment.