Type: | Package |
Title: | Microhaplotype Constructor and Visualizer |
Version: | 1.0.1 |
Description: | A downstream bioinformatics tool to construct and assist curation of microhaplotypes from short read sequences. |
Depends: | R (≥ 3.1.2) |
Encoding: | UTF-8 |
License: | GPL-3 |
LazyData: | TRUE |
Imports: | DT (≥ 0.1), dplyr (≥ 0.4.3), ggplot2 (≥ 2.1.0), grid (≥ 3.1.2), gtools (≥ 3.5.0), magrittr (≥ 1.5), scales (≥ 0.4.0), shiny (≥ 0.13.2), shinyBS (≥ 0.61), tidyr (≥ 0.4.1), shinyWidgets (≥ 0.4.3), ggiraph (≥ 0.6.0) |
URL: | https://github.com/ngthomas/microhaplot |
BugReports: | https://github.com/ngthomas/microhaplot/issues |
RoxygenNote: | 6.1.1 |
Suggests: | knitr, rmarkdown |
VignetteBuilder: | knitr |
NeedsCompilation: | no |
Packaged: | 2019-09-28 00:53:53 UTC; thomasn |
Author: | Thomas Ng [aut, cre] |
Maintainer: | Thomas Ng <tngthomasng@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2019-10-03 07:40:05 UTC |
Transfer a copy of microhaplot app.
Description
Moves shiny microhaplot app to a different directory
Usage
mvShinyHaplot(path)
Arguments
path |
string. directory path. Required |
Value
a logical value of whether file.copy
is successfully transferred Shiny app to its new directory
Examples
mvShinyHaplot(tempdir())
Extracts haplotype from alignment reads.
Description
The function microhaplot
extracts haplotype from sequence alignment files through perl script hapture
and returns a summary table of the read depth and read quality associate with haplotype.
Usage
prepHaplotFiles(run.label, sam.path, label.path, vcf.path,
out.path = tempdir(), add.filter = FALSE, app.path = tempdir(),
n.jobs = 1)
Arguments
run.label |
character vector. Run label to be used to display in haPLOType. Required |
sam.path |
string. Directory path folder containing all sequence alignment files (SAM). Required |
label.path |
string. Label file path. This customized label file is a tab-separate file that contains entries of SAM file name, individual ID, and group label. Required |
vcf.path |
string. VCF file path. Required |
out.path |
string. Optional. If not specified, the intermediate files are created under |
add.filter |
boolean. Optional. If true, this removes any haplotype with unknown and deletion alignment characters i.e. "*" and "_", removes any locus with large number of haplotypes ( # > 40) , and remove any locus with fewer than half of the total individuals. |
app.path |
string. Path to shiny haPLOType app. Optional. If not specified, the path is default to |
n.jobs |
positive integer. Number of SAM files to be parallel processed. Optional. This multithread is only available for non Window OS. Recommend two times the number of processors/core. |
Value
This function returns a dataframe of 9 columns i.e group, id, locus, haplotype, depth, sum of Phred score, max of Phred score, allele balance and haplotype rank from highest to lowest read depth. This dataframe will also be saved in out.path
.
Examples
run.label <- "sebastes"
sam.path <- tempdir()
untar(system.file("extdata",
"sebastes_sam.tar.gz",
package="microhaplot"),
exdir = sam.path)
label.path <- file.path(sam.path, "label.txt")
vcf.path <- file.path(sam.path, "sebastes.vcf")
mvShinyHaplot(tempdir())
app.path <- file.path(tempdir(), "microhaplot")
# retrieve system Perl version number
perl.version <- as.numeric(system('perl -e "print $];"', intern=TRUE))
if (perl.version >= 5.014) {
haplo.read.tbl <- prepHaplotFiles(run.label = run.label,
sam.path = sam.path,
out.path = tempdir(),
label.path = label.path,
vcf.path = vcf.path,
app.path = app.path)
}else {
message("Perl version is outdated. Must >= 5.014.")}
Run shiny microhaplot
Description
Run shiny microhaplot app
Usage
runShinyHaplot(path = system.file("shiny", "microhaplot", package =
"microhaplot"))
Arguments
path |
Path to shiny microhaplot app. Optional. If not specified, the path is default to local app path. |
Value
Runs shiny microhaplot application via shiny::runApp
which typically doesn't return; interrupt R to stop the application (usually by pressing Ctrl+C or Esc).
Examples
if(interactive()){
runShinyHaplot()
}