Skip to main content

No project description provided

Project description

pyCoverM

This package is still in experimental stages and aims to be a simple Python interface to CoverM's fast coverage estimation functions. Currently, pyCoverM provides two functions: is_bam_sorted, which checks whether a BAM file is sorted by coordinate, and get_coverages_from_bam, that computes average contig coverages from sorted BAM files.

Installation

pip install pycoverm

Usage

/// is_bam_sorted(bam_file)
/// --
///
/// Checks whether a BAM file is sorted by coordinate.
///
/// Parameters
/// ----------
/// bam_file : str
///     Path to a BAM file.
///
/// Returns
/// -------
/// bool
///     Returns `True` if the BAM file is sorted by coordinate and `False`
///     otherwise.
/// get_coverages_from_bam(bam_list, contig_end_exclusion=75, min_identity=0.97,
/// trim_lower=0.0, trim_upper=0.0, contig_list=None, threads=1)
/// --
///
/// Computes contig mean coverages from sorted BAM files. All BAM files must be
/// mapped to the same reference.
/// Trimmed means will be computed if `trim_min` and/or `trim_max` are set to
/// values greater than 0.
///
/// Parameters
/// ----------
/// bam_list : list
///     Paths to input BAM files.
/// contig_end_exclusion : int, optional
///     Exclude bases at the ends of reference sequences from calculation.
///     Default is 75.
/// min_identity : float, optional
///     Exclude reads by overall identity to the reference sequences.
///     Default is 0.97.
/// trim_lower : float, optional
///     Fraction to trim from the lower tail of the coverage distribution.
///     Default is 0.0.
/// trim_upper : float, optional
///     Fraction to trim from the upper tail of the coverage distribution.
///     Default is 0.0.
/// contig_set : set, optional
///     If provided, only the coverages of the contigs within `contig_set` will
///     returned.
///     Default is None (return the coverages of all contigs).
/// threads : int, optional
///     Number of threads to use for coverage computation. Default is 1.
///
/// Returns
/// -------
/// tuple
///     A tuple whose fist element is a list of the contig names and the second
///     one is a numpy matrix of contig coverages in the input BAM files.

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

pycoverm-0.6.0.tar.gz (16.7 kB view hashes)

Uploaded Source

Built Distributions

pycoverm-0.6.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.6 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

pycoverm-0.6.0-cp312-cp312-macosx_10_7_x86_64.whl (791.8 kB view hashes)

Uploaded CPython 3.12 macOS 10.7+ x86-64

pycoverm-0.6.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.9 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

pycoverm-0.6.0-cp311-cp311-macosx_10_7_x86_64.whl (750.1 kB view hashes)

Uploaded CPython 3.11 macOS 10.7+ x86-64

pycoverm-0.6.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.9 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

pycoverm-0.6.0-cp310-cp310-macosx_10_7_x86_64.whl (750.1 kB view hashes)

Uploaded CPython 3.10 macOS 10.7+ x86-64

pycoverm-0.6.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.9 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

pycoverm-0.6.0-cp39-cp39-macosx_10_7_x86_64.whl (750.1 kB view hashes)

Uploaded CPython 3.9 macOS 10.7+ x86-64

pycoverm-0.6.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.9 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

pycoverm-0.6.0-cp38-cp38-macosx_10_7_x86_64.whl (750.1 kB view hashes)

Uploaded CPython 3.8 macOS 10.7+ x86-64

pycoverm-0.6.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.9 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

pycoverm-0.6.0-cp37-cp37m-macosx_10_7_x86_64.whl (750.1 kB view hashes)

Uploaded CPython 3.7m macOS 10.7+ x86-64

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