fastStructure distruct.py issues

325 views
Skip to first unread message

Craig Anderson

unread,
Sep 5, 2014, 4:55:10 AM9/5/14
to structure...@googlegroups.com
Heya,

#I'm having a few problems with FS and I would be extremely grateful if someone could point me in the right direction. Initially, I've implemented gsl-1.9 and the python dependencies via Anaconda, for which I've updated Numpy to 1.8.2. If I try to run distruct.py on analyses derived from plink data that implement larger K values, I achieve this error:

file with population labels is not provided or does not exist ....
creating population labels based on inferred admixture proportions
Traceback (most recent call last):
  File "distruct.py", line 166, in <module>
    figure = plot_admixture(admixture, population_indices, population_labels, title)
  File "distruct.py", line 50, in plot_admixture
    vline_pos = (indices.max()+1)*indiv_width
  File "/home/and48y/anaconda/lib/python2.7/site-packages/numpy/core/_methods.py", line 17, in _amax
    out=out, keepdims=keepdims)
ValueError: zero-size array to reduction operation maximum which has no identity

#Omitting lines 48 to 54 allows me to plot the figure, but without labels. I've attempted to attach a popfile achieved from averaging out the the .meanQ file (below),
1: 0.00003 0.00003 0.52771 0.22221 0.00003 0.24999 36
2: 0.00004 0.00004 0.38091 0.38089 0.00004 0.23808 21
3: 0.00003 0.00003 0.47996 0.31997 0.00003 0.19999 25
4: 0.00003 0.00003 0.51607 0.25805 0.00003 0.22579 31
5: 0.00003 0.99985 0.00003 0.00003 0.00003 0.00003 21
6: 0.00004 0.99981 0.00004 0.00004 0.00004 0.00004 15
8: 0.00003 0.00003 0.30389 0.20587 0.00003 0.49014 102
9: 0.00004 0.98294 0.00004 0.01689 0.00004 0.00004 26

#but i am told:

python distruct.py -K 6 --input=/path/to/file/plink.lin --output=/path/to/file/link6 --popfile=/path/to/file/pop
Incorrect options passed

Here is how you can use this script.....

# Sorry to be a pain, but if anyone is more Python savvy than I, or just has the answers, I'd greatly appreciate and advice you can offer.

Craig

P.S. The test data runs fine through structure.py and has the same problem with distruct.py when I run it under K=8, but not K=3.
Reply all
Reply to author
Forward
0 new messages