Skip to content
Introduce point mutations (SNPs) in FASTA at specified frequency
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
LICENSE
Pipfile
Pipfile.lock
README.md
snpr.py
test.fa
test_wrapped.fa

README.md

SNPr

Introduce point mutations (SNPs) in FASTA at specified frequency.

Running SNPr

  1. Clone the repo and go inside

  2. Install all required packages from Pipfile

$ pipenv install
  1. Activate the Pipenv shell
$ pipenv shell
  1. You are now ready to use snpr

Check out the help menu.

$ python snpr.py --help
Usage: snpr.py [OPTIONS] FASTA

  Given a FASTA file, introduce SNPs at the specified frequency.

Options:
  -f, --snp_freq FLOAT       Mutation (SNP) frequency. Default: 0.01 (1%)
  -r, --random_seed INTEGER  Seed for pseudo-random runs. Default: None
  --version                  Show the version and exit.
  --help                     Show this message and exit.

Example command to introduce 1% of SNPs in the supplied test FASTA files. Using the optional random seed argument makes the run pseudo-random, for reproducible output.

$ cat test.fa
>chrA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAA
>chrT
TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
TTTTTTTTTTTTTTTTTTTT
>chrC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCC

$ python snpr.py -f 0.01 -r 111 test.fa
>chrA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAA
>chrT
TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTATTTTTTTTTTTTTTTTTTTATTTTTTTTTTTTTTTTTTTTT
TTTTTTTTTTTTTTTTTTTT
>chrC
CCCCCCCCCCACCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCC

$ python snpr.py -f 0.01 -r 111 test_wrapped.fa
>chrA
AAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAA
>chrT
TTTTTTTTTTTTTTTTTTTTTTTTT
TTTTTTTTTTTTTATTTTTTTTTTT
TTTTTTTTATTTTTTTTTTTTTTTT
TTTTTTTTTTTTTTTTTTTTTTTTT
>chrC
CCCCCCCCCCACCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCC

License

This project is licensed under the terms of the MIT license. See LICENSE file for details.

You can’t perform that action at this time.