green-striped-gecko / PopGenReport

a simple way to analyse population genetic data using R
5 stars 5 forks source link

Incorrect number of arguments (6), expecting 5 for 'C_stri_sub_replacement'** #2

Open kzukowski opened 8 years ago

kzukowski commented 8 years ago

Hello,

I have problem with analysis... I used scripts prepared for older version (>>1 year) and for this version this script works... for current no :/

library("PopGenReport") Loading required package: knitr Loading required package: adegenet Loading required package: ade4

/// adegenet 2.0.2 is loaded ////////////

overview: '?adegenet' tutorials/doc/questions: 'adegenetWeb()' bug reports/feature requests: adegenetIssues()

Loading required package: raster Loading required package: sp

platy <- read.genetable(file.choose(), ind=1, pop=2, lat=3, long=4, x = NULL, y = NULL, other.min=NULL, other.max=NULL, oneColPerAll=FALSE, sep="/", ncode = NULL, ploidy=2) head(platy) /// GENIND OBJECT /////////

// 1 individual; 9 loci; 179 alleles; size: 28.6 Kb

// Basic content @tab: 1 x 179 matrix of allele counts @loc.n.all: number of alleles per locus (range: 6-44) @loc.fac: locus factor for the 179 columns of @tab @all.names: list of allele names for each locus @ploidy: ploidy of each individual (range: 2-2) @type: codom @call: .local(x = x, i = i, j = j, drop = drop)

// Optional content @pop: population of each individual (group size range: 1-1) @other: a list containing: latlong

> platy@ind.names #check the number and names of individuals Error: no slot of name "ind.names" for this object of class "genind"

pop(platy) #similar to platy.gen@pop [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 [65] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 Levels: 1 2 > platy@loc.names #names of all loci Error: no slot of name "loc.names" for this object of class "genind" platy@loc.fac #the number of allels per loci. e.g. the first locus has 4 alleles [1] L14 L14 L14 L14 L14 L14 L14 L14 L14 L14 L14 L14 L14 L14 L14 L14 L33 L33 L33 L33 L33 L33 L33 L33 L33 L33 L33 L33 L33 L33 L33 L33 [33] L33 L33 L33 L33 L33 L33 L33 L33 L33 L33 L33 L33 L33 L33 L45 L45 L45 L45 L45 L45 L45 L45 L45 L45 L62 L62 L62 L62 L62 L62 L62 L62 [65] L62 L62 L62 L62 L62 L62 L62 L62 L62 L62 L62 L62 L62 L62 L62 L68 L68 L68 L68 L68 L68 L68 L68 L68 L68 L68 L68 L68 L68 L68 L9 L9 [97] L9 L9 L9 L9 L9 L9 L9 L9 L9 L9 L9 L9 L9 L9 L9 L9 L9 L9 L9 L9 L9 L9 L9 L9 L9 L9 L9 L9 L9 L9 L9 L9 [129] L9 L9 L9 L9 L9 L9 L9 L9 L9 L9 L92 L92 L92 L92 L92 L92 L92 L97 L97 L97 L97 L97 L97 L97 L97 L97 L97 L97 L97 L97 L97 L97 [161] L97 L97 L97 L97 L97 L97 L97 L97 L97 L97 L97 L97 L97 L99 L99 L99 L99 L99 L99 Levels: L14 L33 L45 L62 L68 L9 L92 L97 L99 table(platy@loc.fac) # a better way to check the number of alleles per loci

L14 L33 L45 L62 L68 L9 L92 L97 L99 16 30 10 23 15 44 7 28 6

the main problem is that there is no generation of report

str(platy@other) List of 1 $ latlong:'data.frame': 92 obs. of 2 variables: ..$ lat : num [1:92] 49.2 49.2 49.2 51.1 54.4 ... ..$ long: num [1:92] 22.4 22.4 22.4 17.1 18 ... plot(platy@other$latlong) **> platy.out1 <- popgenreport(platy, mk.counts=TRUE, mk.pdf=TRUE, foldername="sa_pop2", path.pgr="C:/Users/kacper.zukowski/Dropbox/KS-KZ/PopGenReport") Compiling report...

  • General summary... Analysing data ... Quitting from lines 113-119 (PopGenReport.rnw) Error in .Call(C_stri_sub_replacement, str, from, to, NULL, omit_na, value) : Incorrect number of arguments (6), expecting 5 for 'C_stri_sub_replacement'**

Thank you in advance for your help. With kind regards, Kacper

sessionInfo() R version 3.2.5 (2016-04-14) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 7 x64 (build 7601) Service Pack 1

locale: [1] LC_COLLATE=English_United Kingdom.1252 LC_CTYPE=English_United Kingdom.1252 LC_MONETARY=English_United Kingdom.1252 [4] LC_NUMERIC=C LC_TIME=English_United Kingdom.1252

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] reshape2_1.4.1.9000 data.table_1.9.7 hierfstat_0.04-25 GGally_1.0.1 ggplot2_2.1.0 vegan_2.3-5
[7] permute_0.9-0 gdistance_1.1-9 Matrix_1.2-4 igraph_1.0.1 reshape_0.8.5 R.utils_2.3.0
[13] R.oo_1.20.0 R.methodsS3_1.7.1 dismo_1.0-15 mmod_1.3.1 plyr_1.8.3 xtable_1.8-2
[19] calibrate_1.7.2 lattice_0.20-33 gap_1.1-16 genetics_1.3.8.1 mvtnorm_1.0-5 MASS_7.3-45
[25] gtools_3.5.0 gdata_2.17.0 combinat_0.0-8 pegas_0.9 ape_3.4 RgoogleMaps_1.2.0.7 [31] PopGenReport_2.2.1 raster_2.5-2 sp_1.2-3 adegenet_2.0.2 ade4_1.7-4 knitr_1.12.3

loaded via a namespace (and not attached): [1] Rcpp_0.12.4 deldir_0.1-12 png_0.1-7 assertthat_0.1 digest_0.6.9 mime_0.4
[7] R6_2.1.2 chron_2.3-47 evaluate_0.8.3 coda_0.18-1 spdep_0.6-4 gmodels_2.16.2
[13] splines_3.2.5 rgdal_1.1-8 stringr_1.0.0.9000 munsell_0.4.3 shiny_0.13.2 httpuv_1.3.3
[19] mgcv_1.8-12 htmltools_0.3.5 dplyr_0.4.3.9000 grid_3.2.5 nlme_3.1-125 gtable_0.2.0
[25] DBI_0.3.1 magrittr_1.5 formatR_1.3 scales_0.4.0 stringi_1.0-3 LearnBayes_2.15
[31] seqinr_3.1-3 boot_1.3-18 tools_3.2.5 RJSONIO_1.3-0 parallel_3.2.5 colorspace_1.2-6
[37] cluster_2.0.3

aaron-adamack commented 8 years ago

Hi Kacper, have you installed the new version of the package that is available through github? From what you've posted, it sounds like you are running the old version of PopGenReport with the new version of adegenet. There was a substantial update to adegenet which broke several things in PopGenReport. If you update to the github version of PopGenReport I think it should solve this problem. -Aaron

kzukowski commented 8 years ago

Hi Aaron,

It works right now... but now i reinstall whole environment, not only PopGenReport from GitHub + some other packages like:

devtools::install_github("hadley/lazyeval", force=TRUE) devtools::install_github("hadley/dplyr", force=TRUE) devtools::install_github("hadley/stringr", force=TRUE) devtools::install_github('Rexamine/stringi', force=TRUE) devtools::install_github("hadley/ggplot2", force=TRUE) devtools::install_github("Rdatatable/data.table", build_vignettes = FALSE, force=TRUE)

devtools::install_github("thibautjombart/adegenet", force=TRUE) devtools::install_github("jgx65/hierfstat", force=TRUE) devtools::install_github("green-striped-gecko/PopGenReport", force=TRUE)

Thank you for your help, With kind regards, Kacper

green-striped-gecko commented 8 years ago

Great to hear that it works.

I assume that the indnames and locnames example code from the tutuorial still does not work (in the new adegenet package the slots are accessed differently and I need to update the tutorial).

To get indnames you need to use

indNames(platy)

and

popNames(platy)

for population names…

Cheers, Bernd

From: Kacper Żukowski [mailto:notifications@github.com] Sent: Wednesday, 27 April 2016 22:13 To: green-striped-gecko/PopGenReport Subject: Re: [green-striped-gecko/PopGenReport] Incorrect number of arguments (6), expecting 5 for 'C_stri_sub_replacement'\ (#2)

Hi Aaron,

It works right now... but now i reinstall whole environment, not only PopGenReport from GitHub + some other packages like:

devtools::install_github("hadley/lazyeval", force=TRUE) devtools::install_github("hadley/dplyr", force=TRUE) devtools::install_github("hadley/stringr", force=TRUE) devtools::install_github('Rexamine/stringi', force=TRUE) devtools::install_github("hadley/ggplot2", force=TRUE) devtools::install_github("Rdatatable/data.table", build_vignettes = FALSE, force=TRUE)

devtools::install_github("thibautjombart/adegenet", force=TRUE) devtools::install_github("jgx65/hierfstat", force=TRUE) devtools::install_github("green-striped-gecko/PopGenReport", force=TRUE)

Thank you for your help, With kind regards, Kacper

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHubhttps://github.com/green-striped-gecko/PopGenReport/issues/2#issuecomment-215063635