Skip to content

Commit

Permalink
Merge pull request #73 from mmollina/testless
Browse files Browse the repository at this point in the history
Testless
  • Loading branch information
mmollina authored Mar 6, 2024
2 parents f7e8d07 + 6c1d431 commit 7bcae98
Show file tree
Hide file tree
Showing 40 changed files with 305 additions and 661 deletions.
3 changes: 0 additions & 3 deletions CRAN-SUBMISSION

This file was deleted.

2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: mappoly
Type: Package
Title: Genetic Linkage Maps in Autopolyploids
Version: 0.4.0
Version: 0.4.1
Authors@R: c(person(given = "Marcelo",
family = "Mollinari",
role = c("aut", "cre"),
Expand Down
2 changes: 1 addition & 1 deletion MAPpoly.Rproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ LaTeX: pdfLaTeX

BuildType: Package
PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source --resave-data
PackageInstallArgs: --no-multiarch --with-keep.source --resave-data --use-LTO
PackageBuildArgs: --resave-data
PackageCheckArgs: --no-vignettes --as-cran --install-args=--build
PackageRoxygenize: rd,collate,namespace,vignette
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ export(split_and_rephase)
export(summary_maps)
export(update_framework_map)
export(update_map)
export(update_missing)
import(RCurl)
import(Rcpp)
import(fields)
Expand Down
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# MAPpoly version 0.4.1
- Addressed the `--use-LTO` installation failure issue

# MAPpoly version 0.4.0
- Functions to build maps in individual parents
- Functions to merge individual maps
Expand Down
16 changes: 16 additions & 0 deletions R/RcppExports.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

calc_genoprob_cpp <- function(m, geno, ph1, ph2, rf, probs, verbose) {
.Call('_mappoly_calc_genoprob_cpp', PACKAGE = 'mappoly', m, geno, ph1, ph2, rf, probs, verbose)
}

calc_genprob_haplo_cpp <- function(m, n_mrk, n_ind, haplo, emit, rf, probs, verbose) {
.Call('_mappoly_calc_genprob_haplo_cpp', PACKAGE = 'mappoly', m, n_mrk, n_ind, haplo, emit, rf, probs, verbose)
}

calc_genprob_haplo_highprec_cpp <- function(m, n_mrk, n_ind, haplo, emit, rf, probs, verbose) {
.Call('_mappoly_calc_genprob_haplo_highprec_cpp', PACKAGE = 'mappoly', m, n_mrk, n_ind, haplo, emit, rf, probs, verbose)
}

loglike_hmm_cpp <- function(m, geno, ph1, ph2, rf, verbose) {
.Call('_mappoly_loglike_hmm_cpp', PACKAGE = 'mappoly', m, geno, ph1, ph2, rf, verbose)
}

.vcf_get_probabilities <- function(mat, pl_pos) {
.Call('_mappoly_vcf_get_probabilities', PACKAGE = 'mappoly', mat, pl_pos)
}
Expand Down
22 changes: 11 additions & 11 deletions R/calc_genoprob.R
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,17 @@ calc_genoprob <- function(input.map, step = 0, phase.config = "best", verbose =
phQ[rownames(Dtemp)] <- phQtemp
seq.rf.pseudo <- mf_h(diff(map.pseudo))
}
for (j in 1:nrow(D))
D[j, D[j, ] == input.map$info$ploidy + 1] <- dp[j] + dq[j] + 1 + as.numeric(dp[j] == 0 || dq[j] == 0)
res.temp <- .Call("calc_genoprob",
ploidy,
t(D),
phP,
phQ,
seq.rf.pseudo,
as.numeric(rep(0, choose(ploidy, ploidy/2)^2 * n.mrk * n.ind)),
verbose = verbose,
PACKAGE = "mappoly")
for (j in 1:nrow(D)){
D[j, D[j, ] == input.map$info$ploidy + 1] <- dp[j] + dq[j] + 1 +
as.numeric(dp[j] == 0 || dq[j] == 0)
}
res.temp <- calc_genoprob_cpp(ploidy,
t(D),
phP,
phQ,
seq.rf.pseudo,
as.numeric(rep(0, choose(ploidy, ploidy/2)^2 * n.mrk * n.ind)),
verbose = verbose)
if(verbose) cat("\n")
dim(res.temp[[1]]) <- c(choose(ploidy,ploidy/2)^2,n.mrk,n.ind)
dimnames(res.temp[[1]]) <- list(kronecker(apply(combn(letters[1:ploidy],ploidy/2),2, paste, collapse = ""),
Expand Down
36 changes: 16 additions & 20 deletions R/haplotype_map_utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -258,27 +258,23 @@ calc_genoprob_haplo <- function(ploidy, n.mrk, n.ind, haplo, emit = NULL,
}
mrk.names <- names(haplo)
if(highprec){
res.temp <- .Call("calc_genprob_haplo_highprec",
ploidy,
n.mrk,
n.ind,
haplo,
emit,
rf_vec,
as.numeric(rep(0, choose(ploidy, ploidy/2)^2 * n.mrk * n.ind)),
verbose,
PACKAGE = "mappoly")
res.temp <- calc_genprob_haplo_highprec_cpp(ploidy,
n.mrk,
n.ind,
haplo,
emit,
rf_vec,
as.numeric(rep(0, choose(ploidy, ploidy/2)^2 * n.mrk * n.ind)),
verbose)
} else{
res.temp <- .Call("calc_genprob_haplo",
ploidy,
n.mrk,
n.ind,
haplo,
emit,
rf_vec,
as.numeric(rep(0, choose(ploidy, ploidy/2)^2 * n.mrk * n.ind)),
verbose,
PACKAGE = "mappoly")
res.temp <- calc_genprob_haplo_cpp(ploidy,
n.mrk,
n.ind,
haplo,
emit,
rf_vec,
as.numeric(rep(0, choose(ploidy, ploidy/2)^2 * n.mrk * n.ind)),
verbose)
}
if(verbose) cat("\n")
dim(res.temp[[1]]) <- c(choose(ploidy,ploidy/2)^2,n.mrk,n.ind)
Expand Down
14 changes: 6 additions & 8 deletions R/loglike_hmm.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,12 @@ loglike_hmm <- function(input.map, input.data = NULL, verbose = FALSE)
D[j, D[j, ] == input.map$info$ploidy + 1] <- dp[j] + dq[j] + 1 + as.numeric(dp[j] == 0 || dq[j] == 0)
for(i in 1:length(input.map$maps)){
rf.temp <- input.map$maps[[i]]$seq.rf
res.temp <- .Call("loglike_hmm",
input.map$info$ploidy,
t(D),
lapply(input.map$maps[[i]]$seq.ph$P, function(x) x-1),
lapply(input.map$maps[[i]]$seq.ph$Q, function(x) x-1),
rf.temp,
verbose,
PACKAGE = "mappoly")
res.temp <- loglike_hmm_cpp(input.map$info$ploidy,
t(D),
lapply(input.map$maps[[i]]$seq.ph$P, function(x) x-1),
lapply(input.map$maps[[i]]$seq.ph$Q, function(x) x-1),
rf.temp,
verbose)
input.map$maps[[i]]$loglike <- res.temp[[1]]
}
return(input.map)
Expand Down
16 changes: 1 addition & 15 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -478,21 +478,7 @@ mp_pallet2 <- colorRampPalette(c("#911eb4", "#000075","#4363d8","#42d4f4","#4699
mp_pallet3 <- colorRampPalette(c("#ffe119", "#f58231","#e6194b","#808000","#9a6324", "#800000","#911eb4", "#000075","#4363d8","#42d4f4","#469990", "#3cb44b"))

#' Update missing information
#'
#' Updates the missing data in the dosage matrix of an object of class
#' \code{mappoly.data} given a new probability threshold
#' @param input.data an object of class \code{mappoly.data}
#' @param prob.thres probability threshold to associate a marker call to a
#' dosage. Markers with maximum genotype probability smaller than 'prob.thres'
#' are considered as missing data for the dosage calling purposes
#' @examples
#' \donttest{
#' data.updated = update_missing(hexafake.geno.dist, prob.thres = 0.5)
#' print(hexafake.geno.dist)
#' print(data.updated)
#' }
#' @author Marcelo Mollinari, \email{[email protected]}
#' @export
#' @keywords internal
update_missing <- function(input.data, prob.thres = 0.95){
geno.dose <- dist_prob_to_class(geno = input.data$geno, prob.thres = prob.thres)
if(geno.dose$flag)
Expand Down
43 changes: 31 additions & 12 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,51 @@
## Re-submission of MAPpoly package

This is a re-submission of MAPpoly package. This version (0.4.0), contains the following changes
This is a re-submission of the MAPpoly package. This version includes changes to address the issues that led to its archival on CRAN, specifically the failure in installing the package using `--use-LTO`. We have made corrections to ensure compatibility and successful installation with `--use-LTO`.

- Update DESCRIPTION file
- Functions to build maps in individual parents
- Functions to merge individual maps
- Imputation functions based on map
- Functions to edit order interactively
- Fix minor bugs
Changes in this submission include:

- Addressed the `--use-LTO` installation failure issue

Thank you for reviewing our re-submission!

## Test environments
* local R installation (macOS Somona 14.3.1), R 4.3.2
* local R installation (Ubuntu 22.04), R 4.3.2
* local R installation (macOS Sonoma 14.3.1), R 4.3.3
- Apple clang version 14.0.0 (clang-1400.0.29.202)
- GNU Fortran (GCC) 12.2.0
* local R installation (Ubuntu 22.04), R 4.3.3
- gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
- GNU Fortran (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
- Compiled using the following configuration:

./configure \
--prefix=/opt/R/${R_VERSION} \
--enable-R-shlib \
--enable-memory-profiling \
--with-blas \
--with-lapack\
--enable-lto=R

And installed using `R CMD INSTALL --use-LTO mappoly_0.4.1.tar.gz`
* local R installation (Ubuntu 22.04), R devel
- Intel(R) oneAPI DPC++/C++ Compiler 2024.0.2 (2024.0.2.20231213)
- ifx (IFX) 2024.0.2 20231213

* Win-builder (release and devel)


## R CMD check results

0 errors | 0 warnings | 2 notes

- on local macOS: R 4.3.2
- on local macOS: R 4.3.3
* installed size is 8.2Mb
sub-directories of 1Mb or more:
* R: 2.8Mb
* data: 3.0Mb
* GNU make is a SystemRequirements.

* GNU make is a SystemRequirements.

- Checked with `--use-LTO` flag: Installation successful without any errors or warnings.

## Downstream dependencies

We checked 3 reverse dependencies (3 from CRAN + 0 from Bioconductor), comparing R CMD check results across CRAN and dev versions of this package.
Expand Down
21 changes: 2 additions & 19 deletions man/update_missing.Rd

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

Loading

0 comments on commit 7bcae98

Please sign in to comment.