Utilities for generation of synthetic NGS files.
A simple showcase:
from ngs_test_utils import testcase
class ExampleTestCase(testcase.NgsTestCase):
"""NGS-test-utils showcase."""
def test_example(self):
"""Make a simple GTf and BAM file."""
self.gtf = self.make_gtf([
dict(feature="gene", start=100, end=500, gene_id="G1"),
dict(feature="exon", start=100, end=200, gene_id="G1"),
dict(feature="exon", start=400, end=500, gene_id="G1"),
])
self.bam = self.make_bam(
chroms=[("chr1", 1000)],
segments=[
dict(qname="r1", pos=150, cigar=[(0, 75)]),
dict(qname="r2", pos=250, cigar=[(0, 150)]),
],
)
# Use these files to run your tests...
In the above example you can see:
Test case class subclasses testcase.NgsTestCase instead of unittest.TestCase. This class brings in all the methods for generating synthetic files.
Methods for generation of files aim to support “Pythonic” construction of NGS files from scratch. Although the methods try to be user-friendly, one needs to be familiar with the structure of the file format.
Method self.make_gtf accepts list of GTF segments. Each of these segments represents a line in a GTF file. Segment is given as a dict of values that represent columns (and attributes) of a line in GTF file.
Method self.make_bam accepts a list of chromosomes (this is ingredient for BAM header) and list of segments (for BAM body).
Release files for ngs-test-utils 0.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ngs_test_utils-0.0.6.tar.gz | 15.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ngs_test_utils-0.0.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 29.1 kB
Release files / ngs_test_utils-0.0.6.tar.gz
| Download URL | ngs_test_utils-0.0.6.tar.gz |
|---|---|
| Size | 15.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4db672dd2e1ceab094e123e45316614a4ba2c3f67da33e6ca6c4f4092621f9e4
|
|
BLAKE2b-256 checksum How to use checksums |
97453922dc185eece66ac225b995634fbcbfeb9dbea628ec9829d959f4a0da62
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.1
|
Release files / ngs_test_utils-0.0.6-py3-none-any.whl
| Download URL | ngs_test_utils-0.0.6-py3-none-any.whl |
|---|---|
| Size | 13.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bf55dcf4e1f085249f213dafd50f456378cc5f7c058ca945c34284af16346140
|
|
BLAKE2b-256 checksum How to use checksums |
5047bdd91e19f72d4ce104ed67f2838d8f17fc548b18c692db24ce7ba08d7db5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.1
|