Dear All,

I'm new to PopGenome packages and I tried to use it for genetic diversity calculations according to its examples in the manual. However, it produced an error and I don't know how to fix it even after reading the manual. Is there any advice to figure it out or fix it? Thanks. Below is my code and some results:

allgenomes <- PopGenome::readData("scaffoldVCFs",format="VCF")
pop1 <- c("MSub10")
pop2 <- c("S11")
pop3 <- c("S12")
pop4 <- c("S13")
pop11 <- c("S6")
pop12 <- c("mergeSub")
allgenomes_pop <- PopGenome::set.populations(allgenomes, list(pop1,pop2,pop3,pop4,pop5,pop6,pop7,pop8,pop9,pop10,pop11,pop12))
allgenomes_pop_div <- PopGenome::diversity.stats(allgenomes_pop)

The result of get.individuals(allgenomes)[[1]]:
[1] "MSub10" "S11" "S12" "S13" "S18" "S20"
[7] "S29" "S30" "S32" "S38" "S6" "mergeSub"
The result of [email protected]:
[1] "MSub10"

[1] "S11"

[1] "S12"

[1] "S13"

[1] "S18"

[1] "S20"

[1] "S29"

[1] "S30"

[1] "S32"

[1] "S38"

[1] "S6"

[1] "mergeSub"

The error produced by PopGenome::diversity.stats(allgenomes_pop):

Error: $ operator is invalid for atomic vectors

And I used PopGenome::, since there are some package mask warnings, when I load the package PopGenome. Below are warnings:

Loading required package: ff
Loading required package: bit

Attaching package: ‘bit’

The following object is masked from ‘package:base’:


Attaching package ff
- getOption("fftempdir")=="/tmp/RtmpZf0qhS/ff"

  • getOption("ffextension")=="ff"

  • getOption("ffdrop")==TRUE

  • getOption("fffinonexit")==TRUE

  • getOption("ffpagesize")==65536

  • getOption("ffcaching")=="mmnoflush" -- consider "ffeachflush" if your system stalls on large writes

  • getOption("ffbatchbytes")==16777216 -- consider a different value for tuning your system

  • getOption("ffmaxbytes")==536870912 -- consider a different value for tuning your system

Attaching package: ‘ff’

The following objects are masked from ‘package:utils’:

write.csv, write.csv2

The following objects are masked from ‘package:base’:

is.factor, is.ordered

In addition, when I tried to set populations, the cursor just stuck at the 100 % position and didn't return. And I can only type return by myself. Below is the result:

allgenomes_pop <- PopGenome::set.populations(allgenomes, list(pop1,pop2,pop3,pop4,pop5,pop6,pop7,pop8,pop9,pop10,pop11,pop12))
| : | : | 100 %

Source link