Skip to content

Commit

Permalink
Create vignette (#62)
Browse files Browse the repository at this point in the history
* Update DESCRIPTION

* Create MMAPPR2.rmd

* Update MMAPPR2.rmd

* Update MMAPPR2.rmd

* Update MMAPPR2.rmd

* Update MMAPPR2.rmd

* Update README.md

* Update README.md

* Update MMAPPR2.rmd

* Update README.md

* Update MMAPPR2.rmd

* Update minMapQuality doc

* Remove ref genome

* remove need for chr5_distance object

* Remove need for dummy_distance object

* Remove need for dummy_distance object

* Refactor chr5 MD objects to data folder

* Add data files

* Update MMAPPR2.rmd

* Rename read_bam to distance

* Try dynamic examples on mmappr

* Document data

* Try to fix tests

* Update and rename MMAPPR2.rmd to MMAPPR2.Rmd

* Update MMAPPR2.Rmd

* Update MmapprParam show method

* BAM files in extdata

* Refactor to use extdata BAMs

* Update MMAPPR2.Rmd

* Add MMAPPR2data to mmappr and calculateDistance docs

* Use intermediate MDs in docs

* Install MMAPPR2data in Travis script

* Use only dummy BAM in tests

* Fix file validity

* Update tests for new data

* Index every file in BamFileList

* Remove skipDebug

* Update README.md

* Redo MD objects

* Update tests for new data

* Remove old test BAM files, update README

* Update MMAPPR2.Rmd

* Update docs to match MMAPPR2data change

* Remove .addBamFileIndex from validity check

* Delete extdata

* Bump version

* Update docs

* Fix doc error

* Change system() to system2()

* Update MMAPPR2.Rmd

* Change back to system; system2 was failing

* Remove index warning when building param

* Try lazyload=yes

* Travis: only devel

* Update MMAPPR2.Rmd

* Update DESCRIPTION

* Update DESCRIPTION

* Update MMAPPR2.Rmd

* Try installing ExperimentHub from GitHub

* Update vignette

* Remove debug sys.which

* Try using bioc-devel

* Try bioc-devel again

* Update vignette

* Try bioc-devel again

* sudo: false on travis

* Update vignette

* Try another travis build, without sudo

* Update vignette

* Remove username from sample objects

* Try possibleDates() again

* Update vignette

* Try GitHub BiocManager and sudo=required

* Try ask=false

* Add fake GmapGenomeDirectory to get examples to run

* Update docs with examples

* Add fake VEP for param example

* Bump version to 0.98.11

* Create directories for examples

* Create directories for examples

* Create gmap and DEFAULT directories in vignette

* Update MMAPPR2.Rmd

* Fix Biocpkg

* See if outputMmapprData caused weird cleanEx dev.off problem

* Reinstate outputMmapprData example, comment out prePeak example, which was causing weird failure

* Update docs

* Try comment out prePeak example again (fixed)

* Uncomment prePeak, didn't make a difference

* Don't run both outputMmapprData examples in both places

* Update docs

* Fix merge

* Sudo required in .travis.yml

* Don't run VEPFlags block

* Track down cannot allocate memory problem

* Track down error

* More tracking down error

* Try only running steps, only use postCandidatesMD

* Try without MD objects

* Explicitly load MMAPPR2data data

* Fix @candidates problem in vignette

* Remove RDS file reading--cannot open connection bug

* Update post_loess_dummy_md to fix param

* Remove MD objects from tests

* Make examples not runnable

* Missed one

* Remove data from package

* Update docs
  • Loading branch information
kjohnsen authored Oct 18, 2018
1 parent 5e94585 commit c529d38
Show file tree
Hide file tree
Showing 28 changed files with 219 additions and 231 deletions.
6 changes: 5 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: MMAPPR2
Title: Mutation Mapping Analysis Pipeline for Pooled RNA-Seq
Version: 0.98.10
Version: 0.98.11
Authors@R: c(
person("Kyle", "Johnsen", email="kjohnsen@byu.edu", role=c("aut")),
person('Nathaniel', 'Jenkins', role=c('aut')),
Expand All @@ -17,9 +17,13 @@ Encoding: UTF-8
LazyData: true
LazyLoad: yes
RoxygenNote: 6.1.0
VignetteBuilder: knitr
Suggests: testthat,
mockery,
roxygen2,
knitr,
rmarkdown,
BiocStyle,
MMAPPR2data
Imports: ensemblVEP (>= 1.20.0),
gmapR,
Expand Down
2 changes: 2 additions & 0 deletions R/aicc_loess.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
#' of the \code{distance} slot list filled.
#'
#' @examples
#' \dontrun{
#' postLoessMD <- loessFit(postCalcDistMD)
#' }
#' @export
loessFit <- function(mmapprData) {
loessOptResolution <- mmapprData@param@loessOptResolution
Expand Down
65 changes: 0 additions & 65 deletions R/data.R

This file was deleted.

21 changes: 11 additions & 10 deletions R/main.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,18 @@
#' # Run pipeline:
#' mmapprData <- mmappr(mmapprParam)
#'
#' ### Alternately, you can navigate the pipeline step by step.
#' ### This may be helpful for debugging.
#' md <- new('MmapprData', param = mmapprParam)
#' postCalcDistMD <- calculateDistance(md)
#' postLoessMD <- loessFit(postCalcDistMD)
#' postPrePeakMD <- prePeak(postLoessMD)
#' postPeakRefMD <- peakRefinement(postPrePeakMD)
#' \dontrun{postCandidatesMD <- generateCandidates(postPeakRefMD)
#' outputMmapprData(postCandidatesMD)
#' }
#' }
#' \dontrun{
#' ### Alternately, you can navigate the pipeline step by step.
#' ### This may be helpful for debugging.
#' md <- new('MmapprData', param = mmapprParam)
#' postCalcDistMD <- calculateDistance(md)
#' postLoessMD <- loessFit(postCalcDistMD)
#' postPrePeakMD <- prePeak(postLoessMD)
#' postPeakRefMD <- peakRefinement(postPrePeakMD)
#' postCandidatesMD <- generateCandidates(postPeakRefMD)
#' outputMmapprData(postCandidatesMD)
#' }
#'
#' @seealso \code{\link{calculateDistance}}, \code{\link{loessFit}},
#' \code{\link{prePeak}}, \code{\link{peakRefinement}},
Expand Down
5 changes: 3 additions & 2 deletions R/output.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
#' @export
#'
#' @examples
#' dir.create(outputFolder(param(postCandidatesMD))) ## Ignore this line
#' \dontrun{outputMmapprData(postCandidatesMD)}
#' \dontrun{
#' outputMmapprData(postCandidatesMD)
#' }
outputMmapprData <- function(mmapprData) {
stopifnot(class(mmapprData) == "MmapprData")
oF <- outputFolder(param(mmapprData))
Expand Down
4 changes: 4 additions & 0 deletions R/peaks.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
#' @export
#'
#' @examples
#' \dontrun{
#' postPeakRefMD <- peakRefinement(postPrePeakMD)
#' }
peakRefinement <- function(mmapprData){
mmapprData@peaks <-
.runFunctionInParallel(mmapprData@peaks,
Expand Down Expand Up @@ -100,7 +102,9 @@ peakRefinement <- function(mmapprData){
#' @export
#'
#' @examples
#' \dontrun{
#' postPrePeakMD <- prePeak(postLoessMD)
#' }
prePeak <- function(mmapprData) {
mmapprData@peaks <- list()

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
## Mutation Mapping Analysis Pipeline for Pooled RNA-Seq
### Kyle Johnsen, Nathaniel Jenkins, Jonathon Hill

### [See vignette for instructions](vignettes/MMAPPR2.Rmd)

MMAPPR2 maps mutations resulting from pooled RNA-seq data from the F2
cross of forward genetic screens. Its predecessor is described in a paper published
in Genome Research (Hill et al. 2013). MMAPPR2 accepts aligned BAM files as well as
Expand Down
Binary file removed data/postCalcDistMD.rda
Binary file not shown.
Binary file removed data/postCandidatesMD.rda
Binary file not shown.
Binary file removed data/postLoessMD.rda
Binary file not shown.
Binary file removed data/postPeakRefMD.rda
Binary file not shown.
Binary file removed data/postPrePeakMD.rda
Binary file not shown.
2 changes: 2 additions & 0 deletions man/loessFit.Rd

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

21 changes: 11 additions & 10 deletions man/mmappr.Rd

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

5 changes: 3 additions & 2 deletions man/outputMmapprData.Rd

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

2 changes: 2 additions & 0 deletions man/peakRefinement.Rd

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

20 changes: 0 additions & 20 deletions man/postCalcDistMD.Rd

This file was deleted.

20 changes: 0 additions & 20 deletions man/postCandidatesMD.Rd

This file was deleted.

20 changes: 0 additions & 20 deletions man/postLoessMD.Rd

This file was deleted.

20 changes: 0 additions & 20 deletions man/postPeakRefMD.Rd

This file was deleted.

20 changes: 0 additions & 20 deletions man/postPrePeakMD.Rd

This file was deleted.

2 changes: 2 additions & 0 deletions man/prePeak.Rd

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

10 changes: 5 additions & 5 deletions tests/testthat/test_candidates.R
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
context("Variant calling and effect prediction")

mmapprData <- postPeakRefMD
mmapprData <- readRDS('test_data/objects/post_peakref_dummy_md.RDS')


test_that("ranges for peaks are prepared", {
candList <- .getPeakRange(mmapprData@peaks$chr5)
peakList <- list(seqname='7', start=44309092, end=67669545)
candList <- .getPeakRange(peakList)
expect_s4_class(candList, 'GRanges')
chr5PeakList <- mmapprData@peaks$chr5
expect_equal(BiocGenerics::width(candList),
chr5PeakList$end - chr5PeakList$start + 1)
peakList$end - peakList$start + 1)
})


Expand Down Expand Up @@ -37,7 +37,7 @@ test_that('.getVariantsForRange returns VRanges with sample names', {
expect_s4_class(result, 'VRanges')
expect_equal(as.character(GenomicRanges::seqnames(result))[1], 'chr5')
expect_equal(as.character(Biobase::sampleNames(result))[1],
'zy13mut.bam')
'zy14_dummy.bam')
})


Expand Down
Binary file modified tests/testthat/test_data/objects/post_loess_dummy_md.RDS
Binary file not shown.
13 changes: 8 additions & 5 deletions tests/testthat/test_loess.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,12 @@ test_that(".localResolution works right", {

})

test_that("peak chromosome is fit correctly", {
mdChr7 <- postCalcDistMD
chr7list <- mdChr7@distance$`7`
test_that("chromosome is fit correctly", {
set.seed(1)
chr7list <- list(distanceDf=data.frame(
pos=seq_len(1000),
distance=stats::rnorm(1000, 0.01, sd = 0.0005)
), wtCounts=1, mutCounts=1)
chr7list <- expect_warning(.loessFitForChr(
chr7list,
loessOptResolution = .001,
Expand All @@ -62,8 +65,8 @@ test_that("peak chromosome is fit correctly", {
c("wtCounts", "mutCounts", "loess", "aicc") %in%
names(chr7list)
))
expect_gt(length(chr7list$loess$x), 4000)
expect_equal(chr7list$loess$pars$span, 0.069)
expect_equal(length(chr7list$loess$x), 1000)
expect_equal(chr7list$loess$pars$span, 0.919)
})


Expand Down
3 changes: 2 additions & 1 deletion tests/testthat/test_output.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
context('Output functions')

mmapprData <- postCandidatesMD
mmapprData <- readRDS('test_data/objects/post_peakref_dummy_md.RDS')


test_that('default output folder is prepared correctly', {
skip_if_not_installed('mockery')
Expand Down
Loading

0 comments on commit c529d38

Please sign in to comment.