Skip to content

Commit

Permalink
Merge pull request #50 from ShawHahnLab/release-0.3.0
Browse files Browse the repository at this point in the history
Release 0.3.0
  • Loading branch information
ressy authored Sep 11, 2019
2 parents 0bf410b + b477ef3 commit 1074a71
Show file tree
Hide file tree
Showing 62 changed files with 834 additions and 785 deletions.
3 changes: 0 additions & 3 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@
^\.Rproj\.user$
^\.travis.yml$
.utils
environment.yml
install_linux_conda.sh
install_linux.sh
install_windows.cmd
install_windows.R
install_mac.command
README.md
GUIDE.Rmd
Expand Down
21 changes: 18 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
# https://docs.travis-ci.com/user/multi-os/
os:
- linux
- osx
# https://docs.travis-ci.com/user/languages/r
language: r
bioc_packages: msa
r:
- oldrel
- release
- devel
- bioc-release
- bioc-devel
# Mac OS R devel build URL is out of date, currently.
# https://travis-ci.community/t/672
matrix:
exclude:
- r: devel
os: osx
cache: packages
script:
- R CMD build .
- R CMD check *tar.gz
- ./inst/bin/demo.sh
- ./inst/bin/demo_empty.sh
- ./exec/demo.sh
- ./exec/demo_empty.sh
- ./tools/travis_install_test.sh
# Don't cache the installed chiimp R package itself. We want to start without
# it installed for each test.
before_cache:
- rm -rf $HOME/R/Library/chiimp
12 changes: 0 additions & 12 deletions .utils/spellcheck.R

This file was deleted.

8 changes: 6 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
Package: chiimp
Title: Computational, High-throughput Individual Identification through Microsatellite Profiling
Version: 0.2.3
Version: 0.3.0
Authors@R: person("Jesse", "Connell", email = "[email protected]", role = c("aut", "cre"))
Description: An R package to analyze microsatellites in high-throughput sequencing datasets.
Depends: R (>= 3.2.3)
License: file LICENSE
Encoding: UTF-8
LazyData: true
Language: en-US
biocViews:
Imports:
argparser (>= 0.4),
Biostrings (>= 2.38.4),
dnaplotr (>= 0.1),
dnar (>= 0.1),
devtools (>= 1.13.5),
graphics (>= 3.2.3),
grDevices (>= 3.2.3),
kableExtra (>= 0.2.1.9000),
Expand All @@ -29,7 +33,7 @@ Imports:
Remotes:
github::sherrillmix/dnar,
github::sherrillmix/dnaplotr
RoxygenNote: 6.0.1
RoxygenNote: 6.1.1
Suggests:
testthat,
roxygen2
14 changes: 11 additions & 3 deletions GUIDE.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

title: "CHIIMP User Guide"
author: "Jesse Connell"
date: "2018/11/07"
date: "2019/07/10"
output:
pdf_document:
toc: true
Expand Down Expand Up @@ -34,8 +34,12 @@ package documentation.

## Installation

Most dependencies are provided by installation of [R] and [RStudio]. Once these
are installed, follow the specific instructions below for your operating system.
Most dependencies are provided by installation of [R] and [RStudio]. Once
these are installed, follow the specific instructions below for your operating
system. In all three cases CHIIMP performs an anlysis when a configuration
file is dragged and dropped onto the desktop icon; there is no interactive
interface via the icon, though the R package can be used interactively. See
the Usage section for more information.

### Windows

Expand All @@ -51,6 +55,10 @@ right-click (control+click) and select "Open" in the menu that appears.
Apple has specific instructions [here](https://support.apple.com/kb/PH25088?locale=en_US)
about these security setings.

If a window appears recommending installation of the Mac OS command-line
developer tools, go ahead and install them. After that you'll probably need to
re-run the CHIIMP installer again to finish the install.

### Linux

On Linux, run the `install_linux.sh` shell script to automatically install the
Expand Down
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export(full_analysis)
export(histogram)
export(load_allele_names)
export(load_config)
export(load_csv)
export(load_dataset)
export(load_genotypes)
export(load_locus_attrs)
Expand All @@ -39,6 +40,7 @@ export(sample_summary_funcs)
export(save_alignment_images)
export(save_alignments)
export(save_allele_seqs)
export(save_csv)
export(save_dataset)
export(save_dist_mat)
export(save_histograms)
Expand Down
21 changes: 21 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
# chiimp 0.3.0

* Improved icon setup on Mac OS ([#48]).
* Added support for use of reverse primers in locus-matching ([#47]).
* Made read count ratio thresholds for PCR stutter and artifact sequence
flagging customizable ([#46]).
* Added drag-and-drop usage message when desktop icon is opened directly
([#44]).
* Added `load_csv` and `save_csv` functions to centralize loading and saving
tabular data ([#43]).
* Reorganized installer and wrapper scripts ([#38]).
* Added support for demo scripts and integration testing in Mac OS ([#32]).

[#48]: https://github.com/ShawHahnLab/chiimp/pull/48
[#47]: https://github.com/ShawHahnLab/chiimp/pull/47
[#46]: https://github.com/ShawHahnLab/chiimp/pull/46
[#44]: https://github.com/ShawHahnLab/chiimp/pull/44
[#43]: https://github.com/ShawHahnLab/chiimp/pull/43
[#38]: https://github.com/ShawHahnLab/chiimp/pull/38
[#32]: https://github.com/ShawHahnLab/chiimp/pull/32

# chiimp 0.2.3

* Fixed package checks and testing on latest R development releases ([#27]).
Expand Down
60 changes: 46 additions & 14 deletions R/analyze_dataset.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@
#' \code{\link{load_locus_attrs}}.
#' @param nrepeats number of repeats of each locus' motif to require for a
#' match (see \code{\link{analyze_seqs}}).
#' @param stutter.count.ratio_max highest ratio of read counts for second most
#' frequent sequence to the most frequent where the second will be
#' considered stutter (see \code{\link{analyze_seqs}}).
#' @param artifact.count.ratio_max as for \code{stutter.count.ratio_max} but for
#' non-stutter artifact sequences.
#' @param use_reverse_primers consider the ReversePrimer column from the locus
#' attributes for locus-matching?
#' @param reverse_primer_r1 Is each reverse primer given in its orientation on
#' the forward read? (See \code{\link{analyze_seqs}})
#' @param ncores integer number of CPU cores to use in parallel for sample
#' analysis. Defaults to one less than half the number of detected cores with
#' a minimum of 1. If 1, the function will run without using the
Expand All @@ -44,16 +53,25 @@
#' per-sample data frames.
#'
#' @export
analyze_dataset <- function(dataset,
locus_attrs,
nrepeats,
ncores = 0,
analysis_opts,
summary_opts,
analysis_function=analyze_sample,
summary_function=summarize_sample,
known_alleles=NULL,
name_args=list()) {
analyze_dataset <- function(
dataset,
locus_attrs,
nrepeats,
stutter.count.ratio_max = config.defaults$seq_analysis$
stutter.count.ratio_max,
artifact.count.ratio_max = config.defaults$seq_analysis$
artifact.count.ratio_max,
use_reverse_primers = config.defaults$seq_analysis$
use_reverse_primers,
reverse_primer_r1 = config.defaults$seq_analysis$
reverse_primer_r1,
ncores = 0,
analysis_opts,
summary_opts,
analysis_function=analyze_sample,
summary_function=summarize_sample,
known_alleles=NULL,
name_args=list()) {
if (! all(dataset$Locus %in% locus_attrs$Locus)) {
rogue_loci <- unique(dataset$Locus[! dataset$Locus %in% locus_attrs$Locus])
msg <- paste("ERROR: Locus names in dataset not in attributes table:",
Expand All @@ -63,9 +81,15 @@ analyze_dataset <- function(dataset,
if (ncores == 0) {
ncores <- max(1, as.integer(parallel::detectCores() / 2) - 1)
}
analyze.file <- function(fp, locus_attrs, nrepeats) {
analyze.file <- function(fp, locus_attrs, nrepeats,
stutter.count.ratio_max, artifact.count.ratio_max,
use_reverse_primers,
reverse_primer_r1) {
seqs <- load_seqs(fp)
analyze_seqs(seqs, locus_attrs, nrepeats)
analyze_seqs(seqs, locus_attrs, nrepeats,
stutter.count.ratio_max, artifact.count.ratio_max,
use_reverse_primers,
reverse_primer_r1)
}
analyze.entry <- function(entry, analysis_opts, summary_opts,
analysis_function, summary_function,
Expand Down Expand Up @@ -114,7 +138,11 @@ analyze_dataset <- function(dataset,
fps <- unique(dataset$Filename)
analyzed_files <- parallel::parLapply(cluster, fps, analyze.file,
locus_attrs = locus_attrs,
nrepeats = nrepeats)
nrepeats = nrepeats,
stutter.count.ratio_max,
artifact.count.ratio_max,
use_reverse_primers,
reverse_primer_r1)
names(analyzed_files) <- fps
raw.results <- parallel::parApply(cluster, dataset, 1, analyze.entry,
analysis_opts = analysis_opts,
Expand All @@ -130,7 +158,11 @@ analyze_dataset <- function(dataset,
fps <- unique(dataset$Filename)
analyzed_files <- lapply(fps, analyze.file,
locus_attrs = locus_attrs,
nrepeats = nrepeats)
nrepeats = nrepeats,
stutter.count.ratio_max,
artifact.count.ratio_max,
use_reverse_primers,
reverse_primer_r1)
names(analyzed_files) <- fps
raw.results <- apply(dataset, 1, analyze.entry,
analysis_opts = analysis_opts,
Expand Down
Loading

0 comments on commit 1074a71

Please sign in to comment.