jgx65 / hierfstat

the hierfstat package
24 stars 14 forks source link

write.ped() removes first locus from hierfstat object #51

Closed DaniEstevezBarcia closed 2 years ago

DaniEstevezBarcia commented 2 years ago

To whom it may concern. Whenever using something of the sort:

write.ped(hierfstat_object, fname = "path/to/file", pop = pop, ilab = inds)

The first locus is removed from both the map and ped objects.

jgx65 commented 2 years ago

Hi @DaniEstevezBarcia, I've pushed a new version of the write.ped function. if pop!=NULL, the first column of the hierfstat_object should contains genotypes at the first locus; otherwise it should be the population identifier. Let me know if this fixes your problem

DaniEstevezBarcia commented 2 years ago

Thanks, will do

DaniEstevezBarcia commented 2 years ago

It does not. In fact now the map result is completely different:

0 Lloc.fac 0 0 0 Lloc.n.all 0 0 0 Lall.names 0 0 0 Lploidy 0 0 0 Ltype 0 0 0 Lother 0 0 0 Lcall 0 0 0 Lpop 0 0 0 Lstrata 0 0 0 Lhierarchy 0 0

jgx65 commented 2 years ago

Could you share your code pls? (DM if you prefer). I suspect you are using a genind object as argument to write.ped rather than a hierfstat object, could it be so?

DaniEstevezBarcia commented 2 years ago

Ok, I feel stupid. Indeed, the issue was a typo on which I was running it with a genind. It works well now.

Many thanks