1samtools-ampliconclip(1) Bioinformatics tools samtools-ampliconclip(1)
2
3
4
6 samtools ampliconclip - clip reads using a BED file
7
9 samtools ampliconclip [-o out.file] [-f stat.file] [--soft-clip]
10 [--hard-clip] [--both-ends] [--strand] [--clipped] [--fail] [--filter-
11 len INT] [--fail-len INT] [--no-excluded] [--rejects-file rejects.file]
12 [--original] [--keep-tag] [--tolerance] [--no-PG] [-u] -b bed.file
13 in.file
14
15
17 Clips the ends of read alignments if they intersect with regions de‐
18 fined in a BED file. While this tool was originally written for clip‐
19 ping read alignment positions which correspond to amplicon primer loca‐
20 tions it can also be used in other contexts.
21
22 BED file entries used are chrom, chromStart, chromEnd and, optionally,
23 strand. There is a default tolerance of 5 bases when matching chrom‐
24 Start and chromEnd to alignments.
25
26 By default the reads are soft clipped and clip is only done from the 5'
27 end.
28
29 Some things to be aware of. While ordering is not significant, adjust‐
30 ments to the left most mapping position (POS) will mean that coordinate
31 sorted files will need resorting. In such cases the sorting order in
32 the header is set to unknown. Clipping of reads results in template
33 length (TLEN) being incorrect. This can be corrected by samtools fix‐
34 mates. Any MD and NM aux tags will also be incorrect, which can be
35 fixed by samtools calmd. By default MD and NM tags are removed though
36 if the output is in CRAM format these tags will be automatically regen‐
37 erated.
38
39
41 -b FILE BED file of regions (e.g. amplicon primers) to be removed.
42
43 -o FILE Output file name (defaults to stdout).
44
45 -f FILE File to write stats to (defaults to stderr).
46
47 -u Output uncompressed SAM, BAM or CRAM.
48
49 --soft-clip
50 Soft clip reads (default).
51
52 --hard-clip
53 Hard clip reads.
54
55 --both-ends
56 Clip at both the 5' and the 3' ends where regions match.
57
58 --strand Use strand entry from the BED file to clip on the matching
59 forward or reverse alignment.
60
61 --clipped Only output clipped reads. Filter all others.
62
63 --fail Mark unclipped reads as QC fail.
64
65 --filter-len INT
66 Filter out reads of INT size or shorter. In this case soft
67 clips are not counted toward read length. An INT of 0 will
68 filter out reads with no matching bases.
69
70 --fail-len INT
71 As --filter-len but mark as QC fail rather then filter out.
72
73 --no-excluded
74 Filter out any reads that are marked as QCFAIL or are un‐
75 mapped. This works on the state of the reads before clip‐
76 ping takes place.
77
78 --rejects-file FILE
79 Write any filtered reads out to a file.
80
81 --original Add an OA tag with the original data for clipped files.
82
83 --keep-tag In clipped reads, keep the possibly invalid NM and MD tags.
84 By default these tags are deleted.
85
86 --tolerance INT
87 The amount of latitude given in matching regions to align‐
88 ments. Default 5 bases.
89
90 --no-PG Do not at a PG line to the header.
91
92
94 Written by Andrew Whitwham and Rob Davies, both from the Sanger Insti‐
95 tute.
96
97
99 samtools(1), samtools-sort(1), samtools-fixmate(1), samtools-calmd(1)
100
101 Samtools website: <http://www.htslib.org/>
102
103
104
105samtools-1.13 7 July 2021 samtools-ampliconclip(1)