Skip to content

Commit

Permalink
version 3.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Klassmann authored and cran-robot committed Nov 1, 2020
1 parent 37c0f0d commit ee09faf
Show file tree
Hide file tree
Showing 59 changed files with 2,242 additions and 569 deletions.
19 changes: 7 additions & 12 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: rehh
Maintainer: Alexander Klassmann <[email protected]>
Author: Mathieu Gautier, Alexander Klassmann and Renaud Vitalis
Version: 3.1.2
Version: 3.2.0
License: GPL (>= 2)
Title: Searching for Footprints of Selection using 'Extended Haplotype
Homozygosity' Based Tests
Expand All @@ -18,23 +18,18 @@ Description: Population genetic data such as 'Single Nucleotide
'Rsb' (Tang 2007) <doi:10.1371/journal.pbio.0050171> and
'XP-EHH' (Sabeti 2007) <doi:10.1038/nature06250>, targeted
at differential selection between two populations.
Various plotting functions are also included to facilitate
visualization and interpretation of these statistics.
Due to changes in the API, albeit mostly minor,
versions 3.X are not compatible with versions 2.0.X.
Note: optionally, vcf files can be imported using package vcfR. That package
is currently removed from CRAN, but can still be installed from
<https://github.com/knausb/vcfR> following instructions there.
Various plotting functions are included to facilitate
visualization and interpretation of these statistics.
Depends: R (>= 2.10)
Imports: methods, rehh.data
Suggests: ape, bookdown, data.table, gap, knitr, qqman, rmarkdown,
R.utils, testthat, vcfR
VignetteBuilder: knitr
NeedsCompilation: yes
Packaged: 2020-07-17 09:16:17 UTC; alex
RoxygenNote: 7.1.0
Packaged: 2020-11-01 09:31:22 UTC; alex
RoxygenNote: 7.1.1
URL: https://CRAN.R-project.org/package=rehh,
https://gitlab.com/oneoverx/rehh
BugReports: https://gitlab.com/oneoverx/rehh/issues
BugReports: https://gitlab.com/oneoverx/rehh/-/issues
Repository: CRAN
Date/Publication: 2020-07-17 10:30:03 UTC
Date/Publication: 2020-11-01 10:00:02 UTC
103 changes: 58 additions & 45 deletions MD5
Original file line number Diff line number Diff line change
@@ -1,95 +1,103 @@
4be95bfe5393b4ad0d988f9076587813 *DESCRIPTION
479cda305f23caf8bd3f42caa2013c3e *NAMESPACE
c3bdce8419097ef74d75dedfadbb2264 *NEWS.md
d778a01442f62a331f42f43636d35c9a *R/as.newick.R
791804c313fb1e1bc68e7c5b95ecc92d *R/calc_candidate_regions.R
f64accc80d3c07213985e6eebd0969a7 *R/calc_ehh.R
adf2e4d9478c23d89b6a1f64cbb8e645 *R/calc_ehhs.R
8e4fd944b954c1f38c17b5b3ce560700 *DESCRIPTION
60535cbfb654e4815b8af2877be13a28 *NAMESPACE
481b516368c4630b1471c79c49cf4f20 *NEWS.md
49fb7dde709b7d56d950cfa481eee11e *R/as.newick.R
c489a95c70ee3f7a9b21c5e4e1701e00 *R/calc_candidate_regions.R
a5184787be940979ca4d87c32a69a6c5 *R/calc_ehh.R
d846b662a796c555a11a05a253237219 *R/calc_ehhs.R
7fc6137f3a9052c916c600103630f747 *R/calc_furcation.R
8652c8e385335d536e351d10ccba7767 *R/calc_haplen.R
647a736449be2f7cb9ef08fc31691ad5 *R/calc_pairwise_haplen.R
1b9d3c5e76519a3101f08b58125167d3 *R/calc_pairwise_haplen.R
c0a7134ed354a1cc6e2d92cff7cb528b *R/calc_region_stats.R
aebc3fea50b8605b1d1aa3aaf21776bd *R/data2haplohh.R
dc4dfe02470f10724b4702d7bad63153 *R/calc_sfs_tests.R
db41e0abae0d42d719592911a8db10d7 *R/data2haplohh.R
3caea4a19997c6f248290697f797b4a1 *R/distribplot.R
ef5e101f1c8c4891d5991bf2fd0257b4 *R/extract_regions.R
e5d4611c5eeb4e3f839683a3f665e214 *R/freqbinplot.R
810c2aca58d223d852d957d0fe236b0a *R/furcation-class.R
b9dd5b7b760f2fdb3441fcf332fd8f9a *R/haplohh-class.R
10eddc406dc337e263f6e745a1c8d002 *R/haplohh2sweepfinder.R
6eebd3fac16bb154d1ea834dd0289c26 *R/ies2xpehh.R
0b91ea1dff6639b4c3b4f13dea539637 *R/ihh2ihs.R
1fc5288e0bd273f896e5daef79a8838e *R/ines2rsb.R
1ab4dd6448b5781c7abf510cd5be6750 *R/make.example.files.R
f1138821f4d4882da57c5499764342fd *R/manhattanplot.R
39ac154b20c0400cd5632b5268de2892 *R/make.example.files.R
14aae5afa388353eb0abee02d930773c *R/manhattanplot.R
de8aebb14b907da33b6e6483acb05467 *R/plot.ehh.R
c461be69e8d0960110dbd2e2c214c809 *R/plot.ehhs.R
f8018a6adb6442dd197b00f6f50d62d4 *R/plot.furcation.R
562bf90c94616972a745c618e3002078 *R/plot.haplen.R
46f5794ea7ee74e36c779522aa2d6ab2 *R/plot.haplohh.R
d0c64f19c95d71847c72b56a14db8de9 *R/rehh.R
e232bea3e5d1d83fdf560f24d01deb18 *R/scan_hh.R
f31185006802c7467a9f6a8cc8c92fa8 *R/scan_hh_full.R
d857d3be60093cc3900f1d221fd867fc *R/subset.haplohh.R
f0e6d5dc46aa06ec2aa75a551187cee9 *R/plot.haplohh.R
b0695663334e80f7f38654bd355b7c32 *R/rehh.R
eb17387a546704c5510ba46856b6ca93 *R/scan_hh.R
50902c106c1f1a7e23f3534f6f639290 *R/scan_hh_full.R
c8aaf488db328f7ea21ecb7ea309e4ee *R/subset.haplohh.R
9d53dfc94e3a08334b06091ab986217d *R/update_haplohh.R
8228a460ed62d771a05ec3e1e9a7cb59 *build/vignette.rds
28612d69e6e3c076a5bac689ddabec2b *build/vignette.rds
bbd50c8eb813216188dce7896d1490d3 *data/datalist
91be48fb8754c805321891b9374459f3 *data/haplohh_cgu_bta12.RData
8439f1531106aeabce40b21067a1ac5e *inst/CITATION
ae04d6c09732f0e29be34d966896d3d4 *inst/doc/examples.R
347ed7fd5246ab0a51b07eb65c551f51 *inst/doc/examples.Rmd
a66b153a90d0c7ba1cfc0e6d7d993e13 *inst/doc/examples.html
0aca4270ed980c2b91db059f72ce8512 *inst/doc/rehh.R
0cb9f06cbea7141d8522641178da4b54 *inst/doc/rehh.Rmd
4c42ce24a6e5e3c0f331df7518413c4d *inst/doc/rehh.html
ec7fb3bdabc787abe3be7512729a1e2f *inst/doc/examples.R
4d69844ff06315aff3356db7f85edd4c *inst/doc/examples.Rmd
dec90acf8e63ab73cfe08ef0fc212cfa *inst/doc/examples.html
e4ac37fc09893fb1d5297d231923ba02 *inst/doc/rehh.R
602994925b401f0fe98262d30ff9d6e8 *inst/doc/rehh.Rmd
b9da2d6fdd34b4a4b7b0f4e4addbac14 *inst/doc/rehh.html
529c33971c081bacc8d00072aac22b20 *inst/extdata/bta12_cgu.vcf.gz
1a13676197023c7796532d96aeff7f76 *inst/extdata/example1.hap
98aedc74c294ec4769b8e3272200fbbe *inst/extdata/example1.map
ef932b5c063861aae607ee0a93f33fb1 *inst/extdata/example1.vcf
259361a2879d15a50f494d8cb2322f95 *inst/extdata/example2.hap
05fcdbaf97aff8c6125dff9c40770538 *inst/extdata/example2.map
5e14d8117c9a49dac08ad3970a046373 *inst/extdata/example2.vcf
47a95eddad7ca90f68a4c35e671957b2 *inst/extdata/example_neutral.vcf
9adc5ae193051f554e00eda74567486e *inst/extdata/example_sweep.vcf
ab2d39dc100928b7c1e3a510287bb4c1 *inst/extdata/example_sweep_with_recombination.vcf
e444d999cd7277d08690d6031446baf1 *inst/extdata/ms.out
3f1bb468e3b3346d7925ed893f668d22 *man/allelefurcation-class.Rd
e43b5b616e972b190f596b0791aafdcb *man/as.newick.Rd
7d199b2def3e6d19e90ffa4128531956 *man/calc_candidate_regions.Rd
9a1d4d2573383b1af915cd9740433948 *man/calc_ehh.Rd
877765521fdd1bc21f0fad429f434980 *man/calc_ehhs.Rd
8ce616089d0acc6279c8acaaf2b30cb7 *man/calc_ehh.Rd
35d1ec2b344079cf92df525bf932c1d1 *man/calc_ehhs.Rd
c933fc808090cbc1cade18247471df48 *man/calc_furcation.Rd
12a719a71c961a21e8de7f5146ac1dc2 *man/calc_haplen.Rd
36e5218744298abe44f67dbfb6d4c599 *man/calc_pairwise_haplen.Rd
e6f80fc8df2c011ea38bd46d54b06a74 *man/calc_pairwise_haplen.Rd
2acaa7c3c89fcb46f3c7e4f370160986 *man/calc_region_stats.Rd
aae72c0cb9f1bffb913dd8b13d534125 *man/data2haplohh.Rd
d2af8949d1a198ab26bfe45434be5924 *man/calc_sfs_tests.Rd
827eda0a35e51d45916607f10511a564 *man/data2haplohh.Rd
de43ae62050ec49c91c44138fe93b67c *man/distribplot.Rd
d557df62cd52e701005da0a5f0d8ec7c *man/extract_regions.Rd
17a00bb024774a6d4ef9491306f79872 *man/freqbinplot.Rd
21f93e394201b1b91a9de96890fa918a *man/ftree-class.Rd
33ddd89f9f2b47889d3be980b70747a0 *man/furcation-class.Rd
128fede3b0de4f84512e35c295433af2 *man/haplen-class.Rd
9917b0686748d15925dc890f045a076d *man/haplohh-class.Rd
c4211206daf63a9bfea41eb968dc3fc6 *man/haplohh2sweepfinder.Rd
b240d6b987257834ba5e9815aadfc537 *man/haplohh_cgu_bta12.Rd
8f39cb0fa8ff33094b34f5cc094afa8d *man/ies2xpehh.Rd
53e588ceb4a78d806505251b4fb6f763 *man/ihh2ihs.Rd
5823cdec432bbd985be9063d46fc6af0 *man/ines2rsb.Rd
2449dbe55eb56665554d7fc8ee255766 *man/make.example.files.Rd
704045fb4408191c2962598b09080c7c *man/manhattanplot.Rd
9bf74e16a8816a0fd0f39fa67e879924 *man/make.example.files.Rd
af0baef3fee7a181c0b995d3bc65b5e0 *man/manhattanplot.Rd
96922dd9dbc33bcb024a69e3ec308be7 *man/plot.ehh.Rd
0091288c2de9b5c909c4f135dd87b1ad *man/plot.ehhs.Rd
c7933322276a4b8fa37433e050766c4d *man/plot.furcation.Rd
939fa1dcc75eacda1eef877ee99c9e7b *man/plot.haplen.Rd
cd8682e4686cbe6130490e25a8e79301 *man/plot.haplohh.Rd
9d5eba020ec22ee48ef012d9f1a54d70 *man/rehh-package.Rd
090eca9f26b95024ee2aca3f483caf52 *man/plot.haplohh.Rd
07fab15f3017f348fcafac0dec82ac39 *man/rehh-package.Rd
0b3af48394811f7b7e481ca6fd7c63fd *man/remove.example.files.Rd
a67e3e8c460d7f55dde5243edf351c6c *man/scan_hh.Rd
9894dd029348f74ae46e2fb658289e24 *man/scan_hh_full.Rd
ce6e4d831dabbd3ded45ea6a4cdbf433 *man/subset.haplohh.Rd
c7d8274a12c1b590ad9f210db5bfa52c *man/scan_hh.Rd
f0afc4cb433d9c6b7fddb600605d1ef7 *man/scan_hh_full.Rd
3940df1de7b4ad97554a1d03ce8c64e1 *man/subset.haplohh.Rd
35d96dc7734635751107a32802c872c7 *man/update_haplohh.Rd
ea195efe5e62727303defe92c7dfd337 *src/CALL_ASNEWICK.c
3bbb1385892442008a3efa83ed14f25a *src/CALL_EHH.c
733a9d7f96da43cdd8127c4323bca3dc *src/CALL_EHHS.c
af8abfa9ecc355a7bd825358ef3afe5e *src/CALL_FURCATION.c
28bb39004e7d75cb01ff08c952148e6e *src/CALL_INTEGRAL.c
d5c7bc8c7d80203979aa6a9237e9346d *src/CALL_PAIRWISE_HAPLEN.c
60d65393e0384e62cb72f308058ef007 *src/CALL_PAIRWISE_HAPLEN.c
997866feb635416dba2745e1275b33f0 *src/CALL_SCAN_HH.c
34549fcae56fa1cf4325ed1c9870b376 *src/CALL_SCAN_HH2.c
fe0c7dcc2bb11ae05b3ea7080d5aa7d7 *src/CALL_SCAN_HH_FULL.c
63feb5cece836f3ef515492d15a166af *src/CALL_SFS_TESTS.c
95e3011e37d9dde0d75f3a3819b2acd3 *src/Makevars
fba8f42eba26752e28b32338665d7348 *src/asnewick.c
c091d180d8864d7f3eea26b915784877 *src/asnewick.h
Expand All @@ -99,8 +107,10 @@ c091d180d8864d7f3eea26b915784877 *src/asnewick.h
27c58a2a27960458af14d7c61f0d155e *src/calc_ehhs.h
08642573b73421d2a0a401769bf8248b *src/calc_furcation.c
965b71b2edfd728a6a32472cda3e7713 *src/calc_furcation.h
8ea79b7de0fcb35f571962e17f7567fb *src/calc_pairwise_haplen.c
00d18c8e73beb8a0c8351110060f1219 *src/calc_pairwise_haplen.h
a05f2b0184ce0b035a956723f6d92eda *src/calc_pairwise_haplen.c
3839049affccee8d202be5eb505d366d *src/calc_pairwise_haplen.h
bbde67f562edd6b5cc23a49ca23ad99a *src/calc_sfs_tests.c
b779fcb22524d83657d325d4245cbc99 *src/calc_sfs_tests.h
4c1d8febd6cd04df5b4d22a3e2bd2c09 *src/definitions.h
d42625e6350dcad51095cf22bf571db8 *src/haplotypes.c
976fa1c7e90f686dd57ee6229b12c43a *src/haplotypes.h
Expand All @@ -110,9 +120,11 @@ d515074159b54f4e8fa71d847f0cc4e3 *src/haplotypes_with_nodes.c
b8718089aed1c9aadf83d877f9762a5c *src/haplotypes_with_nodes.h
29441637b9f2e8c074323b102c802683 *src/homozygosity.c
8a0372f7038e294975eba1db483598ca *src/homozygosity.h
b6ca1e604a504ee2fdb7aff7621ce855 *src/init.c
625ba8904f1e83f49b398277e7a524d3 *src/init.c
77f8dc940762ed75f438205732206fc7 *src/integrate.c
40f968c6eb88192b40c247c6b9cd6492 *src/integrate.h
72a80b3450d690a6ac58609f94dd7fcb *src/sfs_moments.c
a3b3aeea2920660c6e293769c631b068 *src/sfs_moments.h
7d20b8af53a3a33835b45ed2dde1f2ff *tests/testthat.R
d10abdbe610dee90be8e7c6a1baf28da *tests/testthat/furcation_F1205400.newick
26f4662e29cc03d705c9c9e5d81046d6 *tests/testthat/serialized_furcation_F1205400.txt
Expand All @@ -121,14 +133,15 @@ d10abdbe610dee90be8e7c6a1baf28da *tests/testthat/furcation_F1205400.newick
7f87b223f6153b8926956609ba293241 *tests/testthat/setup.R
a177583dabfe62a659b2d0ff4e5829d8 *tests/testthat/teardown.R
0f2d4d7ffafcef03cde572357aa3508e *tests/testthat/test_calc_candidate_regions.R
b333feb96e38279b41a60f9fcb93dd65 *tests/testthat/test_data2haplohh.R
f8a26c6ede3ff1c7bf965b3d3c9797ea *tests/testthat/test_data2haplohh.R
a57d331f176ddaa7e7a19fb056cd2626 *tests/testthat/test_error_messages.R
3c553b425c68132fe5a74a06fc85d3e4 *tests/testthat/test_examples.R
6adc3c44917659c38b0adddbbf254f18 *tests/testthat/test_furcation.R
c5d51b0340ebb2dc628e911bcc259f82 *tests/testthat/test_furcation.R
83461c197932114fbb6185821cdae353 *tests/testthat/test_ihh2ihs.R
09bd1fc643230fc24c90aac2c2d2f035 *tests/testthat/test_scan_full.R
c94ab72e812c9daf632b2acb919aa436 *tests/testthat/test_scan_full.R
06e74a8f326b2099d3ef7b77c1664a89 *tests/testthat/test_scan_hh.R
347ed7fd5246ab0a51b07eb65c551f51 *vignettes/examples.Rmd
2641e6bbf68bdd6c97280b3a86dfedcc *tests/testthat/test_sfs_tests.R
4d69844ff06315aff3356db7f85edd4c *vignettes/examples.Rmd
80ac2e78110aa3e54fb5ce824bd5574f *vignettes/genetics.csl
0cb9f06cbea7141d8522641178da4b54 *vignettes/rehh.Rmd
0ae5b0965175c9ae6cbc11dd9bf5adc5 *vignettes/vignette.bib
602994925b401f0fe98262d30ff9d6e8 *vignettes/rehh.Rmd
dc13674ff5df93035a03384f762a946f *vignettes/vignette.bib
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ export(calc_furcation)
export(calc_haplen)
export(calc_pairwise_haplen)
export(calc_region_stats)
export(calc_sfs_tests)
export(data2haplohh)
export(distribplot)
export(extract_regions)
export(freqbinplot)
export(haplohh2sweepfinder)
export(ies2xpehh)
export(ihh2ihs)
export(ines2rsb)
Expand Down
13 changes: 12 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
### rehh 3.2.0 (October 30, 2020)

* corrections and extensions of the vignettes
* added inset between chromosomes in function manhattanplot()
* added option to highlight specific markers in plot.haplohh()
* function subset() can filter markers on maximum number of alleles
* option to set maximal haplotype extension (in base pairs) in function scan_hh_full()
* added function haplohh2sweepfinder() that extracts allele frequencies which
can serve as input for the programs SweepFinder or SweeD
* added function calc_sfs_tests() to calculate Tajima's D and Fay & Wu's H, allowing for data with missing values

### rehh 3.1.2 (July 17, 2020)

* added option to parse vcf files using package 'data.table' in order to avoid reliance on package 'vcfR' which is currently removed from CRAN (but still available on github: https://github.com/knausb/vcfR)
* added option to parse vcf files using package 'data.table' in order to avoid reliance on package 'vcfR'

### rehh 3.1.1 (June 19, 2020)

Expand Down
14 changes: 6 additions & 8 deletions R/as.newick.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,26 +40,24 @@ as.newick <-
}
if (!is.null(hap.names)) {
if (length(hap.names) != furcation@nhap) {
stop(
"Number of specified haplotype names must match the number of haplotypes.",
call. = FALSE
)
stop("Number of specified haplotype names must match the number of haplotypes.",
call. = FALSE)
}
} else{
hap.names <- seq_len(furcation@nhap)
}

##calculations
if (side == "left") {
ftree <- furcation[[allele]]@left
} else{
ftree <- furcation[[allele]]@right
}

## usage of temporary file is a work-around for
## C string streams are missing under Windows
tmp_file_name <- tempfile()

#calculation and output done by C
if (.Call(
"CALL_ASNEWICK",
Expand All @@ -76,7 +74,7 @@ as.newick <-
} else{
stop("Could not write to a temporary file.", call. = FALSE)
}

unlink(tmp_file_name)
return(newick)
}
15 changes: 9 additions & 6 deletions R/calc_candidate_regions.R
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ calc_candidate_regions <- function(scan,

# perform calculation
## remove NA
scan <- scan[!is.na(scan[[score_column_nr]]), ]
scan <- scan[!is.na(scan[[score_column_nr]]),]

if (ignore_sign) {
score <- abs(scan[[score_column_nr]])
Expand Down Expand Up @@ -148,9 +148,12 @@ calc_candidate_regions <- function(scan,
}

for (offset in offsets) {
breaks <- seq(offset,
max(chr_pos) + window_size - 1,
window_size)
breaks <- seq(
floor(min(chr_pos) / window_size) * window_size + offset,
max(chr_pos) + window_size - 1,
window_size
)

windows <- cut(chr_pos,
breaks = breaks,
right = right,
Expand Down Expand Up @@ -213,7 +216,7 @@ calc_candidate_regions <- function(scan,

if (nrow(chr_cand_reg) > 1) {
# sort different offset windows by position
chr_cand_reg <- chr_cand_reg[order(chr_cand_reg[[2]]), ]
chr_cand_reg <- chr_cand_reg[order(chr_cand_reg[[2]]),]

# join neighboring windows
if (join_neighbors) {
Expand Down Expand Up @@ -246,7 +249,7 @@ calc_candidate_regions <- function(scan,
threshold])
#e liminate all right neighbors
chr_cand_reg <- chr_cand_reg[-((i + 1):(i +
j)), ]
j)),]
}
i <- i + 1
}
Expand Down
5 changes: 3 additions & 2 deletions R/calc_ehh.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@
#'}
#'@references Gautier, M. and Naves, M. (2011). Footprints of selection in the ancestral admixture of a New World Creole cattle breed. \emph{Molecular Ecology}, \strong{20}, 3128-3143.
#'
#'Klassmann, A. et al. (2020). Detecting selection using Extended Haplotype
#'Homozygosity (EHH)-based statistics on unphased or unpolarized data. (submitted).
#'Klassmann, A. and Gautier, M. (2020). Detecting selection using Extended Haplotype
#'Homozygosity-based statistics on unphased or unpolarized data (preprint).
#'https://doi.org/10.22541/au.160405572.29972398/v1
#'
#'Sabeti, P.C. et al. (2002). Detecting recent positive selection in the human genome from haplotype structure. \emph{Nature}, \strong{419}, 832-837.
#'
Expand Down
5 changes: 3 additions & 2 deletions R/calc_ehhs.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@
#'}
#'@references Gautier, M. and Naves, M. (2011). Footprints of selection in the ancestral admixture of a New World Creole cattle breed. \emph{Molecular Ecology}, \strong{20}, 3128-3143.
#'
#'Klassmann, A. et al. (2020). Detecting selection using Extended Haplotype
#'Homozygosity (EHH)-based statistics on unphased or unpolarized data. (submitted).
#'Klassmann, A. and Gautier, M. (2020). Detecting selection using Extended Haplotype
#'Homozygosity-based statistics on unphased or unpolarized data (preprint).
#'https://doi.org/10.22541/au.160405572.29972398/v1
#'
#'Sabeti, P.C. et al. (2002). Detecting recent positive selection in the human genome from haplotype structure. \emph{Nature}, \strong{419}, 832-837.
#'
Expand Down
Loading

0 comments on commit ee09faf

Please sign in to comment.