Victor Garcia
2011-Jul-22 16:43 UTC
[R] pegas package: Problem using nuc.div and tajima d -> error with dist.dna() -> character variables must be duplicated in .C/.Fortran
Hi,
For the last few days I have tried utilise your package "pegas" in
order
to obtain some values for indices like the nuclear diversity and tajimas
d value.
I have modified my dataset (a text file containing dna sequences) in
order to be able to read it in with the tools provided by pegas. Here, I
have oriented myself on the description provided by the help-page in
read.loci(). A piece from the dataset is displayed further below. Here
my code:
/Code/
library("ape")
library("adegenet")
library("pegas")
/
load with no problem.
/
/the command: /
> data.loci <- read.loci(file
="/Users/victor/Documents/SIV_Compartment/data/pegas_data_seq.txt",
header = TRUE,
col.loci = seq(1,200),
col.pop = TRUE)
/seems to work./
/in fact:/
> data.loci
Allelic data frame: 68563 individuals
200 loci
5 additional variables
/but as soon as I try to calculate a certain index with the
corresponding function out of pegas package, like nuc.div, tajima.test,
or R2, I get the following error:
/
> nuc.div(data.loci[1:100,])
Error in dist.dna(x, "raw", pairwise.deletion = pairwise.deletion) :
character variables must be duplicated in .C/.Fortran
/Also:
/> nuc.div(data.loci[1:100, 1:200])
Error in dist.dna(x, "raw", pairwise.deletion = pairwise.deletion) :
character variables must be duplicated in .C/.Fortran
*
*/Nevertheless, the examples with the adegenet dataset "woodmouse" all
work fine. I.e., using these functions on woodmouse does not lead to the
errors. /
*
/What might be the problem causing the error message?/*/
Thank you very much.
if it is of any help: I use Mac OS X, Version 10.6.8. ; R version 2.11.1
(2010-05-31)/
*This is an example of the header and the first two lines of the data
file I am trying to use*:
"1" "2" "3" "4" "5"
"6" "7" "8" "9" "10"
"11" "12" "13" "14" "15"
"16"
"17" "18" "19" "20" "21"
"22" "23" "24" "25" "26"
"27" "28" "29" "30"
"31" "32" "33" "34" "35"
"36" "37" "38" "39" "40"
"41" "42" "43" "44"
"45" "46" "47" "48" "49"
"50" "51" "52" "53" "54"
"55" "56" "57" "58"
"59" "60" "61" "62" "63"
"64" "65" "66" "67" "68"
"69" "70" "71" "72"
"73" "74" "75" "76" "77"
"78" "79" "80" "81" "82"
"83" "84" "85" "86"
"87" "88" "89" "90" "91"
"92" "93" "94" "95" "96"
"97" "98" "99" "100"
"101" "102" "103" "104" "105"
"106" "107" "108" "109" "110"
"111" "112"
"113" "114" "115" "116" "117"
"118" "119" "120" "121" "122"
"123" "124"
"125" "126" "127" "128" "129"
"130" "131" "132" "133" "134"
"135" "136"
"137" "138" "139" "140" "141"
"142" "143" "144" "145" "146"
"147" "148"
"149" "150" "151" "152" "153"
"154" "155" "156" "157" "158"
"159" "160"
"161" "162" "163" "164" "165"
"166" "167" "168" "169" "170"
"171" "172"
"173" "174" "175" "176" "177"
"178" "179" "180" "181" "182"
"183" "184"
"185" "186" "187" "188" "189"
"190" "191" "192" "193" "194"
"195" "196"
"197" "198" "199" "200"
"population" "animal" "tissue" "day"
"frequency"
"1" "C" "A" "C" "T"
"T" "G" "G" "T" "A"
"A" "T" "C" "A" "T"
"A" "T" "C"
"T" "A" "T" "A" "A"
"T" "A" "G" "A" "C"
"A" "T" "G" "G" "A"
"G" "A" "C"
"A" "C" "C" "C" "T"
"T" "G" "A" "G" "G"
"G" "A" "G" "C" "A"
"G" "G" "A"
"G" "A" "A" "C" "T"
"C" "A" "T" "T" "A"
"G" "A" "A" "T" "C"
"C" "T" "C"
"C" "A" "A" "C" "G"
"A" "G" "C" "G" "C"
"T" "C" "T" "T" "C"
"A" "T" "G"
"C" "A" "T" "T" "T"
"C" "A" "G" "A" "G"
"G" "C" "G" "G" "A"
"T" "G" "C"
"A" "T" "C" "C" "A"
"C" "T" "C" "C" "A"
"G" "A" "A" "T" "C"
"G" "G" "C"
"C" "A" "A" "C" "C"
"T" "G" "G" "G" "G"
"G" "A" "G" "G" "A"
"A" "A" "T"
"C" "C" "T" "C" "T"
"C" "T" "C" "A" "G"
"C" "T" "A" "T" "A"
"C" "C" "G"
"C" "C" "C" "T" "C"
"T" "A" "G" "A" "A"
"G" "C" "A" "T" "G"
"C" "T" "A"
"T" "A" "A" "C" "A"
"C" "A" "T" "G" "C"
"T" "A" "T" "T" "G"
"T" "A" "A"
"A" "A" "A" 1 "RDo8" "LN" 7 1
"2" "C" "A" "C" "T"
"T" "G" "G" "T" "A"
"A" "T" "C" "A" "T"
"A" "T" "C"
"T" "A" "T" "A" "A"
"T" "A" "G" "A" "C"
"A" "T" "G" "G" "A"
"G" "A" "C"
"A" "C" "C" "C" "T"
"T" "G" "A" "G" "G"
"G" "A" "G" "C" "A"
"G" "G" "A"
"G" "A" "A" "C" "T"
"C" "A" "T" "T" "A"
"G" "A" "A" "T" "C"
"C" "T" "C"
"C" "A" "A" "C" "G"
"A" "G" "C" "G" "C"
"T" "C" "T" "T" "C"
"A" "T" "G"
"C" "A" "T" "T" "T"
"C" "A" "G" "A" "G"
"G" "C" "G" "G" "A"
"T" "G" "C"
"A" "T" "C" "C" "A"
"C" "T" "C" "C" "A"
"G" "A" "A" "T" "C"
"G" "G" "C"
"C" "A" "A" "C" "C"
"T" "G" "G" "G" "G"
"G" "A" "G" "G" "A"
"A" "A" "T"
"C" "C" "T" "C" "T"
"C" "T" "C" "A" "G"
"C" "T" "A" "T" "A"
"C" "C" "G"
"C" "C" "C" "T" "C"
"T" "A" "G" "A" "A"
"G" "C" "A" "T" "G"
"C" "T" "A"
"T" "A" "A" "C" "A"
"C" "A" "T" "G" "C"
"T" "A" "T" "T" "G"
"T" "A" "A"
"A" "A" "A" 2 "RWi8" "RB" 7 1
[[alternative HTML version deleted]]
