Amplicon read simualtor
Project description
Bygul: Amplicon / Metagenomics Read Simulator
A tool for Amplicon/Metagenomics read simulation for waste water sequencing or other aplications. Users can easily simulate reads from mutiple samples with different proportions using the tool.
Usage
If you use this workflow in a paper, don't forget to give credits to the authors by citing the URL of this (original) https://github.com/andersen-lab/Bygul repository.
Installation
Bygul is written in python 3 but it requires wgsim and mason simulator to simulate reads.
Local build from source
git clone https://github.com/andersen-lab/Bygul
cd Bygul
pip install -e .
Please note that pip does not install all the requirements, some packages need to be installed via Conda or be built from source.
Installing via Conda
conda create -n bygul bioconda::bygul
Installing via Pypi
pip install bygul
Please note that some dependencies are not available through pypi. You need to install them using conda or build from source.
Amplicon sequencing mode
Example commands
Run the tool using the following command.
bygul simulate-proportions [SAMPLE1.fasta,SAMPLE2.fasta,..] --primers [primer.bed] --reference [reference.fasta] --proportions [0.8,0.2,..] --outdir [output_directory]
Simulate reads from different samples without defining proportions (will be assigned randomly, proportions can be found in results/sample_proportions.txt) and allowing upto 2 SNPs mistmatches in the primer regions.
bygul simulate-proportions sample.fasta,sample2.fasta --primers primer.bed --reference reference.fasta --outdir results/ --maxmismatch 2
Simulate reads with user-defined proportions and specifing read simulator. bygul uses wgsim as a simulator but you can change it to mason.
bygul simulate-proportions sample.fasta,sample2.fasta --primers primer.bed --reference reference.fasta --proportions 0.2,0.8 --simulator mason
Simulate reads with user-defined proportions and number of reads per amplicon.
bygul simulate-proportions sample.fasta,sample2.fasta --primers primer.bed --reference reference.fasta --proportions 0.2,0.8 --readcnt 1000
Simulate reads with additional parameters such as base error rate, read length and indels fraction
bygul simulate-proportions sample.fasta,sample2.fasta --primers primer.bed --reference reference.fasta --proportions 0.2,0.8 --readcnt 1000 -e 0.001 -1 400 -2 400 -R 0.01
Notes
Number of reads per amplicon
It is recommended to define the number of reads per amplicon to be greater than the number of contigs in your amplicon file. This is particularly important when your primers are designed for whole genome sequencing, where each amplicon may contain a substantial number of contigs. Setting too few reads per amplicon may result in empty read files for certain amplicons, leading to incomplete simulated reads.
Primer bed file
Please remember that the primer file must contain a column containing primer sequence. The maximum number of mismatches allowed for each primer sequence is 1 SNP. To change this number, you may use the --maxmismatches flag.
Complete set of available parameters
To learn more about how to adjust other parameters for the simulator please read the documentation for wgsim and mason simulator. Users can pass any simulator parameter directly in their command. The only parameters set through bygul are --readcnt and --wgsim_insert_size for amplicon sequencing mode.
Simulated reads output
Simulated reads from all samples are located in provided_output_path/reads.fastq
Information about amplicon dropouts
In order to find more about amplicon dropouts, please refer to provided_output_path/sample_name/amplicon_stats.csv file. Please note that primer_seq_x and primer_seq_y define the left and right primer sequence whereas left_mismatch_map and right_mismatch_map shows the actual sequence found in the sample for a better comparison of mismatching bases in the primer sequence. Additionally, if there are any ambiguous bases present in the matching sequence, the ambiguous_bases value returns true.
Metagenomics mode
Users can now simulate reads from different samples in a metagenomics setting without specifying a primer bed file. Providing a reference sequence is not required for this setting.
Example commands
Simulate reads from different samples without defining proportions (will be assigned randomly, proportions can be found in results/sample_proportions.txt).
bygul simulate-proportions sample.fasta,sample2.fasta --outdir results/ --simulation_mode metagenomics
Specify proportions for each sample and add other simulator specific parameters. To access simulator parameters, please read wgsim and mason documentation.
bygul simulate-proportions sample.fasta,sample2.fasta --proportions 0.5,0.5 --outdir results/ --simulation_mode metagenomics --simulator mason --illumina-read-length 200
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 Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bygul-3.0.0.tar.gz.
File metadata
- Download URL: bygul-3.0.0.tar.gz
- Upload date:
- Size: 13.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
889f5df1d39b35f6761fe0eff43280c42c524079c049a178452b35e8a8c15c31
|
|
| MD5 |
bb2b4f368aa8a2259364d4a3299fe25a
|
|
| BLAKE2b-256 |
8459e92c2f57018850564abb1ce1ca8a3270d0af38550107c45bd1ab22c8d6ba
|
Provenance
The following attestation bundles were made for bygul-3.0.0.tar.gz:
Publisher:
github_actions.yml on andersen-lab/Bygul
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bygul-3.0.0.tar.gz -
Subject digest:
889f5df1d39b35f6761fe0eff43280c42c524079c049a178452b35e8a8c15c31 - Sigstore transparency entry: 1265432771
- Sigstore integration time:
-
Permalink:
andersen-lab/Bygul@4799e085f2227434f2b9bcba19ad3d2f52477373 -
Branch / Tag:
refs/tags/V3.0.0 - Owner: https://github.com/andersen-lab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
github_actions.yml@4799e085f2227434f2b9bcba19ad3d2f52477373 -
Trigger Event:
release
-
Statement type:
File details
Details for the file bygul-3.0.0-py3-none-any.whl.
File metadata
- Download URL: bygul-3.0.0-py3-none-any.whl
- Upload date:
- Size: 12.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
80a8fe51bad5485cb9bd6a62b3b2d4d3ce79123554b1696b6e8a4c3a97246475
|
|
| MD5 |
f16030bf1caa78874e1688040ec36497
|
|
| BLAKE2b-256 |
8c8616cfff24fb41e4ba2056e70e9da9ba90e3f23f0de333a690aec887690d64
|
Provenance
The following attestation bundles were made for bygul-3.0.0-py3-none-any.whl:
Publisher:
github_actions.yml on andersen-lab/Bygul
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bygul-3.0.0-py3-none-any.whl -
Subject digest:
80a8fe51bad5485cb9bd6a62b3b2d4d3ce79123554b1696b6e8a4c3a97246475 - Sigstore transparency entry: 1265432948
- Sigstore integration time:
-
Permalink:
andersen-lab/Bygul@4799e085f2227434f2b9bcba19ad3d2f52477373 -
Branch / Tag:
refs/tags/V3.0.0 - Owner: https://github.com/andersen-lab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
github_actions.yml@4799e085f2227434f2b9bcba19ad3d2f52477373 -
Trigger Event:
release
-
Statement type: