This is a test version of Biostars. For the public version, visit https://www.biostars.org.
PopGenome readMS error

I have normal output from msms, with headers like this:

//

segsites: 15349

0.55065 0.55081 0.55083 0.55096 0.55112 0.55115 0.55122 0.55126 0.55136 0.55141

But when I attempt to input them into PopGenome using the following command:

x<-readMS(file="file", big.data=FALSE)

I consistently get this error:

Error: length(marker) == ndraws is not TRUE

A google of the error really finds nothing, otherwise I wouldn't ask as I know its rather cryptic. If anyone has an explanation I'd appreciate it.

popgenome r msms

the output as you described seems different from the expected:

//
segsites: 5
positions: 0.0491 0.2443 0.2923 0.5984 0.8312
00001
00000
00010
11110

1 answer

this is because the format of the first line in the simulation output. the number of replicates should be in the third column separated by " ". For example: "ms 10 100 ......" 100 is the number of replicates. Sometimes we you do simulation using msms, the third column may not be the number of the replicates, and thus leads to error.

To solve the problem, you can modify the first line manually, making sure the third column is the number of replicates. you can also do this by using bash sed command!

Log in to answer this question.