Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare for CRAN release #369

Merged
merged 9 commits into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Version: 2.1.10
Date: 2023-01-25 22:44:37 UTC
SHA: 67d986732c578ff8f65884b4ca622c39f36da995
Version: 2.1.11
Date: 2025-02-06 21:23:37 UTC
SHA: 43a3b10c137ff05d1282f44eeab5d25418a7f841
10 changes: 10 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ BUG FIX

- genlight objects subset without any arguments to loci no longer gain an
extra byte. (reported: @maxecoulter, #363)
- internal C functions `bytesToInt()` and `bytesToDouble()` have a new
condition to prevent overflows (thanks for the suggested fix by Ivan Krylov)

MISC

- `spca_randtest()` has been updated with a new p argument to include a
Bonferroni correction (fixed in #368, but initially implemented by @valemon
in #247)
- `find.clust()` data frame method now sets `scale = FALSE` to align with the
other methods. (reported: @cassondranewman, #362; fixed: @tiagomaie, #366)

CHANGES IN ADEGENET VERSION 2.1.10

Expand Down
3 changes: 3 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ Authors@R:
comment = c(ORCID = "0000-0003-3823-0373")),
person(given = "Max",
family = "Coulter",
role = "ctb"),
person(given = "Ivan",
family = "Krylov",
role = "ctb")
)
Description: Toolset for the exploration of genetic and genomic
Expand Down
6 changes: 3 additions & 3 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ S3method(gengraph,genpop)
S3method(gengraph,matrix)
S3method(get.likelihood,seqTrack)
S3method(graphMutations,DNAbin)
S3method(is,genind)
S3method(is,genpop)
S3method(labels,haploGen)
S3method(loadingplot,default)
S3method(loadingplot,glPca)
Expand All @@ -70,7 +68,6 @@ S3method(print,haploGen)
S3method(print,monmonier)
S3method(print,spca)
S3method(rbind,genlight)
S3method(sample,haploGen)
S3method(scatter,dapc)
S3method(scatter,glPca)
S3method(screeplot,spca)
Expand Down Expand Up @@ -128,6 +125,8 @@ export(genind2genpop)
export(genpop)
export(hier)
export(hybridize)
export(is.genind)
export(is.genpop)
export(loadingplot)
export(makefreq)
export(minorAllele)
Expand All @@ -142,6 +141,7 @@ export(read.genetix)
export(read.snp)
export(read.structure)
export(repool)
export(sample.haploGen)
export(scaleGen)
export(seqTrack)
export(setPop)
Expand Down
2 changes: 0 additions & 2 deletions R/basicMethods.R
Original file line number Diff line number Diff line change
Expand Up @@ -543,14 +543,12 @@ print.genpopSummary <- function(x, ...){
###############
# Methods "is"
###############
#' @method is genind
#' @export
is.genind <- function(x){
res <- ( is(x, "genind") & validObject(x))
return(res)
}

#' @method is genpop
#' @export
is.genpop <- function(x){
res <- ( is(x, "genpop") & validObject(x))
Expand Down
1 change: 0 additions & 1 deletion R/haploGen.R
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,6 @@ plotHaploGen <- function(x, annot=FALSE, date.range=NULL, col=NULL, bg="grey", a
###################
## sample.haploGen
###################
#' @method sample haploGen
#' @export
sample.haploGen <- function(x, n){
##sample.haploGen <- function(x, n, rDate=.rTimeSeq, arg.rDate=NULL){
Expand Down
2 changes: 1 addition & 1 deletion R/import.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
#' for your samples. This is especially useful if you have a hierarchical or
#' factorial sampling design.
#' @param hierarchy a hierarchical formula that explicitely defines hierarchical
#' levels in your strata. see \code{\link{hierarchy}} for details.
#' levels in your strata.
#' @param check.ploidy a boolean indicating if the ploidy should be checked (TRUE,
#' default) or not (FALSE). Not checking the ploidy makes the import much faster,
#' but might result in bugs/problems if the input file is misread or the ploidy is
Expand Down
2 changes: 1 addition & 1 deletion R/strataMethods.R
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@
#' levels of the strata. An example of a hierarchical formula would
#' be:\tabular{r}{ \code{~Country/City/Neighborhood}} This convention was
#' chosen as it becomes easier to type and makes intuitive sense when defining
#' a \code{\link{hierarchy}}. Note: it is important to use hiearchical
#' a hierarchy. Note: it is important to use hiearchical
#' formulas when specifying hierarchies as other types of formulas (eg.
#' \code{~Country*City*Neighborhood}) will give incorrect results.}
#'
Expand Down
2 changes: 1 addition & 1 deletion cran-comments.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
This update fixes an error thrown by LLVM in C23 mode by removing the `typedef short bool` definition in `snpbin.h`
This fixes a buffer overflow that was negatively affecting dartR.base
31 changes: 10 additions & 21 deletions docker/testing/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM rocker/drd
FROM rocker/r-devel-san

MAINTAINER Thibaut Jombart <[email protected]>

RUN apt-get update && apt-get upgrade -y
RUN apt-get install libssl-dev libxml2-dev pandoc pandoc-citeproc libblas-dev liblapack-dev git qpdf -y
RUN apt-get install -y libcurl4-openssl-dev libssl-dev libfontconfig1-dev libxml2-dev libharfbuzz-dev libfribidi-dev libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev gdal-bin proj-bin libgdal-dev libproj-dev libgmp3-dev jags libfftw3-dev

## add guest user

Expand All @@ -15,35 +15,24 @@ RUN chmod a+rw /usr/local/lib/R/site-library -R

## install CRAN packages

RUN echo 'options(download.file.method = "libcurl", repos = c(CRAN = "https://cran.ma.imperial.ac.uk"))' > ~/.Rprofile
# RUN echo 'options(download.file.method = "libcurl", repos = c(CRAN = "https://cran.ma.imperial.ac.uk"))' > ~/.Rprofile

RUN r -e "install.packages('devtools')" \
&& r -e "install.packages('roxygen2')" \
&& r -e "install.packages('testthat')" \
&& r -e "install.packages('rmarkdown')" \
&& r -e "install.packages('adegenet', dependencies = c('Depends', 'Imports'))" \
&& r -e "install.packages('pegas')" \
&& r -e "install.packages('hierfstat')" \
&& r -e "install.packages('poppr')" \
&& r -e "install.packages('akima')" \
&& r -e "install.packages('maps')" \
&& r -e "install.packages('splancs')" \
&& r -e "install.packages('tripack')"
&& r -e "install.packages('adegenet', dependencies = TRUE)"



## install devel packages (github)

RUN r -e "devtools::install_github('thibautjombart/adegenet')"
RUN r -e 'install.packages("BiocManager")' \
&& r -e 'BiocManager::install("SNPRelate")' \
&& r -e 'install.packages("dartR.base")'


## clone repos to get sources
RUN apt-get install -y git

RUN su guest
RUN mkdir ~/dev
WORKDIR /home/guest/dev

RUN git clone https://github.com/thibautjombart/adegenet
COPY . .

WORKDIR /home/guest/
RUN ls='ls --color=auto'
CMD Rscript -e 'library(dartR.base); gl.pcoa(testset.gl)'
8 changes: 4 additions & 4 deletions inst/CITATION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
citHeader("To cite the adegenet package:")

citEntry(
entry="Article",
bibentry(
bibtype="Article",
title = "adegenet: a R package for the multivariate analysis of genetic markers",
journal= "Bioinformatics",
year = "2008",
Expand All @@ -13,8 +13,8 @@ textVersion = "Jombart, T. (2008) adegenet: a R package for the multivariate ana
)


citEntry(
entry="Article",
bibentry(
bibtype="Article",
title = "adegenet 1.3-1: new tools for the analysis of genome-wide SNP data",
journal= "Bioinformatics",
year = "2011",
Expand Down
2 changes: 2 additions & 0 deletions man/auxil.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
\alias{.rmspaces}
\alias{.genlab}
\alias{.readExt}
\alias{.render.server.info}
\alias{corner}
\alias{num2col}
\alias{fac2col}
Expand Down Expand Up @@ -50,6 +51,7 @@
\item \code{.rmspaces}: remove peripheric spaces in a character string.
\item \code{.genlab}: generate labels in a correct alphanumeric ordering.
\item \code{.readExt}: read the extension of a given file.
\item \code{.render.server.info} used to display session information for the dapcServer
}

Color palettes include:
Expand Down
2 changes: 1 addition & 1 deletion man/df2genind.Rd

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

2 changes: 1 addition & 1 deletion man/pairDist.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pairDistPlot(x, \dots)
object. For \code{\linkS4class{genind}} objects, pairwise squared
Euclidean distances are computed from the allele data. For
\code{DNAbin} objects, distances are computed uing
\code{\link{dist.dna}}, and '...' is used to pass arguments to the
\code{dist.dna}, and '...' is used to pass arguments to the
function. }

\item{grp}{a factor defining a grouping of individuals.}
Expand Down
2 changes: 1 addition & 1 deletion man/strata-methods.Rd

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

48 changes: 25 additions & 23 deletions src/snpbin.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,11 @@ void bytesToBinInt(unsigned char *vecbytes, int *vecsize, int *vecres){
temp = (int *) calloc(8, sizeof(int));

for(i=0;i<*vecsize;i++){
byteToBinInt(vecbytes[i], temp);
for(j=0;j<=7;j++){
vecres[j+idres] = temp[j];
}
idres = idres + 8;
byteToBinInt(vecbytes[i], temp);
for(j=0;j<=7;j++){
vecres[j+idres] = temp[j];
}
idres = idres + 8;
}

free(temp);
Expand Down Expand Up @@ -186,19 +186,20 @@ void bytesToInt(unsigned char *vecbytes, int *veclength, int *nbvec, int *vecres

/* initialize result vector to 0 */
for(i=0; i < *reslength; i++){
vecres[i]=0;
vecres[i]=0;
}

/* build output */
for(k=0;k<*nbvec;k++){ /* for all input vector */
idres = 0;
for(i=0;i<*veclength;i++){ /* for one input vector */
byteToBinInt(vecbytes[i+ k* *veclength], temp); /* byte -> 8 int (0/1)*/
for(j=0;j<=7;j++){ /* fill in the result*/
vecres[j+idres] += temp[j];
}
idres = idres + 8;
}
idres = 0;
for(i=0;i<*veclength;i++){ /* for one input vector */
byteToBinInt(vecbytes[i+ k* *veclength], temp); /* byte -> 8 int (0/1)*/
for(j=0;j<=7;j++){ /* fill in the result*/
if (j+idres >= *reslength) break; // do not decode padding bytes
vecres[j+idres] += temp[j];
}
idres = idres + 8;
}
}
free(temp);
} /* end bytesToInt */
Expand All @@ -214,18 +215,19 @@ void bytesToDouble(unsigned char *vecbytes, int *veclength, int *nbvec, double *

/* initialize result vector to 0 */
for(i=0; i < *reslength; i++){
vecres[i]=0.0;
vecres[i]=0.0;
}

for(k=0;k<*nbvec;k++){ /* for all input vector */
idres = 0;
for(i=0;i<*veclength;i++){ /* for one input vector */
byteToBinDouble(vecbytes[i+ k* *veclength], temp); /* byte -> 8 double (0/1)*/
for(j=0;j<=7;j++){ /* fill in the result*/
vecres[j+idres] += temp[j];
}
idres = idres + 8;
}
idres = 0;
for(i=0;i<*veclength;i++){ /* for one input vector */
byteToBinDouble(vecbytes[i+ k* *veclength], temp); /* byte -> 8 double (0/1)*/
for(j=0;j<=7;j++){ /* fill in the result*/
if (j+idres >= *reslength) break; // do not decode padding bytes
vecres[j+idres] += temp[j];
}
idres = idres + 8;
}
}
free(temp);
} /* end bytesToInt */
Expand Down