Giter Club home page Giter Club logo

structure_threader's Introduction

Structure_threader

A program to parallelize the runs of Structure, fastStructure, MavericK and ALStructure software.

Travis Status Documentation Status DOI Codacy Badge Pipeline Status

Installation

pip3 install structure_threader

Structure_threader is available on Pypi. It can be installed by simply running the above command. If you are on a *nix like platform, you can use the --user option if you can't or don't want to install the program as root user. Binaries for STRUCTURE, fastStructure and MavericK are also distributed for GNU/Linux and Mac OS X. For more details, please check the manual.

Manual

The complete documentation can be found on readthedocs.org.

Citation

If you use Structure_threader, please cite our Zenodo DOI. Molecular Ecology Resources paper

Full citation:

Pina-Martins, F., Silva, D. N., Fino, J., & Paulo, O. S. (2017). Structure_threader: An improved method for automation and parallelization of programs structure, fastStructure and MavericK on multicore CPU systems. Molecular Ecology Resources, n/a-n/a. doi:10.1111/1755-0998.12702

License

GPLv3

structure_threader's People

Contributors

briantrice avatar nymeria8 avatar odiogosilva avatar stuntspt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

structure_threader's Issues

problems running Structure_threader - Structure path problems with "c:\programfiles (x86)\..."

Hello.

I am trying to run Structure_threader to use the multi-core capacity put I am stock on this problem.

I have tried solving the path problem with C:\Program~2\ and "c:\programfiles (x86)..." but neither worked as I still get the same error that Structure cannot be found in the specified path...

Do you have a workaround to this issue?

I would really be happy if I could use your solution has right now I have 7 idle cores...

Thanks!
Pedro

structplot.py fails when "USEPOPINFO" flag in structure is set

Just what the title describes.
To further document the issue, the output files of structure become somewhat different when the mentioned flag is set.

This is what we expect under "normal" circumstances:

Inferred ancestry of individuals:
        Label (%Miss) Pop:  Inferred clusters
  1  Coc_W.1    (0)    1 :  0.033 0.967 
  2 Coc_W.10    (0)    1 :  0.032 0.968 
  3 Coc_W.11    (0)    1 :  0.033 0.967 
  4 Coc_W.16    (0)    1 :  0.033 0.967 
...

And this is what we get when "USEPOPINFO" == 1:

Inferred ancestry of individuals:
Probability of being from assumed population | prob of other pops
        Label (%Miss) Pop
  1 neoNAAri1    (0)    1 :  0.999 | Pop 2: 0.000 0.000 0.001  |  
  2 neoNAAri2    (0)    1 :  1.000 | Pop 2: 0.000 0.000 0.000  |  
  3 neoNAAri3    (0)    1 :  1.000 | Pop 2: 0.000 0.000 0.000  |  
  4 neoNAAri4    (0)    1 :  1.000 | Pop 2: 0.000 0.000 0.000  |  
...

So not only e have to deal with a different number of lines, as we also have to deal with a different organization of the clustering...

Thanks to @JulianBaur for triggering and reporting this.

Problem with "plot prefix"

Currently, when using Structure_theader for plotting, an argument -i is required to set a prefix for the Q-values files.
However, this is actually only a prefix and requires the user to be in the directory where the Q-values files are located, which is less than ideal.
We should fix this to allow passing a full path to the argument.

Running Structure_threader without arguments triggers a crash. We don't want this.

$ structure_threader 
Traceback (most recent call last):
  File "/home/francisco/.local/bin/structure_threader", line 11, in <module>
    load_entry_point('structure-threader==0.4.1', 'console_scripts', 'structure_threader')()
  File "/home/francisco/.local/lib/python3.6/site-packages/structure_threader/structure_threader.py", line 502, in main
    arg = argument_parser(sys.argv[1:])
  File "/home/francisco/.local/lib/python3.6/site-packages/structure_threader/structure_threader.py", line 489, in argument_parser
    if arguments.format == "faststructure" and arguments.popfile is None\
AttributeError: 'Namespace' object has no attribute 'format'

Use logging for terminal output

The logging builtin should be use to output information into the terminal. Some of the advantages would be a standardized way to provide messages to users, control over the verbosity of the logging, custom error messages, etc.

Using a popfile is not woring as expected

Using a popfile will create the divisions as requested, but the bars themselves are not changing places.
The final results is the plot being drawn by the input file order, but the population labels and divisions are being given to the wrong bars.

K=1 is being plotted and Structure_threader throws an error

Traceback (most recent call last):
  File "/home/francisco/Programming/github/Structure_threader/structure_threader/structure_threader.py", line 625, in <module>
    main()
  File "/home/francisco/Programming/github/Structure_threader/structure_threader/structure_threader.py", line 593, in main
    create_plts(arg.outpath, wrapped_prog, Ks, bestk, arg)
  File "/home/francisco/Programming/github/Structure_threader/structure_threader/structure_threader.py", line 257, in create_plts
    indfile=arg.indfile, bw=arg.blacknwhite, use_ind=arg.use_ind)
  File "/home/francisco/Programming/github/Structure_threader/structure_threader/plotter/structplot.py", line 932, in main
    klist.plotk(bestk, outdir)
  File "/home/francisco/Programming/github/Structure_threader/structure_threader/plotter/structplot.py", line 657, in plotk
    print_grid=False)
  File "/home/francisco/.local/lib/python3.6/site-packages/plotly/tools.py", line 776, in make_subplots
    raise Exception("Keyword argument 'rows' "
Exception: Keyword argument 'rows' must be an int greater than 0

Paths compliant with OS separators

When dealing with OS paths, the "/" directory separator should not be hardcoded, since this will not work in Windows. Instead, we should use os.path.join() that will handle OS differences for us.

Got this error today

Traceback (most recent call last):
  File "bin/structure_threader", line 11, in <module>
    sys.exit(main())
  File "/home/qsuber/.local/lib/python3.5/site-packages/structure_threader/structure_threader.py", line 568, in main
    create_plts(arg.outpath, wrapped_prog, Ks, bestk, arg)
UnboundLocalError: local variable 'bestk' referenced before assignment

Need to investigate.

Link when wrapping fastStructure

The link that is created when wrapping fastSturcture is made with the full link path. This will break if the files are moved to another location, or if the analysis is performed inside a container.
Steps need to be taken to ensure the created link simply points to the target file on the same dir, without the full path.

Sort the individuals by population before sorting

If a user provides a structure file that is not sorted by population, the result is a messy plot.
The plot function (or even better, the parser) should sort the individuals by their population value before plotting.

converting plink format to fastStructure format

I'd like to run your tool with a fastStructure wrapper, but my input files are plink formatted. Do you have a method for converting these to fastStructure format? Or does your tool currently work with plink formatted files?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.