Skip to main content

TruSD co-infers selection coefficients and genetic drift from allele trajectories using a maximum-likelihood framework.

Project description

TruSD

Trajectories under Selection and Drift is an implementation of a method that co-infers selection coefficients and genetic drift from allele trajectories using a maximum-likelihood framework.

If you find the software useful in your research please cite this package.

Installation

TruSD needs Python 3.6 or newer. Python 2 is not supported!

Currently, the best way to install TruSD is to use a virtual environment and install TruSD from source.

To setup a virtual environment, go to some folder where you want to have your virtual environment. This could be your home folder. The following command will create the virtual environment in the folder trusd_env. You can call the environment something else, but then you have to adapt the name also in the examples further below.

python3 -m venv trusd_env

This will take some seconds. If you do not have venv installed, you can install it running apt-get install python3-venv. After creating the virtual environment, you can activate it:

source trusd_env/bin/activate

Your command line prompt should change to reflect the activated environment. Now, you can install TruSD into that environment. You can also install other packages that you might think are useful for your work. Make sure that pip is uprade to the latest version (first line in the following).

pip3 install --upgrade pip
git clone https://github.com/mathiasbockwoldt/TruSD.git
cd TruSD
pip3 install -e .

If you want to leave the environment again, run deactivate.

You should now have a folder structure like this:

├── trusd_env
│   ├── bin
│   │   └── activate
│   └── [other files of your virtual environment]
└── TruSD
    ├── min_working_example.py
    └── [other files of TruSD]

Update

If you later want to update TruSD, go to the TruSD folder (not the trusd_env folder) and run:

git pull

Running TruSD

If you installed TruSD in a virtual environment, you have to activate it, before you can run TruSD. The command line prompt should show you, whether it is active.

source trusd_env/bin/activate

Please note, that you are not in the right path, you will have to give a full absolute or relative path:

source /path/to/trusd_env/bin/activate
# or, e.g., if you are in the TruSD folder:
# source ../trusd_env/bin/activate

Now you should be able to run TruSD and, for example, get some help.

trusd --help

You can also import the trusd module from your Python 3 script:

# inside python3 script or interactive prompt
import trusd
help(trusd.trusd) # gives package content

You can start an example run with

python3 min_working_example.py

The min_working_example.py is documented to explain the basic steps. It uses traj_example.txt as input and produces outfile.txt (the results), outfile.json (the metadata) and outfile.pdf (the plot).

To get out of the virtual environment, run deactivate in your shell.

If you want to run TruSD from a virtual environment on a cluster, please make the step source /path/to/trusd_env/bin/activate part of your job script.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

TruSD-0.0.1.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

TruSD-0.0.1-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

Details for the file TruSD-0.0.1.tar.gz.

File metadata

  • Download URL: TruSD-0.0.1.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.10

File hashes

Hashes for TruSD-0.0.1.tar.gz
Algorithm Hash digest
SHA256 3c309aa37d93b79bd0440f3f10bcc629ad64f2bfdcedbf267ebd44b1451b5bc7
MD5 c655058848eb1322c18b56a24097db8f
BLAKE2b-256 433d04af4cdd5e02906f2627d8b8fcff35dedf23d936e50e429792a201ae1340

See more details on using hashes here.

File details

Details for the file TruSD-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: TruSD-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 13.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.10

File hashes

Hashes for TruSD-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6e33898f9ac190df44df7fbb02e51a8cc03d9bdb0b0713bcbdd971b3a2eefd6c
MD5 5050355427625d7494222d85a5af84a7
BLAKE2b-256 bf820598629ebf44a4c00e7c475602c53630dcea0629bad9feacc3d97064da12

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page