Skip to main content

clip

Clips overlapping regions in read mates of SAM/BAM files.

To install: pip install clipoverlap Or:

git clone git@github.com:innovate-invent/clip.git
cd clip
python3 setup.py install

To run:

$ clip -h
Clip Overlap v1.0
Clip overlapping reads from SAM/BAM/CRAM file
Use: clip [-tmabcosv] [input file path | < infile > outfile] [output file path]
If no paths are given stdin and stdout are used.
-t # Threads to use for processing (Default=1)
-m # Maximum template length guaranteeing no read overlap (Default=1000)
-a Alternate strand being clipped to avoid strand bias (RAM intensive)
-b Trim tails of reads that extend past end of mate. Used to trim barcode remnants.
-c Clip only, do not merge clipped region into mate.
-o [sbuc] Output format: s=SAM (Default), b=BAM compressed, bu=BAM uncompressed, c=CRAM
-s Maintain input order (High depth regions may fill RAM), if not set will output in arbitrary order (Minimal RAM)
-v Verbose status output

You may notice if you just run clip with no parameters it will just sit there doing nothing. That is because the default is to listen to stdin for input.

Notes:

clip uses a minimum of two subprocesses regardless of the -t option.

-a will alternate between clipping the tail of the left most strand and clipping the head of the right most strand. This is to avoid possible strand bias later in a processing pipeline.

If you are processing reads that had barcodes ligated and removed the 5’ barcode in a previous step (See ProDuSe:trim) then use the -b option to remove any possible 3’ barcode sequence that would be appended if sequencing ran to the end of the molecule.

Using -s and -a together will force clip to try and sort by start reference coordinate. If unsorted data is the input then this could potentially run out of RAM.

Merge Algorithm

The mate read cigars are assumed to align 1-1 with an offset determined by the difference in the reference start positions.

  • If -c is unset then clip will retain the highest quality base at a given position in the overlapping region of the mate pairs.

  • If the base qualities are equal then it will keep the base that does not match the reference.

  • If base qualities are equal and both bases are different variants, then the quality score is set to 3 (3 = Phred 50% probability of either base).

  • If the operations between the aligned cigars do not match then the operations from the mate with the lowest alignment cost are retained.

The alignment cost is calculated for the overlapping region only. The cost is summed using these values:

Operation

Value

M, X, =, N

-1

I

6 to start, +1 to lengthen

D

3 to start, +1 to lengthen

TODO:

Significant speed and memory optimisations are planned. Need to eliminate the pysam dependency first.

Metadata

Release files for clipoverlap 1.0.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for clipoverlap 1.0.9
File Size Uploaded Provenance
clipoverlap-1.0.9.tar.gz 11.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for clipoverlap 1.0.9
File Interpreter ABI Platform
clipoverlap-1.0.9-py3-none-any.whl Python 3 none any Details

Total release size: 24.8 kB

Release files / clipoverlap-1.0.9.tar.gz

Download URL clipoverlap-1.0.9.tar.gz
Size 11.3 kB
Tags Source
SHA-256 checksum
How to use checksums
20064aa36ddfb2c4faaae7f147f1a93853ab67b9690bc65701ec754db5786681
BLAKE2b-256 checksum
How to use checksums
a3e3bfa31d87a95f2e6f1e12656db695d5461378468ec9fdad789b114e84f805
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / clipoverlap-1.0.9-py3-none-any.whl

Download URL clipoverlap-1.0.9-py3-none-any.whl
Size 13.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9b8e9bead4d61cdc1f13d3711cc1f848e600715d903cedd204f48d17296bf7fc
BLAKE2b-256 checksum
How to use checksums
87f7d5c5c922e42afe8581b2b28255cb1922bb6a21150c7a901a85f23daa8bfa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for clipoverlap 1.0.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page