From 72f3aedb39a559e2ce225d7ddaff5d80a52b8d96 Mon Sep 17 00:00:00 2001 From: Lucas Nell Date: Thu, 12 Oct 2023 12:03:02 -0700 Subject: [PATCH] Added required jackalope-package man file, updated docs --- DESCRIPTION | 6 +-- NEWS.md | 5 ++ R/RcppExports.R | 112 +++++++++++++++++++------------------- R/jackalope-package.R | 9 ++++ R/jackalope.R | 22 -------- README.Rmd | 2 +- README.md | 8 +-- cran-comments.md | 20 ++++--- inst/CITATION | 26 ++++----- man/haplotypes.Rd | 114 ++++++++++++++++++++------------------- man/haps_gtrees.Rd | 4 +- man/jackalope-package.Rd | 25 +++++++++ man/jackalope.Rd | 19 ------- man/ref_genome.Rd | 96 ++++++++++++++++----------------- man/sub_models.Rd | 18 +++---- src/RcppExports.cpp | 5 ++ 16 files changed, 243 insertions(+), 248 deletions(-) create mode 100644 R/jackalope-package.R delete mode 100644 R/jackalope.R create mode 100644 man/jackalope-package.Rd delete mode 100644 man/jackalope.Rd diff --git a/DESCRIPTION b/DESCRIPTION index f92a008..0e141f6 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: jackalope Type: Package Title: A Swift, Versatile Phylogenomic and High-Throughput Sequencing Simulator -Version: 1.1.3 -Authors@R: person(c("Lucas", "A."), "Nell", email = "lucas@lucasnell.com", +Version: 1.1.4 +Authors@R: person(c("Lucas", "A."), "Nell", email = "lucnell@gmail.com", role = c("cph", "aut", "cre"), comment = c(ORCID = "0000-0003-3209-0517")) Description: Simply and efficiently @@ -39,7 +39,7 @@ LinkingTo: Rhtslib, zlibbioc SystemRequirements: GNU make, C++11 -RoxygenNote: 7.1.1 +RoxygenNote: 7.2.3 Roxygen: list(markdown = TRUE) Suggests: coala, diff --git a/NEWS.md b/NEWS.md index 1ef8bda..04382fa 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,9 @@ +# jackalope 1.1.4 +* Added required jackalope-package man file +* Updated all docs with roxygen2 v7.2.3 + + # jackalope 1.1.3 * Remove one NULL_ENTRY to support STRICT_R_HEADERS diff --git a/R/RcppExports.R b/R/RcppExports.R index 1d1a3de..ba5bab6 100644 --- a/R/RcppExports.R +++ b/R/RcppExports.R @@ -2,11 +2,11 @@ # Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 merge_all_chromosomes_cpp <- function(ref_genome_ptr) { - invisible(.Call(`_jackalope_merge_all_chromosomes_cpp`, ref_genome_ptr)) + invisible(.Call('_jackalope_merge_all_chromosomes_cpp', PACKAGE = 'jackalope', ref_genome_ptr)) } merge_chromosomes_cpp <- function(ref_genome_ptr, chrom_inds) { - invisible(.Call(`_jackalope_merge_chromosomes_cpp`, ref_genome_ptr, chrom_inds)) + invisible(.Call('_jackalope_merge_chromosomes_cpp', PACKAGE = 'jackalope', ref_genome_ptr, chrom_inds)) } #' Filter reference genome chromosomes by size or for a proportion of total nucleotides. @@ -26,7 +26,7 @@ merge_chromosomes_cpp <- function(ref_genome_ptr, chrom_inds) { #' #' filter_chromosomes_cpp <- function(ref_genome_ptr, min_chrom_size = 0L, out_chrom_prop = 0) { - invisible(.Call(`_jackalope_filter_chromosomes_cpp`, ref_genome_ptr, min_chrom_size, out_chrom_prop)) + invisible(.Call('_jackalope_filter_chromosomes_cpp', PACKAGE = 'jackalope', ref_genome_ptr, min_chrom_size, out_chrom_prop)) } #' Replace Ns with randome nucleotides. @@ -40,7 +40,7 @@ filter_chromosomes_cpp <- function(ref_genome_ptr, min_chrom_size = 0L, out_chro #' #' replace_Ns_cpp <- function(ref_genome_ptr, pi_tcag, n_threads, show_progress) { - invisible(.Call(`_jackalope_replace_Ns_cpp`, ref_genome_ptr, pi_tcag, n_threads, show_progress)) + invisible(.Call('_jackalope_replace_Ns_cpp', PACKAGE = 'jackalope', ref_genome_ptr, pi_tcag, n_threads, show_progress)) } #' Create `RefGenome` pointer based on nucleotide equilibrium frequencies. @@ -66,7 +66,7 @@ replace_Ns_cpp <- function(ref_genome_ptr, pi_tcag, n_threads, show_progress) { #' #' create_genome_cpp <- function(n_chroms, len_mean, len_sd, pi_tcag, n_threads) { - .Call(`_jackalope_create_genome_cpp`, n_chroms, len_mean, len_sd, pi_tcag, n_threads) + .Call('_jackalope_create_genome_cpp', PACKAGE = 'jackalope', n_chroms, len_mean, len_sd, pi_tcag, n_threads) } #' Create random chromosomes as a character vector. @@ -82,11 +82,11 @@ create_genome_cpp <- function(n_chroms, len_mean, len_sd, pi_tcag, n_threads) { #' @noRd #' rando_chroms <- function(n_chroms, len_mean, len_sd = 0, pi_tcag = numeric(0), n_threads = 1L) { - .Call(`_jackalope_rando_chroms`, n_chroms, len_mean, len_sd, pi_tcag, n_threads) + .Call('_jackalope_rando_chroms', PACKAGE = 'jackalope', n_chroms, len_mean, len_sd, pi_tcag, n_threads) } add_ssites_cpp <- function(ref_genome_ptr, seg_sites, Q, pi_tcag, insertion_rates, deletion_rates, n_threads, show_progress) { - .Call(`_jackalope_add_ssites_cpp`, ref_genome_ptr, seg_sites, Q, pi_tcag, insertion_rates, deletion_rates, n_threads, show_progress) + .Call('_jackalope_add_ssites_cpp', PACKAGE = 'jackalope', ref_genome_ptr, seg_sites, Q, pi_tcag, insertion_rates, deletion_rates, n_threads, show_progress) } #' Illumina chromosome for reference object. @@ -95,7 +95,7 @@ add_ssites_cpp <- function(ref_genome_ptr, seg_sites, Q, pi_tcag, insertion_rate #' @noRd #' illumina_ref_cpp <- function(ref_genome_ptr, paired, matepair, out_prefix, compress, comp_method, n_reads, prob_dup, n_threads, show_progress, read_pool_size, frag_len_shape, frag_len_scale, frag_len_min, frag_len_max, qual_probs1, quals1, ins_prob1, del_prob1, qual_probs2, quals2, ins_prob2, del_prob2, barcodes) { - invisible(.Call(`_jackalope_illumina_ref_cpp`, ref_genome_ptr, paired, matepair, out_prefix, compress, comp_method, n_reads, prob_dup, n_threads, show_progress, read_pool_size, frag_len_shape, frag_len_scale, frag_len_min, frag_len_max, qual_probs1, quals1, ins_prob1, del_prob1, qual_probs2, quals2, ins_prob2, del_prob2, barcodes)) + invisible(.Call('_jackalope_illumina_ref_cpp', PACKAGE = 'jackalope', ref_genome_ptr, paired, matepair, out_prefix, compress, comp_method, n_reads, prob_dup, n_threads, show_progress, read_pool_size, frag_len_shape, frag_len_scale, frag_len_min, frag_len_max, qual_probs1, quals1, ins_prob1, del_prob1, qual_probs2, quals2, ins_prob2, del_prob2, barcodes)) } #' Illumina chromosome for reference object. @@ -104,7 +104,7 @@ illumina_ref_cpp <- function(ref_genome_ptr, paired, matepair, out_prefix, compr #' @noRd #' illumina_hap_cpp <- function(hap_set_ptr, paired, matepair, out_prefix, sep_files, compress, comp_method, n_reads, prob_dup, n_threads, show_progress, read_pool_size, haplotype_probs, frag_len_shape, frag_len_scale, frag_len_min, frag_len_max, qual_probs1, quals1, ins_prob1, del_prob1, qual_probs2, quals2, ins_prob2, del_prob2, barcodes) { - invisible(.Call(`_jackalope_illumina_hap_cpp`, hap_set_ptr, paired, matepair, out_prefix, sep_files, compress, comp_method, n_reads, prob_dup, n_threads, show_progress, read_pool_size, haplotype_probs, frag_len_shape, frag_len_scale, frag_len_min, frag_len_max, qual_probs1, quals1, ins_prob1, del_prob1, qual_probs2, quals2, ins_prob2, del_prob2, barcodes)) + invisible(.Call('_jackalope_illumina_hap_cpp', PACKAGE = 'jackalope', hap_set_ptr, paired, matepair, out_prefix, sep_files, compress, comp_method, n_reads, prob_dup, n_threads, show_progress, read_pool_size, haplotype_probs, frag_len_shape, frag_len_scale, frag_len_min, frag_len_max, qual_probs1, quals1, ins_prob1, del_prob1, qual_probs2, quals2, ins_prob2, del_prob2, barcodes)) } #' PacBio chromosome for reference object. @@ -113,7 +113,7 @@ illumina_hap_cpp <- function(hap_set_ptr, paired, matepair, out_prefix, sep_file #' @noRd #' pacbio_ref_cpp <- function(ref_genome_ptr, out_prefix, compress, comp_method, n_reads, n_threads, show_progress, read_pool_size, prob_dup, scale, sigma, loc, min_read_len, read_probs, read_lens, max_passes, chi2_params_n, chi2_params_s, sqrt_params, norm_params, prob_thresh, prob_ins, prob_del, prob_subst) { - invisible(.Call(`_jackalope_pacbio_ref_cpp`, ref_genome_ptr, out_prefix, compress, comp_method, n_reads, n_threads, show_progress, read_pool_size, prob_dup, scale, sigma, loc, min_read_len, read_probs, read_lens, max_passes, chi2_params_n, chi2_params_s, sqrt_params, norm_params, prob_thresh, prob_ins, prob_del, prob_subst)) + invisible(.Call('_jackalope_pacbio_ref_cpp', PACKAGE = 'jackalope', ref_genome_ptr, out_prefix, compress, comp_method, n_reads, n_threads, show_progress, read_pool_size, prob_dup, scale, sigma, loc, min_read_len, read_probs, read_lens, max_passes, chi2_params_n, chi2_params_s, sqrt_params, norm_params, prob_thresh, prob_ins, prob_del, prob_subst)) } #' PacBio chromosome for reference object. @@ -122,7 +122,7 @@ pacbio_ref_cpp <- function(ref_genome_ptr, out_prefix, compress, comp_method, n_ #' @noRd #' pacbio_hap_cpp <- function(hap_set_ptr, out_prefix, sep_files, compress, comp_method, n_reads, n_threads, show_progress, read_pool_size, haplotype_probs, prob_dup, scale, sigma, loc, min_read_len, read_probs, read_lens, max_passes, chi2_params_n, chi2_params_s, sqrt_params, norm_params, prob_thresh, prob_ins, prob_del, prob_subst) { - invisible(.Call(`_jackalope_pacbio_hap_cpp`, hap_set_ptr, out_prefix, sep_files, compress, comp_method, n_reads, n_threads, show_progress, read_pool_size, haplotype_probs, prob_dup, scale, sigma, loc, min_read_len, read_probs, read_lens, max_passes, chi2_params_n, chi2_params_s, sqrt_params, norm_params, prob_thresh, prob_ins, prob_del, prob_subst)) + invisible(.Call('_jackalope_pacbio_hap_cpp', PACKAGE = 'jackalope', hap_set_ptr, out_prefix, sep_files, compress, comp_method, n_reads, n_threads, show_progress, read_pool_size, haplotype_probs, prob_dup, scale, sigma, loc, min_read_len, read_probs, read_lens, max_passes, chi2_params_n, chi2_params_s, sqrt_params, norm_params, prob_thresh, prob_ins, prob_del, prob_subst)) } #' Read a non-indexed fasta file to a \code{RefGenome} object. @@ -138,7 +138,7 @@ pacbio_hap_cpp <- function(hap_set_ptr, out_prefix, sep_files, compress, comp_me #' @noRd #' read_fasta_noind <- function(fasta_files, cut_names, remove_soft_mask) { - .Call(`_jackalope_read_fasta_noind`, fasta_files, cut_names, remove_soft_mask) + .Call('_jackalope_read_fasta_noind', PACKAGE = 'jackalope', fasta_files, cut_names, remove_soft_mask) } #' Read an indexed fasta file to a \code{RefGenome} object. @@ -157,7 +157,7 @@ read_fasta_noind <- function(fasta_files, cut_names, remove_soft_mask) { #' #' read_fasta_ind <- function(fasta_files, fai_files, remove_soft_mask) { - .Call(`_jackalope_read_fasta_ind`, fasta_files, fai_files, remove_soft_mask) + .Call('_jackalope_read_fasta_ind', PACKAGE = 'jackalope', fasta_files, fai_files, remove_soft_mask) } #' Write \code{RefGenome} to an uncompressed fasta file. @@ -173,7 +173,7 @@ read_fasta_ind <- function(fasta_files, fai_files, remove_soft_mask) { #' #' write_ref_fasta <- function(out_prefix, ref_genome_ptr, text_width, compress, comp_method, show_progress) { - invisible(.Call(`_jackalope_write_ref_fasta`, out_prefix, ref_genome_ptr, text_width, compress, comp_method, show_progress)) + invisible(.Call('_jackalope_write_ref_fasta', PACKAGE = 'jackalope', out_prefix, ref_genome_ptr, text_width, compress, comp_method, show_progress)) } #' Write \code{HapSet} to an uncompressed fasta file. @@ -189,7 +189,7 @@ write_ref_fasta <- function(out_prefix, ref_genome_ptr, text_width, compress, co #' #' write_haps_fasta <- function(out_prefix, hap_set_ptr, text_width, compress, comp_method, n_threads, show_progress) { - invisible(.Call(`_jackalope_write_haps_fasta`, out_prefix, hap_set_ptr, text_width, compress, comp_method, n_threads, show_progress)) + invisible(.Call('_jackalope_write_haps_fasta', PACKAGE = 'jackalope', out_prefix, hap_set_ptr, text_width, compress, comp_method, n_threads, show_progress)) } #' Read a ms output file with newick gene trees and return the gene tree strings. @@ -201,7 +201,7 @@ write_haps_fasta <- function(out_prefix, hap_set_ptr, text_width, compress, comp #' @noRd #' read_ms_trees_ <- function(ms_file) { - .Call(`_jackalope_read_ms_trees_`, ms_file) + .Call('_jackalope_read_ms_trees_', PACKAGE = 'jackalope', ms_file) } #' Read a ms output file with segregating sites and return the matrices of site info. @@ -213,11 +213,11 @@ read_ms_trees_ <- function(ms_file) { #' @noRd #' coal_file_sites <- function(ms_file) { - .Call(`_jackalope_coal_file_sites`, ms_file) + .Call('_jackalope_coal_file_sites', PACKAGE = 'jackalope', ms_file) } read_vcf_cpp <- function(reference_ptr, fn, print_names) { - .Call(`_jackalope_read_vcf_cpp`, reference_ptr, fn, print_names) + .Call('_jackalope_read_vcf_cpp', PACKAGE = 'jackalope', reference_ptr, fn, print_names) } #' Write `haplotypes` to VCF file. @@ -226,7 +226,7 @@ read_vcf_cpp <- function(reference_ptr, fn, print_names) { #' @noRd #' write_vcf_cpp <- function(out_prefix, compress, hap_set_ptr, sample_matrix, show_progress) { - invisible(.Call(`_jackalope_write_vcf_cpp`, out_prefix, compress, hap_set_ptr, sample_matrix, show_progress)) + invisible(.Call('_jackalope_write_vcf_cpp', PACKAGE = 'jackalope', out_prefix, compress, hap_set_ptr, sample_matrix, show_progress)) } #' Evolve all chromosomes in a reference genome. @@ -234,7 +234,7 @@ write_vcf_cpp <- function(out_prefix, compress, hap_set_ptr, sample_matrix, show #' @noRd #' evolve_across_trees <- function(ref_genome_ptr, genome_phylo_info, Q, U, Ui, L, invariant, insertion_rates, deletion_rates, epsilon, pi_tcag, n_threads, show_progress) { - .Call(`_jackalope_evolve_across_trees`, ref_genome_ptr, genome_phylo_info, Q, U, Ui, L, invariant, insertion_rates, deletion_rates, epsilon, pi_tcag, n_threads, show_progress) + .Call('_jackalope_evolve_across_trees', PACKAGE = 'jackalope', ref_genome_ptr, genome_phylo_info, Q, U, Ui, L, invariant, insertion_rates, deletion_rates, epsilon, pi_tcag, n_threads, show_progress) } #' Add mutations manually from R. @@ -260,7 +260,7 @@ NULL #' @noRd #' print_ref_genome <- function(ref_genome_ptr) { - invisible(.Call(`_jackalope_print_ref_genome`, ref_genome_ptr)) + invisible(.Call('_jackalope_print_ref_genome', PACKAGE = 'jackalope', ref_genome_ptr)) } #' Function to print info on a HapSet. @@ -270,7 +270,7 @@ print_ref_genome <- function(ref_genome_ptr) { #' @noRd #' print_hap_set <- function(hap_set_ptr) { - invisible(.Call(`_jackalope_print_hap_set`, hap_set_ptr)) + invisible(.Call('_jackalope_print_hap_set', PACKAGE = 'jackalope', hap_set_ptr)) } #' Make a RefGenome object from a set of chromosomes. @@ -280,7 +280,7 @@ print_hap_set <- function(hap_set_ptr) { #' @noRd #' make_ref_genome <- function(chroms) { - .Call(`_jackalope_make_ref_genome`, chroms) + .Call('_jackalope_make_ref_genome', PACKAGE = 'jackalope', chroms) } #' Make a HapSet object from a RefGenome pointer and # haplotypes. @@ -291,23 +291,23 @@ make_ref_genome <- function(chroms) { #' @noRd #' make_hap_set <- function(ref_genome_ptr, n_haps) { - .Call(`_jackalope_make_hap_set`, ref_genome_ptr, n_haps) + .Call('_jackalope_make_hap_set', PACKAGE = 'jackalope', ref_genome_ptr, n_haps) } view_ref_genome_nchroms <- function(ref_genome_ptr) { - .Call(`_jackalope_view_ref_genome_nchroms`, ref_genome_ptr) + .Call('_jackalope_view_ref_genome_nchroms', PACKAGE = 'jackalope', ref_genome_ptr) } view_hap_set_nchroms <- function(hap_set_ptr) { - .Call(`_jackalope_view_hap_set_nchroms`, hap_set_ptr) + .Call('_jackalope_view_hap_set_nchroms', PACKAGE = 'jackalope', hap_set_ptr) } view_hap_set_nhaps <- function(hap_set_ptr) { - .Call(`_jackalope_view_hap_set_nhaps`, hap_set_ptr) + .Call('_jackalope_view_hap_set_nhaps', PACKAGE = 'jackalope', hap_set_ptr) } view_ref_genome_chrom_sizes <- function(ref_genome_ptr) { - .Call(`_jackalope_view_ref_genome_chrom_sizes`, ref_genome_ptr) + .Call('_jackalope_view_ref_genome_chrom_sizes', PACKAGE = 'jackalope', ref_genome_ptr) } #' See all chromosome sizes in a HapGenome object within a HapSet. @@ -315,11 +315,11 @@ view_ref_genome_chrom_sizes <- function(ref_genome_ptr) { #' @noRd #' view_hap_genome_chrom_sizes <- function(hap_set_ptr, hap_ind) { - .Call(`_jackalope_view_hap_genome_chrom_sizes`, hap_set_ptr, hap_ind) + .Call('_jackalope_view_hap_genome_chrom_sizes', PACKAGE = 'jackalope', hap_set_ptr, hap_ind) } view_ref_genome_chrom <- function(ref_genome_ptr, chrom_ind) { - .Call(`_jackalope_view_ref_genome_chrom`, ref_genome_ptr, chrom_ind) + .Call('_jackalope_view_ref_genome_chrom', PACKAGE = 'jackalope', ref_genome_ptr, chrom_ind) } #' Function to piece together the strings for one chromosome in a HapGenome. @@ -327,11 +327,11 @@ view_ref_genome_chrom <- function(ref_genome_ptr, chrom_ind) { #' @noRd #' view_hap_genome_chrom <- function(hap_set_ptr, hap_ind, chrom_ind) { - .Call(`_jackalope_view_hap_genome_chrom`, hap_set_ptr, hap_ind, chrom_ind) + .Call('_jackalope_view_hap_genome_chrom', PACKAGE = 'jackalope', hap_set_ptr, hap_ind, chrom_ind) } view_ref_genome <- function(ref_genome_ptr) { - .Call(`_jackalope_view_ref_genome`, ref_genome_ptr) + .Call('_jackalope_view_ref_genome', PACKAGE = 'jackalope', ref_genome_ptr) } #' Function to piece together the strings for all chromosomes in a HapGenome. @@ -339,11 +339,11 @@ view_ref_genome <- function(ref_genome_ptr) { #' @noRd #' view_hap_genome <- function(hap_set_ptr, hap_ind) { - .Call(`_jackalope_view_hap_genome`, hap_set_ptr, hap_ind) + .Call('_jackalope_view_hap_genome', PACKAGE = 'jackalope', hap_set_ptr, hap_ind) } view_ref_genome_chrom_names <- function(ref_genome_ptr) { - .Call(`_jackalope_view_ref_genome_chrom_names`, ref_genome_ptr) + .Call('_jackalope_view_ref_genome_chrom_names', PACKAGE = 'jackalope', ref_genome_ptr) } #' See all haplotype-genome names in a HapSet object. @@ -351,7 +351,7 @@ view_ref_genome_chrom_names <- function(ref_genome_ptr) { #' @noRd #' view_hap_set_hap_names <- function(hap_set_ptr) { - .Call(`_jackalope_view_hap_set_hap_names`, hap_set_ptr) + .Call('_jackalope_view_hap_set_hap_names', PACKAGE = 'jackalope', hap_set_ptr) } #' See GC content in a RefGenome object. @@ -359,7 +359,7 @@ view_hap_set_hap_names <- function(hap_set_ptr) { #' @noRd #' view_ref_genome_gc_content <- function(ref_genome_ptr, chrom_ind, start, end) { - .Call(`_jackalope_view_ref_genome_gc_content`, ref_genome_ptr, chrom_ind, start, end) + .Call('_jackalope_view_ref_genome_gc_content', PACKAGE = 'jackalope', ref_genome_ptr, chrom_ind, start, end) } #' See GC content in a HapSet object. @@ -367,7 +367,7 @@ view_ref_genome_gc_content <- function(ref_genome_ptr, chrom_ind, start, end) { #' @noRd #' view_hap_set_gc_content <- function(hap_set_ptr, chrom_ind, hap_ind, start, end) { - .Call(`_jackalope_view_hap_set_gc_content`, hap_set_ptr, chrom_ind, hap_ind, start, end) + .Call('_jackalope_view_hap_set_gc_content', PACKAGE = 'jackalope', hap_set_ptr, chrom_ind, hap_ind, start, end) } #' See any nucleotide's content in a RefGenome object. @@ -375,7 +375,7 @@ view_hap_set_gc_content <- function(hap_set_ptr, chrom_ind, hap_ind, start, end) #' @noRd #' view_ref_genome_nt_content <- function(ref_genome_ptr, nt, chrom_ind, start, end) { - .Call(`_jackalope_view_ref_genome_nt_content`, ref_genome_ptr, nt, chrom_ind, start, end) + .Call('_jackalope_view_ref_genome_nt_content', PACKAGE = 'jackalope', ref_genome_ptr, nt, chrom_ind, start, end) } #' See any nucleotide's content in a HapSet object. @@ -383,39 +383,39 @@ view_ref_genome_nt_content <- function(ref_genome_ptr, nt, chrom_ind, start, end #' @noRd #' view_hap_set_nt_content <- function(hap_set_ptr, nt, chrom_ind, hap_ind, start, end) { - .Call(`_jackalope_view_hap_set_nt_content`, hap_set_ptr, nt, chrom_ind, hap_ind, start, end) + .Call('_jackalope_view_hap_set_nt_content', PACKAGE = 'jackalope', hap_set_ptr, nt, chrom_ind, hap_ind, start, end) } set_ref_genome_chrom_names <- function(ref_genome_ptr, chrom_inds, names) { - invisible(.Call(`_jackalope_set_ref_genome_chrom_names`, ref_genome_ptr, chrom_inds, names)) + invisible(.Call('_jackalope_set_ref_genome_chrom_names', PACKAGE = 'jackalope', ref_genome_ptr, chrom_inds, names)) } clean_ref_genome_chrom_names <- function(ref_genome_ptr) { - invisible(.Call(`_jackalope_clean_ref_genome_chrom_names`, ref_genome_ptr)) + invisible(.Call('_jackalope_clean_ref_genome_chrom_names', PACKAGE = 'jackalope', ref_genome_ptr)) } set_hap_set_hap_names <- function(hap_set_ptr, hap_inds, names) { - invisible(.Call(`_jackalope_set_hap_set_hap_names`, hap_set_ptr, hap_inds, names)) + invisible(.Call('_jackalope_set_hap_set_hap_names', PACKAGE = 'jackalope', hap_set_ptr, hap_inds, names)) } remove_ref_genome_chroms <- function(ref_genome_ptr, chrom_inds) { - invisible(.Call(`_jackalope_remove_ref_genome_chroms`, ref_genome_ptr, chrom_inds)) + invisible(.Call('_jackalope_remove_ref_genome_chroms', PACKAGE = 'jackalope', ref_genome_ptr, chrom_inds)) } remove_hap_set_haps <- function(hap_set_ptr, hap_inds) { - invisible(.Call(`_jackalope_remove_hap_set_haps`, hap_set_ptr, hap_inds)) + invisible(.Call('_jackalope_remove_hap_set_haps', PACKAGE = 'jackalope', hap_set_ptr, hap_inds)) } add_ref_genome_chroms <- function(ref_genome_ptr, new_chroms, new_names) { - invisible(.Call(`_jackalope_add_ref_genome_chroms`, ref_genome_ptr, new_chroms, new_names)) + invisible(.Call('_jackalope_add_ref_genome_chroms', PACKAGE = 'jackalope', ref_genome_ptr, new_chroms, new_names)) } add_hap_set_haps <- function(hap_set_ptr, new_names) { - invisible(.Call(`_jackalope_add_hap_set_haps`, hap_set_ptr, new_names)) + invisible(.Call('_jackalope_add_hap_set_haps', PACKAGE = 'jackalope', hap_set_ptr, new_names)) } dup_hap_set_haps <- function(hap_set_ptr, hap_inds, new_names) { - invisible(.Call(`_jackalope_dup_hap_set_haps`, hap_set_ptr, hap_inds, new_names)) + invisible(.Call('_jackalope_dup_hap_set_haps', PACKAGE = 'jackalope', hap_set_ptr, hap_inds, new_names)) } #' Turns a HapGenome's mutations into a list of data frames. @@ -426,7 +426,7 @@ dup_hap_set_haps <- function(hap_set_ptr, hap_inds, new_names) { #' @noRd #' view_mutations <- function(hap_set_ptr, hap_ind) { - .Call(`_jackalope_view_mutations`, hap_set_ptr, hap_ind) + .Call('_jackalope_view_mutations', PACKAGE = 'jackalope', hap_set_ptr, hap_ind) } #' Turns a HapGenome's mutations into a list of data frames. @@ -437,7 +437,7 @@ view_mutations <- function(hap_set_ptr, hap_ind) { #' @noRd #' examine_mutations <- function(hap_set_ptr, hap_ind, chrom_ind) { - .Call(`_jackalope_examine_mutations`, hap_set_ptr, hap_ind, chrom_ind) + .Call('_jackalope_examine_mutations', PACKAGE = 'jackalope', hap_set_ptr, hap_ind, chrom_ind) } #' @describeIn add_mutations Add a substitution. @@ -448,7 +448,7 @@ examine_mutations <- function(hap_set_ptr, hap_ind, chrom_ind) { #' @noRd #' add_substitution <- function(hap_set_ptr, hap_ind, chrom_ind, nucleo_, new_pos_) { - invisible(.Call(`_jackalope_add_substitution`, hap_set_ptr, hap_ind, chrom_ind, nucleo_, new_pos_)) + invisible(.Call('_jackalope_add_substitution', PACKAGE = 'jackalope', hap_set_ptr, hap_ind, chrom_ind, nucleo_, new_pos_)) } #' @describeIn add_mutations Add an insertion. @@ -460,7 +460,7 @@ add_substitution <- function(hap_set_ptr, hap_ind, chrom_ind, nucleo_, new_pos_) #' @noRd #' add_insertion <- function(hap_set_ptr, hap_ind, chrom_ind, nucleos_, new_pos_) { - invisible(.Call(`_jackalope_add_insertion`, hap_set_ptr, hap_ind, chrom_ind, nucleos_, new_pos_)) + invisible(.Call('_jackalope_add_insertion', PACKAGE = 'jackalope', hap_set_ptr, hap_ind, chrom_ind, nucleos_, new_pos_)) } #' @describeIn add_mutations Add a deletion. @@ -472,22 +472,22 @@ add_insertion <- function(hap_set_ptr, hap_ind, chrom_ind, nucleos_, new_pos_) { #' @noRd #' add_deletion <- function(hap_set_ptr, hap_ind, chrom_ind, size_, new_pos_) { - invisible(.Call(`_jackalope_add_deletion`, hap_set_ptr, hap_ind, chrom_ind, size_, new_pos_)) + invisible(.Call('_jackalope_add_deletion', PACKAGE = 'jackalope', hap_set_ptr, hap_ind, chrom_ind, size_, new_pos_)) } sub_TN93_cpp <- function(mu, pi_tcag, alpha_1, alpha_2, beta, gamma_shape, gamma_k, invariant) { - .Call(`_jackalope_sub_TN93_cpp`, mu, pi_tcag, alpha_1, alpha_2, beta, gamma_shape, gamma_k, invariant) + .Call('_jackalope_sub_TN93_cpp', PACKAGE = 'jackalope', mu, pi_tcag, alpha_1, alpha_2, beta, gamma_shape, gamma_k, invariant) } sub_GTR_cpp <- function(mu, pi_tcag, abcdef, gamma_shape, gamma_k, invariant) { - .Call(`_jackalope_sub_GTR_cpp`, mu, pi_tcag, abcdef, gamma_shape, gamma_k, invariant) + .Call('_jackalope_sub_GTR_cpp', PACKAGE = 'jackalope', mu, pi_tcag, abcdef, gamma_shape, gamma_k, invariant) } sub_UNREST_cpp <- function(mu, Q, gamma_shape, gamma_k, invariant) { - .Call(`_jackalope_sub_UNREST_cpp`, mu, Q, gamma_shape, gamma_k, invariant) + .Call('_jackalope_sub_UNREST_cpp', PACKAGE = 'jackalope', mu, Q, gamma_shape, gamma_k, invariant) } using_openmp <- function() { - .Call(`_jackalope_using_openmp`) + .Call('_jackalope_using_openmp', PACKAGE = 'jackalope') } diff --git a/R/jackalope-package.R b/R/jackalope-package.R new file mode 100644 index 0000000..ed64735 --- /dev/null +++ b/R/jackalope-package.R @@ -0,0 +1,9 @@ +#' @keywords internal +"_PACKAGE" + +## usethis namespace: start +#' @importFrom Rcpp evalCpp +#' @import zlibbioc +#' @useDynLib jackalope, .registration = TRUE +## usethis namespace: end +NULL diff --git a/R/jackalope.R b/R/jackalope.R deleted file mode 100644 index dd19a93..0000000 --- a/R/jackalope.R +++ /dev/null @@ -1,22 +0,0 @@ -#' jackalope: An efficient, flexible molecular evolution and sequencing simulator. -#' -#' `jackalope` simply and efficiently -#' simulates (i) haplotypes from reference genomes and (ii) reads from both Illumina -#' and Pacific Biosciences (PacBio) platforms. -#' It can either read reference genomes from FASTA files or simulate new ones. -#' Variant haplotypes can be simulated using summary statistics, phylogenies, -#' Variant Call Format (VCF) files, and coalescent simulations—the latter of which -#' can include selection, recombination, and demographic fluctuations. -#' `jackalope` can simulate single, paired-end, or mate-pair Illumina reads, -#' as well as reads from Pacific Biosciences -#' These simulations include sequencing errors, mapping qualities, multiplexing, -#' and optical/PCR duplicates. All outputs can be written to standard file formats. -#' -#' -#' @importFrom Rcpp evalCpp -#' @import zlibbioc -#' @useDynLib jackalope, .registration = TRUE -#' -#' @docType package -#' @name jackalope -NULL diff --git a/README.Rmd b/README.Rmd index bc1b678..6a6bdc3 100644 --- a/README.Rmd +++ b/README.Rmd @@ -21,7 +21,7 @@ set.seed(1) # for keeping the printing of `reference` below the same [![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) [![R build status](https://github.com/lucasnell/jackalope/workflows/R-CMD-check/badge.svg)](https://github.com/lucasnell/jackalope/actions) -[![codecov](https://codecov.io/gh/lucasnell/jackalope/branch/master/graph/badge.svg)](https://codecov.io/gh/lucasnell/jackalope) +[![codecov](https://codecov.io/gh/lucasnell/jackalope/branch/master/graph/badge.svg)](https://app.codecov.io/gh/lucasnell/jackalope) [![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/jackalope)](https://cran.r-project.org/package=jackalope) diff --git a/README.md b/README.md index a43ba92..e09ee9a 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) [![R build status](https://github.com/lucasnell/jackalope/workflows/R-CMD-check/badge.svg)](https://github.com/lucasnell/jackalope/actions) -[![codecov](https://codecov.io/gh/lucasnell/jackalope/branch/master/graph/badge.svg)](https://codecov.io/gh/lucasnell/jackalope) -[![CRAN\_Status\_Badge](https://www.r-pkg.org/badges/version/jackalope)](https://cran.r-project.org/package=jackalope) +[![codecov](https://codecov.io/gh/lucasnell/jackalope/branch/master/graph/badge.svg)](https://app.codecov.io/gh/lucasnell/jackalope) +[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/jackalope)](https://cran.r-project.org/package=jackalope) # jackalope @@ -90,7 +90,7 @@ install.packages("jackalope", type = "source") # remotes::install_github("lucasnell/jackalope") ``` -#### macOS, R version >= 4.0.0 +#### macOS, R version \>= 4.0.0 Follow the directions here to install R compiler tools: . @@ -130,7 +130,7 @@ withr::with_makevars(c(CPPFLAGS = "-Xclang -fopenmp", LDFLAGS = "-lomp"), assignment = "+=") ``` -#### macOS, R version >= 3.4\* and < 4.0.0 +#### macOS, R version \>= 3.4\* and \< 4.0.0 Add the following to the `.R/Makevars` file inside the home directory: diff --git a/cran-comments.md b/cran-comments.md index 1b9d437..20b5aa0 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -2,17 +2,18 @@ This is a resubmission. In this version, I have done the following: -- Remove one NULL_ENTRY to support STRICT_R_HEADERS +- Added required jackalope-package man file +- Updated all docs with roxygen2 v7.2.3 +- In CITATION, now using bibentry and for authors, using `c()` on person objects ## Test environments -* macOS 11.4 (local), R 4.1.0 -* ubuntu 20.04.2 (GitHub Actions), R-devel, R 4.1.0, R 4.0.5 -* macOS 10.15.7 (GitHub Actions), R-devel, R 4.1.0, R 4.0.5 -* Windows (win-builder), R-devel, R 4.1.0, R 4.0.5 +* macOS 13.4.1 (local), R 4.3.1 +* ubuntu 20.04.2 (GitHub Actions), R-devel, R 4.3.1, R 4.2.3 +* macOS 10.15.7 (GitHub Actions), R-devel, R 4.3.1, R 4.2.3 +* Windows (win-builder), R-devel, R 4.3.1, R 4.2.3 * Rhub - - Oracle Solaris 10, R-release, 32-bit - Fedora Linux, R-devel, clang (with valgrind) @@ -26,13 +27,10 @@ There were no ERRORs or WARNINGs. There were 2 NOTEs: ``` -installed size is 21.3Mb - sub-directories of 1Mb or more: - art_profiles 1.5Mb - libs 19.1Mb +Specified C++11: please drop specification unless essential ``` -The package makes extensive use of compiled code to improve performance. +The package makes extensive use of C++11 code throughout. ``` diff --git a/inst/CITATION b/inst/CITATION index 07a4dc0..f2ccfd6 100644 --- a/inst/CITATION +++ b/inst/CITATION @@ -1,18 +1,10 @@ -citHeader("To cite jackalope in publications use:") - -citEntry(entry = "Article", - title = "{jackalope}: a swift, versatile phylogenomic and high-throughput sequencing simulator", - author = personList(as.person("Lucas A. Nell")), - journal = "{Molecular Ecology Resources}", - year = "2020", - volume = "20", - number = "4", - pages = "1132--1140", - url = "https://doi.org/10.1111/1755-0998.13173", - doi = "10.1111/1755-0998.13173", - textVersion = - paste("Nell, Lucas A (2020).", - "jackalope: a swift, versatile phylogenomic and high-throughput sequencing simulator.", - "Molecular Ecology Resources 20(4): 1132-1140.", - "doi: 10.1111/1755-0998.13173.") +bibentry(bibtype = "Article", + title = "{jackalope}: a swift, versatile phylogenomic and high-throughput sequencing simulator", + author = person(c("Lucas", "A"), "Nell", role = "aut"), + journal = "Molecular Ecology Resources", + year = 2020, + volume = 20, + number = 4, + pages = "1132--1140", + doi = "10.1111/1755-0998.13173" ) diff --git a/man/haplotypes.Rd b/man/haplotypes.Rd index aec6a70..ebbd57d 100644 --- a/man/haplotypes.Rd +++ b/man/haplotypes.Rd @@ -50,29 +50,29 @@ editing the reference genome. \section{Methods}{ \subsection{Public methods}{ \itemize{ -\item \href{#method-new}{\code{haplotypes$new()}} -\item \href{#method-print}{\code{haplotypes$print()}} -\item \href{#method-ptr}{\code{haplotypes$ptr()}} -\item \href{#method-n_chroms}{\code{haplotypes$n_chroms()}} -\item \href{#method-n_haps}{\code{haplotypes$n_haps()}} -\item \href{#method-sizes}{\code{haplotypes$sizes()}} -\item \href{#method-chrom_names}{\code{haplotypes$chrom_names()}} -\item \href{#method-hap_names}{\code{haplotypes$hap_names()}} -\item \href{#method-chrom}{\code{haplotypes$chrom()}} -\item \href{#method-gc_prop}{\code{haplotypes$gc_prop()}} -\item \href{#method-nt_prop}{\code{haplotypes$nt_prop()}} -\item \href{#method-set_names}{\code{haplotypes$set_names()}} -\item \href{#method-add_haps}{\code{haplotypes$add_haps()}} -\item \href{#method-dup_haps}{\code{haplotypes$dup_haps()}} -\item \href{#method-rm_haps}{\code{haplotypes$rm_haps()}} -\item \href{#method-add_sub}{\code{haplotypes$add_sub()}} -\item \href{#method-add_ins}{\code{haplotypes$add_ins()}} -\item \href{#method-add_del}{\code{haplotypes$add_del()}} +\item \href{#method-haplotypes-new}{\code{haplotypes$new()}} +\item \href{#method-haplotypes-print}{\code{haplotypes$print()}} +\item \href{#method-haplotypes-ptr}{\code{haplotypes$ptr()}} +\item \href{#method-haplotypes-n_chroms}{\code{haplotypes$n_chroms()}} +\item \href{#method-haplotypes-n_haps}{\code{haplotypes$n_haps()}} +\item \href{#method-haplotypes-sizes}{\code{haplotypes$sizes()}} +\item \href{#method-haplotypes-chrom_names}{\code{haplotypes$chrom_names()}} +\item \href{#method-haplotypes-hap_names}{\code{haplotypes$hap_names()}} +\item \href{#method-haplotypes-chrom}{\code{haplotypes$chrom()}} +\item \href{#method-haplotypes-gc_prop}{\code{haplotypes$gc_prop()}} +\item \href{#method-haplotypes-nt_prop}{\code{haplotypes$nt_prop()}} +\item \href{#method-haplotypes-set_names}{\code{haplotypes$set_names()}} +\item \href{#method-haplotypes-add_haps}{\code{haplotypes$add_haps()}} +\item \href{#method-haplotypes-dup_haps}{\code{haplotypes$dup_haps()}} +\item \href{#method-haplotypes-rm_haps}{\code{haplotypes$rm_haps()}} +\item \href{#method-haplotypes-add_sub}{\code{haplotypes$add_sub()}} +\item \href{#method-haplotypes-add_ins}{\code{haplotypes$add_ins()}} +\item \href{#method-haplotypes-add_del}{\code{haplotypes$add_del()}} } } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-new}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-haplotypes-new}{}}} \subsection{Method \code{new()}}{ Do NOT use this; only use \code{create_haplotypes} to make new \code{haplotypes}. \subsection{Usage}{ @@ -92,8 +92,8 @@ stores the information about the reference genome.} } } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-print}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-haplotypes-print}{}}} \subsection{Method \code{print()}}{ Print a \code{haplotypes} object. \subsection{Usage}{ @@ -102,8 +102,8 @@ Print a \code{haplotypes} object. } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-ptr}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-haplotypes-ptr}{}}} \subsection{Method \code{ptr()}}{ View pointer to underlying C++ object (this is not useful to end users). \subsection{Usage}{ @@ -115,8 +115,8 @@ An \code{externalptr} object. } } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-n_chroms}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-haplotypes-n_chroms}{}}} \subsection{Method \code{n_chroms()}}{ View number of chromosomes. \subsection{Usage}{ @@ -128,8 +128,8 @@ Integer number of chromosomes. } } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-n_haps}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-haplotypes-n_haps}{}}} \subsection{Method \code{n_haps()}}{ View number of haplotypes. \subsection{Usage}{ @@ -141,8 +141,8 @@ Integer number of haplotypes. } } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-sizes}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-haplotypes-sizes}{}}} \subsection{Method \code{sizes()}}{ View chromosome sizes for one haplotype. \subsection{Usage}{ @@ -161,8 +161,8 @@ Integer vector of chromosome sizes for focal haplotype. } } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-chrom_names}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-haplotypes-chrom_names}{}}} \subsection{Method \code{chrom_names()}}{ View chromosome names. \subsection{Usage}{ @@ -174,8 +174,8 @@ Character vector of chromosome names. } } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-hap_names}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-haplotypes-hap_names}{}}} \subsection{Method \code{hap_names()}}{ View haplotype names. \subsection{Usage}{ @@ -187,8 +187,8 @@ Character vector of haplotype names. } } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-chrom}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-haplotypes-chrom}{}}} \subsection{Method \code{chrom()}}{ View one haplotype chromosome. \subsection{Usage}{ @@ -210,8 +210,8 @@ sequence. } } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-gc_prop}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-haplotypes-gc_prop}{}}} \subsection{Method \code{gc_prop()}}{ View GC proportion for part of one haplotype chromosome. \subsection{Usage}{ @@ -239,8 +239,8 @@ sequence that is either \code{G} or \code{C}. } } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-nt_prop}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-haplotypes-nt_prop}{}}} \subsection{Method \code{nt_prop()}}{ View nucleotide content for part of one haplotype chromosome \subsection{Usage}{ @@ -271,8 +271,8 @@ sequence that is \code{nt}. } } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-set_names}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-haplotypes-set_names}{}}} \subsection{Method \code{set_names()}}{ Change haplotype names. \subsection{Usage}{ @@ -292,8 +292,8 @@ This \code{R6} object, invisibly. } } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-add_haps}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-haplotypes-add_haps}{}}} \subsection{Method \code{add_haps()}}{ Add one or more blank, named haplotypes \subsection{Usage}{ @@ -312,8 +312,8 @@ This \code{R6} object, invisibly. } } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-dup_haps}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-haplotypes-dup_haps}{}}} \subsection{Method \code{dup_haps()}}{ Duplicate one or more haplotypes by name. \subsection{Usage}{ @@ -336,8 +336,8 @@ This \code{R6} object, invisibly. } } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-rm_haps}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-haplotypes-rm_haps}{}}} \subsection{Method \code{rm_haps()}}{ Remove one or more haplotypes by name. \subsection{Usage}{ @@ -356,8 +356,8 @@ This \code{R6} object, invisibly. } } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-add_sub}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-haplotypes-add_sub}{}}} \subsection{Method \code{add_sub()}}{ Manually add a substitution. \subsection{Usage}{ @@ -383,8 +383,8 @@ This \code{R6} object, invisibly. } } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-add_ins}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-haplotypes-add_ins}{}}} \subsection{Method \code{add_ins()}}{ Manually add an insertion. \subsection{Usage}{ @@ -406,18 +406,20 @@ the designated position.} \if{html}{\out{}} } \subsection{Returns}{ -This \code{R6} object, invisibly.\preformatted{\\item\{`add_del(hap_ind, chrom_ind, pos, n_nts)`\}\{Manually add a deletion +This \code{R6} object, invisibly. + +\if{html}{\out{
}}\preformatted{\\item\{`add_del(hap_ind, chrom_ind, pos, n_nts)`\}\{Manually add a deletion for a given haplotype (`hap_ind`), chromosome (`chrom_ind`), and position (`pos`). The designated number of nucleotides to delete (`n_nts`) will be deleted starting at `pos`, unless `pos` is near the chromosome end and doesn't have `n_nts` nucleotides to remove; it simply stops at the chromosome end in this case.\} -} +}\if{html}{\out{
}} } } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-add_del}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-haplotypes-add_del}{}}} \subsection{Method \code{add_del()}}{ Manually add a deletion. \subsection{Usage}{ diff --git a/man/haps_gtrees.Rd b/man/haps_gtrees.Rd index c076f81..cfadae1 100644 --- a/man/haps_gtrees.Rd +++ b/man/haps_gtrees.Rd @@ -55,6 +55,6 @@ add the \code{-T} option. } \section{Functions}{ \itemize{ -\item \code{write_gtrees}: Write gene trees to ms-style output file. -}} +\item \code{write_gtrees()}: Write gene trees to ms-style output file. +}} diff --git a/man/jackalope-package.Rd b/man/jackalope-package.Rd new file mode 100644 index 0000000..ad1c807 --- /dev/null +++ b/man/jackalope-package.Rd @@ -0,0 +1,25 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/jackalope-package.R +\docType{package} +\name{jackalope-package} +\alias{jackalope} +\alias{jackalope-package} +\title{jackalope: A Swift, Versatile Phylogenomic and High-Throughput Sequencing Simulator} +\description{ +\if{html}{\figure{logo.png}{options: style='float: right' alt='logo' width='120'}} + +Simply and efficiently simulates (i) variants from reference genomes and (ii) reads from both Illumina \url{https://www.illumina.com/} and Pacific Biosciences (PacBio) \url{https://www.pacb.com/} platforms. It can either read reference genomes from FASTA files or simulate new ones. Genomic variants can be simulated using summary statistics, phylogenies, Variant Call Format (VCF) files, and coalescent simulations—the latter of which can include selection, recombination, and demographic fluctuations. 'jackalope' can simulate single, paired-end, or mate-pair Illumina reads, as well as PacBio reads. These simulations include sequencing errors, mapping qualities, multiplexing, and optical/polymerase chain reaction (PCR) duplicates. Simulating Illumina sequencing is based on ART by Huang et al. (2012) \doi{10.1093/bioinformatics/btr708}. PacBio sequencing simulation is based on SimLoRD by Stöcker et al. (2016) \doi{10.1093/bioinformatics/btw286}. All outputs can be written to standard file formats. +} +\seealso{ +Useful links: +\itemize{ + \item \url{https://github.com/lucasnell/jackalope} + \item Report bugs at \url{https://github.com/lucasnell/jackalope/issues} +} + +} +\author{ +\strong{Maintainer}: Lucas A. Nell \email{lucnell@gmail.com} (\href{https://orcid.org/0000-0003-3209-0517}{ORCID}) [copyright holder] + +} +\keyword{internal} diff --git a/man/jackalope.Rd b/man/jackalope.Rd deleted file mode 100644 index d844d53..0000000 --- a/man/jackalope.Rd +++ /dev/null @@ -1,19 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/jackalope.R -\docType{package} -\name{jackalope} -\alias{jackalope} -\title{jackalope: An efficient, flexible molecular evolution and sequencing simulator.} -\description{ -\code{jackalope} simply and efficiently -simulates (i) haplotypes from reference genomes and (ii) reads from both Illumina -and Pacific Biosciences (PacBio) platforms. -It can either read reference genomes from FASTA files or simulate new ones. -Variant haplotypes can be simulated using summary statistics, phylogenies, -Variant Call Format (VCF) files, and coalescent simulations—the latter of which -can include selection, recombination, and demographic fluctuations. -\code{jackalope} can simulate single, paired-end, or mate-pair Illumina reads, -as well as reads from Pacific Biosciences -These simulations include sequencing errors, mapping qualities, multiplexing, -and optical/PCR duplicates. All outputs can be written to standard file formats. -} diff --git a/man/ref_genome.Rd b/man/ref_genome.Rd index 8e7fa17..805ee9a 100644 --- a/man/ref_genome.Rd +++ b/man/ref_genome.Rd @@ -73,27 +73,27 @@ ref$filter_chroms(0.4, "prop") \section{Methods}{ \subsection{Public methods}{ \itemize{ -\item \href{#method-new}{\code{ref_genome$new()}} -\item \href{#method-print}{\code{ref_genome$print()}} -\item \href{#method-ptr}{\code{ref_genome$ptr()}} -\item \href{#method-n_chroms}{\code{ref_genome$n_chroms()}} -\item \href{#method-sizes}{\code{ref_genome$sizes()}} -\item \href{#method-chrom_names}{\code{ref_genome$chrom_names()}} -\item \href{#method-chrom}{\code{ref_genome$chrom()}} -\item \href{#method-gc_prop}{\code{ref_genome$gc_prop()}} -\item \href{#method-nt_prop}{\code{ref_genome$nt_prop()}} -\item \href{#method-set_names}{\code{ref_genome$set_names()}} -\item \href{#method-clean_names}{\code{ref_genome$clean_names()}} -\item \href{#method-add_chroms}{\code{ref_genome$add_chroms()}} -\item \href{#method-rm_chroms}{\code{ref_genome$rm_chroms()}} -\item \href{#method-merge_chroms}{\code{ref_genome$merge_chroms()}} -\item \href{#method-filter_chroms}{\code{ref_genome$filter_chroms()}} -\item \href{#method-replace_Ns}{\code{ref_genome$replace_Ns()}} +\item \href{#method-ref_genome-new}{\code{ref_genome$new()}} +\item \href{#method-ref_genome-print}{\code{ref_genome$print()}} +\item \href{#method-ref_genome-ptr}{\code{ref_genome$ptr()}} +\item \href{#method-ref_genome-n_chroms}{\code{ref_genome$n_chroms()}} +\item \href{#method-ref_genome-sizes}{\code{ref_genome$sizes()}} +\item \href{#method-ref_genome-chrom_names}{\code{ref_genome$chrom_names()}} +\item \href{#method-ref_genome-chrom}{\code{ref_genome$chrom()}} +\item \href{#method-ref_genome-gc_prop}{\code{ref_genome$gc_prop()}} +\item \href{#method-ref_genome-nt_prop}{\code{ref_genome$nt_prop()}} +\item \href{#method-ref_genome-set_names}{\code{ref_genome$set_names()}} +\item \href{#method-ref_genome-clean_names}{\code{ref_genome$clean_names()}} +\item \href{#method-ref_genome-add_chroms}{\code{ref_genome$add_chroms()}} +\item \href{#method-ref_genome-rm_chroms}{\code{ref_genome$rm_chroms()}} +\item \href{#method-ref_genome-merge_chroms}{\code{ref_genome$merge_chroms()}} +\item \href{#method-ref_genome-filter_chroms}{\code{ref_genome$filter_chroms()}} +\item \href{#method-ref_genome-replace_Ns}{\code{ref_genome$replace_Ns()}} } } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-new}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-ref_genome-new}{}}} \subsection{Method \code{new()}}{ Do NOT use this; only use \code{read_fasta} or \code{create_genome} to make a new \code{ref_genome}. @@ -111,8 +111,8 @@ the information about the reference genome.} } } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-print}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-ref_genome-print}{}}} \subsection{Method \code{print()}}{ Print a \code{ref_genome} object. \subsection{Usage}{ @@ -121,8 +121,8 @@ Print a \code{ref_genome} object. } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-ptr}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-ref_genome-ptr}{}}} \subsection{Method \code{ptr()}}{ View pointer to underlying C++ object (this is not useful to end users). \subsection{Usage}{ @@ -134,8 +134,8 @@ An \code{externalptr} object. } } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-n_chroms}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-ref_genome-n_chroms}{}}} \subsection{Method \code{n_chroms()}}{ View number of chromosomes. \subsection{Usage}{ @@ -147,8 +147,8 @@ Integer number of chromosomes. } } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-sizes}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-ref_genome-sizes}{}}} \subsection{Method \code{sizes()}}{ View chromosome sizes. \subsection{Usage}{ @@ -160,8 +160,8 @@ Integer vector of chromosome sizes. } } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-chrom_names}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-ref_genome-chrom_names}{}}} \subsection{Method \code{chrom_names()}}{ View chromosome names. \subsection{Usage}{ @@ -173,8 +173,8 @@ Character vector of chromosome names. } } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-chrom}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-ref_genome-chrom}{}}} \subsection{Method \code{chrom()}}{ View one reference chromosome. \subsection{Usage}{ @@ -193,8 +193,8 @@ A single string representing the chosen chromosome's DNA sequence. } } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-gc_prop}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-ref_genome-gc_prop}{}}} \subsection{Method \code{gc_prop()}}{ View GC proportion for part of one reference chromosome. \subsection{Usage}{ @@ -220,8 +220,8 @@ sequence that is either \code{G} or \code{C}. } } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-nt_prop}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-ref_genome-nt_prop}{}}} \subsection{Method \code{nt_prop()}}{ View nucleotide content for part of one reference chromosome \subsection{Usage}{ @@ -250,8 +250,8 @@ sequence that is \code{nt}. } } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-set_names}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-ref_genome-set_names}{}}} \subsection{Method \code{set_names()}}{ Change chromosome names. \subsection{Usage}{ @@ -281,8 +281,8 @@ ref$set_names(c("a", "b", "c", "d")) } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-clean_names}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-ref_genome-clean_names}{}}} \subsection{Method \code{clean_names()}}{ Clean chromosome names, converting \verb{" :;=\%,\\\\|/\\"\\'"} to \code{"_"}. \subsection{Usage}{ @@ -305,8 +305,8 @@ ref$clean_names() } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-add_chroms}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-ref_genome-add_chroms}{}}} \subsection{Method \code{add_chroms()}}{ Add one or more chromosomes. \subsection{Usage}{ @@ -338,8 +338,8 @@ ref$add_chroms("TCAGTCAG") } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-rm_chroms}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-ref_genome-rm_chroms}{}}} \subsection{Method \code{rm_chroms()}}{ Remove one or more chromosomes by name \subsection{Usage}{ @@ -369,8 +369,8 @@ ref$rm_chroms("b") } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-merge_chroms}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-ref_genome-merge_chroms}{}}} \subsection{Method \code{merge_chroms()}}{ Merge chromosomes into one. \subsection{Usage}{ @@ -404,8 +404,8 @@ ref$merge_chroms(NULL) } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-filter_chroms}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-ref_genome-filter_chroms}{}}} \subsection{Method \code{filter_chroms()}}{ Filter chromosomes by size or for a proportion of total bases. \subsection{Usage}{ @@ -444,8 +444,8 @@ ref$filter_chroms(0.4, "prop") } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-replace_Ns}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-ref_genome-replace_Ns}{}}} \subsection{Method \code{replace_Ns()}}{ Replace \code{N}s in the reference genome. \subsection{Usage}{ diff --git a/man/sub_models.Rd b/man/sub_models.Rd index 86ce4ca..fd4e6a1 100644 --- a/man/sub_models.Rd +++ b/man/sub_models.Rd @@ -132,23 +132,23 @@ For a more detailed explanation, see \code{vignette("sub-models")}. } \section{Functions}{ \itemize{ -\item \code{sub_JC69}: JC69 model. +\item \code{sub_JC69()}: JC69 model. -\item \code{sub_K80}: K80 model. +\item \code{sub_K80()}: K80 model. -\item \code{sub_F81}: F81 model. +\item \code{sub_F81()}: F81 model. -\item \code{sub_HKY85}: HKY85 model. +\item \code{sub_HKY85()}: HKY85 model. -\item \code{sub_F84}: F84 model. +\item \code{sub_F84()}: F84 model. -\item \code{sub_TN93}: TN93 model. +\item \code{sub_TN93()}: TN93 model. -\item \code{sub_GTR}: GTR model. +\item \code{sub_GTR()}: GTR model. -\item \code{sub_UNREST}: UNREST model. -}} +\item \code{sub_UNREST()}: UNREST model. +}} \examples{ # Same substitution rate for all types: obj_JC69 <- sub_JC69(lambda = 0.1) diff --git a/src/RcppExports.cpp b/src/RcppExports.cpp index 3eb18d6..971e540 100644 --- a/src/RcppExports.cpp +++ b/src/RcppExports.cpp @@ -7,6 +7,11 @@ using namespace Rcpp; +#ifdef RCPP_USE_GLOBAL_ROSTREAM +Rcpp::Rostream& Rcpp::Rcout = Rcpp::Rcpp_cout_get(); +Rcpp::Rostream& Rcpp::Rcerr = Rcpp::Rcpp_cerr_get(); +#endif + // merge_all_chromosomes_cpp void merge_all_chromosomes_cpp(SEXP ref_genome_ptr); RcppExport SEXP _jackalope_merge_all_chromosomes_cpp(SEXP ref_genome_ptrSEXP) {