EricArcher / strataG

strataG is a toolkit for haploid sequence and multilocus genetic data summaries, and analyses of population structure.
25 stars 12 forks source link

Issues with read.arlequin #24

Closed lchall08 closed 4 years ago

lchall08 commented 4 years ago

Hello, There are a couple of issues with the function read.arlequin. First, it fails to recognize the appropriate DataType even though they are correctly annotated in the input file. The problem lies in the gsub portion of the code where your regular expression is not correctly extracting the DataType (and the title). It is extracting:

data.type [1] " \tDataTypeDNA" instead of data.type [1] "DNA" Just modifying this part I was able to read in the file without any errors until I reach the haploid.mat step where I get the following error: Error in x[i, 3] : subscript out of bounds

Any fixes or suggestions are really appreciated. Thanks

EricArcher commented 4 years ago

You're right about this error. I've been working on a major overhaul of strataG and this is one of the last functions I need to update. Unfortunately, I don't have time to get to it until January. However, the new version of strataG should be out soon after then, in early February. Sorry for the delay.

EricArcher commented 4 years ago

@zomestaph, I've updated the arlequin parsing function in the devel version, now called arlequinRead() and arp2gtypes(). Please feel free to install it and give it a shot: devtools::install_github("ericarcher/stratag", master = "redevel2018")