Mycorrhiza population assignment tools.
Project description
Mycorrhiza
Combining phylogenetic networks and Random Forests for prediction of ancestry from multilocus genotype data.
Installing Mycorrhiza on Ubuntu 16.04
-
Make sure you have the latest version of Python 3.x
python3 --version
-
Install pip3, Java and the tkinter library
sudo apt-get install python3-pip python3-tk default-jre
-
Install Mycorrhiza
pip3 install --upgrade mycorrhiza
-
Install SplitsTree
wget http://ab.inf.uni-tuebingen.de/data/software/splitstree4/download/splitstree4_unix_4_14_6.sh chmod +x splitstree4_unix_4_14_6.sh ./splitstree4_unix_4_14_6.sh
Follow the instructions in the GUI installer, leaving all settings to default.
Installing Mycorrhiza on Mac OS X Sierra 10.12
-
If you don't already have the package manager HomeBrew, install it before proceeding.
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
-
Install Python 3.x
brew install python
-
Install Mycorrhiza
sudo -H pip3 install --upgrade mycorrhiza
-
Install SplitsTree
The package can be found here. Follow the installer instructions, leaving all settings to default.
Running an analysis from command line
-
Run an analysis.
crossvalidate -i gipsy.myc -o out/
To see all available parameters:
crossvalidate -h
Running an analysis in a script
-
Import the necessary modules.
from mycorrhiza.dataset import Myco from mycorrhiza.analysis import CrossValidate from mycorrhiza.plotting.plotting import mixture_plot
-
(Optional) By default Mycorrhiza will look for SplitStree in your home folder. I you wish to specify a different path for the SplitsTree executable you can do so in the settings module.
from mycorrhiza.settings import const const['__SPLITSTREE_PATH__'] = '~/splitstree4/SplitsTree'
-
Load some data. Here data is loaded in the Mycorrhiza format from the Gipsy moth sample data file. Example data can be found here.
myco = Myco(file_path='data/gipsy.myc') myco.load()
-
Run an analysis. Here a simple 5-fold cross-validation analysis is executed on all available loci, without partitioning.
cv = CrossValidate(dataset=myco, out_path='data/') cv.run(n_partitions=1, n_loci=0, n_splits=5, n_estimators=60, n_cores=1)
-
Plot the results.
mixture_plot(cv)
Documentation
https://jgeofil.github.io/mycorrhiza/
File formats
Myco
Diploid genotypes occupy 2 rows (the sample identifier must be identical).
Column(s) | Content | Type |
---|---|---|
1 | Sample identifier | string |
2 | Population | string or integer |
3 | Learning flag | {0,1} |
4 to M+3 | Loci | {A, T, G, C, N} |
STRUCTURE
Diploid genotypes occupy 2 rows (the sample identifier must be identical).
Column(s) | Content | Type |
---|---|---|
1 | Sample identifier | string |
2 | Population | integer |
3 | Learning flag | {0,1} |
4 to O+3 | Optional (Ignored) | |
O+3 to M+O+3 | Loci | integer or -9 |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for mycorrhiza-0.0.22-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd631b7a86fd4f87fce827fbcde3377bb9bdd2e6fb3f4f38d4afbd9c2a14bb1b |
|
MD5 | 95570faf1130768b0763fe5b4a9a0273 |
|
BLAKE2b-256 | 46ceb682bd15a3ad7386dc70bacee4262c9742bb28207039bc10d0a75e875bd9 |