Skip to content

Commit 9f24e97

Browse files
authored
Merge pull request #369 from thibautjombart/release/2.1.11
Prepare for CRAN release
2 parents e4874e7 + dc7c741 commit 9f24e97

16 files changed

+66
-63
lines changed

CRAN-SUBMISSION

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
Version: 2.1.10
2-
Date: 2023-01-25 22:44:37 UTC
3-
SHA: 67d986732c578ff8f65884b4ca622c39f36da995
1+
Version: 2.1.11
2+
Date: 2025-02-06 21:23:37 UTC
3+
SHA: 43a3b10c137ff05d1282f44eeab5d25418a7f841

ChangeLog

+10
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@ BUG FIX
44

55
- genlight objects subset without any arguments to loci no longer gain an
66
extra byte. (reported: @maxecoulter, #363)
7+
- internal C functions `bytesToInt()` and `bytesToDouble()` have a new
8+
condition to prevent overflows (thanks for the suggested fix by Ivan Krylov)
9+
10+
MISC
11+
12+
- `spca_randtest()` has been updated with a new p argument to include a
13+
Bonferroni correction (fixed in #368, but initially implemented by @valemon
14+
in #247)
15+
- `find.clust()` data frame method now sets `scale = FALSE` to align with the
16+
other methods. (reported: @cassondranewman, #362; fixed: @tiagomaie, #366)
717

818
CHANGES IN ADEGENET VERSION 2.1.10
919

DESCRIPTION

+3
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ Authors@R:
7070
comment = c(ORCID = "0000-0003-3823-0373")),
7171
person(given = "Max",
7272
family = "Coulter",
73+
role = "ctb"),
74+
person(given = "Ivan",
75+
family = "Krylov",
7376
role = "ctb")
7477
)
7578
Description: Toolset for the exploration of genetic and genomic

NAMESPACE

+3-3
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ S3method(gengraph,genpop)
4747
S3method(gengraph,matrix)
4848
S3method(get.likelihood,seqTrack)
4949
S3method(graphMutations,DNAbin)
50-
S3method(is,genind)
51-
S3method(is,genpop)
5250
S3method(labels,haploGen)
5351
S3method(loadingplot,default)
5452
S3method(loadingplot,glPca)
@@ -70,7 +68,6 @@ S3method(print,haploGen)
7068
S3method(print,monmonier)
7169
S3method(print,spca)
7270
S3method(rbind,genlight)
73-
S3method(sample,haploGen)
7471
S3method(scatter,dapc)
7572
S3method(scatter,glPca)
7673
S3method(screeplot,spca)
@@ -128,6 +125,8 @@ export(genind2genpop)
128125
export(genpop)
129126
export(hier)
130127
export(hybridize)
128+
export(is.genind)
129+
export(is.genpop)
131130
export(loadingplot)
132131
export(makefreq)
133132
export(minorAllele)
@@ -142,6 +141,7 @@ export(read.genetix)
142141
export(read.snp)
143142
export(read.structure)
144143
export(repool)
144+
export(sample.haploGen)
145145
export(scaleGen)
146146
export(seqTrack)
147147
export(setPop)

R/basicMethods.R

-2
Original file line numberDiff line numberDiff line change
@@ -543,14 +543,12 @@ print.genpopSummary <- function(x, ...){
543543
###############
544544
# Methods "is"
545545
###############
546-
#' @method is genind
547546
#' @export
548547
is.genind <- function(x){
549548
res <- ( is(x, "genind") & validObject(x))
550549
return(res)
551550
}
552551

553-
#' @method is genpop
554552
#' @export
555553
is.genpop <- function(x){
556554
res <- ( is(x, "genpop") & validObject(x))

R/haploGen.R

-1
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,6 @@ plotHaploGen <- function(x, annot=FALSE, date.range=NULL, col=NULL, bg="grey", a
526526
###################
527527
## sample.haploGen
528528
###################
529-
#' @method sample haploGen
530529
#' @export
531530
sample.haploGen <- function(x, n){
532531
##sample.haploGen <- function(x, n, rDate=.rTimeSeq, arg.rDate=NULL){

R/import.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
#' for your samples. This is especially useful if you have a hierarchical or
6363
#' factorial sampling design.
6464
#' @param hierarchy a hierarchical formula that explicitely defines hierarchical
65-
#' levels in your strata. see \code{\link{hierarchy}} for details.
65+
#' levels in your strata.
6666
#' @param check.ploidy a boolean indicating if the ploidy should be checked (TRUE,
6767
#' default) or not (FALSE). Not checking the ploidy makes the import much faster,
6868
#' but might result in bugs/problems if the input file is misread or the ploidy is

R/strataMethods.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@
216216
#' levels of the strata. An example of a hierarchical formula would
217217
#' be:\tabular{r}{ \code{~Country/City/Neighborhood}} This convention was
218218
#' chosen as it becomes easier to type and makes intuitive sense when defining
219-
#' a \code{\link{hierarchy}}. Note: it is important to use hiearchical
219+
#' a hierarchy. Note: it is important to use hiearchical
220220
#' formulas when specifying hierarchies as other types of formulas (eg.
221221
#' \code{~Country*City*Neighborhood}) will give incorrect results.}
222222
#'

cran-comments.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
This update fixes an error thrown by LLVM in C23 mode by removing the `typedef short bool` definition in `snpbin.h`
1+
This fixes a buffer overflow that was negatively affecting dartR.base

docker/testing/Dockerfile

+10-21
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
FROM rocker/drd
1+
FROM rocker/r-devel-san
22

33
MAINTAINER Thibaut Jombart <[email protected]>
44

55
RUN apt-get update && apt-get upgrade -y
6-
RUN apt-get install libssl-dev libxml2-dev pandoc pandoc-citeproc libblas-dev liblapack-dev git qpdf -y
6+
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
77

88
## add guest user
99

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

1616
## install CRAN packages
1717

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

2020
RUN r -e "install.packages('devtools')" \
21-
&& r -e "install.packages('roxygen2')" \
22-
&& r -e "install.packages('testthat')" \
23-
&& r -e "install.packages('rmarkdown')" \
24-
&& r -e "install.packages('adegenet', dependencies = c('Depends', 'Imports'))" \
25-
&& r -e "install.packages('pegas')" \
26-
&& r -e "install.packages('hierfstat')" \
27-
&& r -e "install.packages('poppr')" \
28-
&& r -e "install.packages('akima')" \
29-
&& r -e "install.packages('maps')" \
30-
&& r -e "install.packages('splancs')" \
31-
&& r -e "install.packages('tripack')"
21+
&& r -e "install.packages('adegenet', dependencies = TRUE)"
3222

33-
34-
35-
## install devel packages (github)
36-
37-
RUN r -e "devtools::install_github('thibautjombart/adegenet')"
23+
RUN r -e 'install.packages("BiocManager")' \
24+
&& r -e 'BiocManager::install("SNPRelate")' \
25+
&& r -e 'install.packages("dartR.base")'
3826

3927

4028
## clone repos to get sources
29+
RUN apt-get install -y git
4130

4231
RUN su guest
4332
RUN mkdir ~/dev
4433
WORKDIR /home/guest/dev
4534

46-
RUN git clone https://github.com/thibautjombart/adegenet
35+
COPY . .
4736

4837
WORKDIR /home/guest/
49-
RUN ls='ls --color=auto'
38+
CMD Rscript -e 'library(dartR.base); gl.pcoa(testset.gl)'

inst/CITATION

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
citHeader("To cite the adegenet package:")
22

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

1515

16-
citEntry(
17-
entry="Article",
16+
bibentry(
17+
bibtype="Article",
1818
title = "adegenet 1.3-1: new tools for the analysis of genome-wide SNP data",
1919
journal= "Bioinformatics",
2020
year = "2011",

man/auxil.Rd

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
\alias{.rmspaces}
66
\alias{.genlab}
77
\alias{.readExt}
8+
\alias{.render.server.info}
89
\alias{corner}
910
\alias{num2col}
1011
\alias{fac2col}
@@ -50,6 +51,7 @@
5051
\item \code{.rmspaces}: remove peripheric spaces in a character string.
5152
\item \code{.genlab}: generate labels in a correct alphanumeric ordering.
5253
\item \code{.readExt}: read the extension of a given file.
54+
\item \code{.render.server.info} used to display session information for the dapcServer
5355
}
5456

5557
Color palettes include:

man/df2genind.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/pairDist.Rd

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ pairDistPlot(x, \dots)
4545
object. For \code{\linkS4class{genind}} objects, pairwise squared
4646
Euclidean distances are computed from the allele data. For
4747
\code{DNAbin} objects, distances are computed uing
48-
\code{\link{dist.dna}}, and '...' is used to pass arguments to the
48+
\code{dist.dna}, and '...' is used to pass arguments to the
4949
function. }
5050

5151
\item{grp}{a factor defining a grouping of individuals.}

man/strata-methods.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/snpbin.c

+25-23
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,11 @@ void bytesToBinInt(unsigned char *vecbytes, int *vecsize, int *vecres){
146146
temp = (int *) calloc(8, sizeof(int));
147147

148148
for(i=0;i<*vecsize;i++){
149-
byteToBinInt(vecbytes[i], temp);
150-
for(j=0;j<=7;j++){
151-
vecres[j+idres] = temp[j];
152-
}
153-
idres = idres + 8;
149+
byteToBinInt(vecbytes[i], temp);
150+
for(j=0;j<=7;j++){
151+
vecres[j+idres] = temp[j];
152+
}
153+
idres = idres + 8;
154154
}
155155

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

187187
/* initialize result vector to 0 */
188188
for(i=0; i < *reslength; i++){
189-
vecres[i]=0;
189+
vecres[i]=0;
190190
}
191191

192192
/* build output */
193193
for(k=0;k<*nbvec;k++){ /* for all input vector */
194-
idres = 0;
195-
for(i=0;i<*veclength;i++){ /* for one input vector */
196-
byteToBinInt(vecbytes[i+ k* *veclength], temp); /* byte -> 8 int (0/1)*/
197-
for(j=0;j<=7;j++){ /* fill in the result*/
198-
vecres[j+idres] += temp[j];
199-
}
200-
idres = idres + 8;
201-
}
194+
idres = 0;
195+
for(i=0;i<*veclength;i++){ /* for one input vector */
196+
byteToBinInt(vecbytes[i+ k* *veclength], temp); /* byte -> 8 int (0/1)*/
197+
for(j=0;j<=7;j++){ /* fill in the result*/
198+
if (j+idres >= *reslength) break; // do not decode padding bytes
199+
vecres[j+idres] += temp[j];
200+
}
201+
idres = idres + 8;
202+
}
202203
}
203204
free(temp);
204205
} /* end bytesToInt */
@@ -214,18 +215,19 @@ void bytesToDouble(unsigned char *vecbytes, int *veclength, int *nbvec, double *
214215

215216
/* initialize result vector to 0 */
216217
for(i=0; i < *reslength; i++){
217-
vecres[i]=0.0;
218+
vecres[i]=0.0;
218219
}
219220

220221
for(k=0;k<*nbvec;k++){ /* for all input vector */
221-
idres = 0;
222-
for(i=0;i<*veclength;i++){ /* for one input vector */
223-
byteToBinDouble(vecbytes[i+ k* *veclength], temp); /* byte -> 8 double (0/1)*/
224-
for(j=0;j<=7;j++){ /* fill in the result*/
225-
vecres[j+idres] += temp[j];
226-
}
227-
idres = idres + 8;
228-
}
222+
idres = 0;
223+
for(i=0;i<*veclength;i++){ /* for one input vector */
224+
byteToBinDouble(vecbytes[i+ k* *veclength], temp); /* byte -> 8 double (0/1)*/
225+
for(j=0;j<=7;j++){ /* fill in the result*/
226+
if (j+idres >= *reslength) break; // do not decode padding bytes
227+
vecres[j+idres] += temp[j];
228+
}
229+
idres = idres + 8;
230+
}
229231
}
230232
free(temp);
231233
} /* end bytesToInt */

0 commit comments

Comments
 (0)