Skip to content

Commit

Permalink
minor_update
Browse files Browse the repository at this point in the history
  • Loading branch information
Sudaraka88 authored and Sudaraka88 committed Jul 16, 2024
1 parent a15c627 commit 1f3c26b
Show file tree
Hide file tree
Showing 8 changed files with 86 additions and 23 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/r.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,5 @@ jobs:
with:
upload-snapshots: true
error-on: '"error"'


48 changes: 48 additions & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# 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
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: test-coverage

jobs:
test-coverage:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::covr
needs: coverage

- name: Test coverage
run: |
covr::codecov(
quiet = FALSE,
clean = FALSE,
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")
)
shell: Rscript {0}

- name: Show testthat output
if: always()
run: |
## --------------------------------------------------------------------
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
14 changes: 8 additions & 6 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Encoding: UTF-8
LazyData: true
biocViews: Software
Depends: R (>= 4.0.0),
Imports:
Imports:
ape,
Biostrings,
chromoMap,
Expand Down Expand Up @@ -39,13 +39,15 @@ Imports:
utils,
VariantAnnotation
Suggests:
phytools,
ggtree,
ggnewscale,
spam,
spam64
phytools,
ggtree,
ggnewscale,
spam,
spam64,
testthat (>= 3.0.0)
LinkingTo: Rcpp, RcppArmadillo
RoxygenNote: 7.3.2
URL: https://github.com/Sudaraka88/LDWeaver
BugReports: https://github.com/Sudaraka88/LDWeaver/issues
Biarch: TRUE
Config/testthat/edition: 3
2 changes: 1 addition & 1 deletion R/computePairwiseMI.R
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ perform_MI_computation = function(snp.dat, hdw, cds_var, ncores, lr_save_path =
message("This feature requires spam and spam64 packages.")
return(invisible())
} else {
hsq = spam::as.spam(hsq)
# hsq = spam::as.spam(hsq)
}
}

Expand Down
10 changes: 9 additions & 1 deletion R/io_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,6 @@ cleanup = function(dset, delete_after_moving = F){
mv_success = c(mv_success, idx)
}


#### Relocate or delete moved files ####
moved_idx = sort(unique(mv_success))
if(length(moved_idx) > 0){
Expand All @@ -316,6 +315,15 @@ cleanup = function(dset, delete_after_moving = F){
}
unlink(file.path(dset, files[moved_idx]), recursive = T)
}

### Sometimes there are a couple of snpEff files being generated in the working directory, move them to Temp
files = dir(getwd())
idx = c(grep("snpEff_genes.txt", files), grep("snpEff_summary.html", files))
if(length(idx) > 0){
fldr = file.path(dset, "Temp")
cleanup_support(files = file.path(getwd(), files[idx]), fldr)
unlink(file.path(getwd(), files[idx]))
}
}

#' cleanup_support
Expand Down
21 changes: 10 additions & 11 deletions inst/CITATION
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
citHeader("If you find LDWeaver useful, please cite:")

citEntry(entry = "Article",
title = "Detecting co-selection through excess linkage disequilibrium in bacterial genomes",
author = personList(as.person("Sudaraka Mallawaarachchi"),
bibentry(
bibtype = "Article",
title = "Detecting co-selection through excess linkage disequilibrium in bacterial genomes",
author = personList(as.person("Sudaraka Mallawaarachchi"),
as.person("Gerry Tonkin-Hill"),
as.person("Anna K. Pöntinen"),
as.person("Jessica K. Calland"),
Expand All @@ -14,10 +13,10 @@ author = personList(as.person("Sudaraka Mallawaarachchi"),
as.person("David Balding"),
as.person("Nicholas J. Croucher"),
as.person("Jukka Corander")),
journal = "bioRxiv",
year = "2023",
pages = "2023.08.04.551407",
url = "https://doi.org/10.1101/2023.08.04.551407",

textVersion = "Sudaraka Mallawaarachchi et al. (2023) Detecting co-selection through excess linkage disequilibrium in bacterial genomes. bioRxiv https://doi.org/10.1101/2023.08.04.551407."
journal = "NAR Genomics and Bioinformatics",
year = "2024",
volume = "6",
number = "2",
pages = "lqae061",
doi = "10.1093/nargab/lqae061"
)
File renamed without changes.
12 changes: 8 additions & 4 deletions man/LDWeaver.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1f3c26b

Please sign in to comment.