Skip to main content

Generate cov3 files used in DEMIC

Project description

pycov3

CI codecov Super-Linter Codacy Badge

A package for generating cov3 files which are generated from sam files giving coverage information and a fasta file giving binned contigs. Cov3 files are used as input for the DEMIC R package which calculates PTR, an estimate for bacterial growth rates.

Install it from PyPI

pip install pycov3

Usage

Create a SAM directory and FASTA directory, set any non-default window or coverage parameters, then create a COV3 directory and use it to generate a COV3 file for each contig set in the FASTA directory.

    from pycov3.Directory import Cov3Dir, FastaDir, SamDir

    sam_d = SamDir(Path("/path/to/sams/"), False)

    window_params = {
        "window_size": None,
        "window_step": None,
        "edge_length": sam_d.calculate_edge_length(),
    }
    coverage_params = {
        "mapq_cutoff": None,
        "mapl_cutoff": None,
        "max_mismatch_ratio": None,
    }
    window_params = {k: v for k, v in window_params.items() if v is not None}
    coverage_params = {k: v for k, v in coverage_params.items() if v is not None}

    fasta_d = FastaDir(Path("/path/to/fastas/"), False)

    cov3_d = Cov3Dir(
        Path(args.out_dir),
        False,
        fasta_d.get_filenames(),
        window_params,
        coverage_params,
    )

    cov3_d.generate(sam_d, fasta_d)
$ python -m pycov3 -h
#or
$ pycov3 -h

The Makefile

All the utilities for the template and project are on the Makefile

 make
Usage: make <target>

Targets:
help:             ## Show the help.
install:          ## Install the project in dev mode.
fmt:              ## Format code using black & isort.
lint:             ## Run pep8, black, mypy linters.
test: lint        ## Run tests and generate coverage report.
watch:            ## Run tests on every change.
clean:            ## Clean unused files.
virtualenv:       ## Create a virtual environment.
release:          ## Create a new tag for release.
docs:             ## Build the documentation.
switch-to-poetry: ## Switch to poetry package manager.
init:             ## Initialize the project based on an application template.

Development

Read the CONTRIBUTING.md file.

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

pycov3-1.0.0.tar.gz (21.9 kB view details)

Uploaded Source

Built Distribution

pycov3-1.0.0-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file pycov3-1.0.0.tar.gz.

File metadata

  • Download URL: pycov3-1.0.0.tar.gz
  • Upload date:
  • Size: 21.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for pycov3-1.0.0.tar.gz
Algorithm Hash digest
SHA256 160d73e2f3f867895ceefd6f769d27bb9ed99e2b5a0fe7935c15582f01c4d028
MD5 844691be441597fc41f49d6e09c49f92
BLAKE2b-256 c59702ba1fd6396bcd825377a43005eb990a5311af03ec82360e7e1ea9bb9194

See more details on using hashes here.

File details

Details for the file pycov3-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pycov3-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for pycov3-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 66432dfbf3841db108db4075aec7f80d475dee4dafc22585cf04bb583dd35da8
MD5 61bc45c1cd3331257617677be4c2e9d6
BLAKE2b-256 accb42ee418f452d8661ba77244187f888e3f2b561534b5e992d33c21d021c10

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