samtools-ampliconclip(1) | Bioinformatics tools | samtools-ampliconclip(1) |
samtools-ampliconclip - clip reads using a BED file
samtools ampliconclip [-o out.file] [-f stat.file] [--soft-clip] [--hard-clip] [--both-ends] [--strand] [--clipped] [--fail] [--filter-len INT] [--fail-len INT] [--no-excluded] [--rejects-file rejects.file] [--original] [--keep-tag] [--tolerance] [--no-PG] [-u] -b bed.file in.file
Clips the ends of read alignments if they intersect with regions defined in a BED file. While this tool was originally written for clipping read alignment positions which correspond to amplicon primer locations it can also be used in other contexts.
BED file entries used are chrom, chromStart, chromEnd and, optionally, strand. There is a default tolerance of 5 bases when matching chromStart and chromEnd to alignments.
By default the reads are soft clipped and clip is only done from the 5' end.
Some things to be aware of. While ordering is not significant, adjustments to the left most mapping position (POS) will mean that coordinate sorted files will need resorting. In such cases the sorting order in the header is set to unknown. Clipping of reads results in template length (TLEN) being incorrect. This can be corrected by samtools fixmates. Any MD and NM aux tags will also be incorrect, which can be fixed by samtools calmd. By default MD and NM tags are removed though if the output is in CRAM format these tags will be automatically regenerated.
Written by Andrew Whitwham and Rob Davies, both from the Sanger Institute.
samtools(1), samtools-sort(1), samtools-fixmate(1), samtools-calmd(1)
Samtools website: <http://www.htslib.org/>
2 September 2022 | samtools-1.16.1 |