have a look at samtools ampliconclip (in a recent version of samtools)
Usage samtools ampliconclip -b bedfile <input.bam> -o <output.bam>
-b FILE bedfile of amplicons to be removed.
-o FILE output file name (default stdout).
-f FILE write stats to file name (default stderr)
-u Output uncompressed data
--soft-clip soft clip amplicons from reads (default)
--hard-clip hard clip amplicons from reads.
--both-ends clip on both ends.
Privacy & Cookies Policy
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.