Samtools ampliconclip hard clip not giving same results as soft clip
0
0
Entering edit mode
19 months ago
Kevin ▴ 10

Hi all,

After stumbling on this post: https://bioinformatics.stackexchange.com/questions/16112/precisely-clipping-bam-file-to-bed-coordinates, I found out about the samtools ampliconclip package and wanted to use it for my own project. However, I'm running into some issues with using the samtools ampliconclip --soft-clip versus --hard-clip option.

Essentially, what I'm trying to do is clip certain reads of interest in a bam file down to a specific window that I specify using a bed file. However, when I run ampliconclip with --soft-clip, it gives me what I want, but when I run it with --hard-clip, it basically produces a blank bam file as output.

This is a picture of the unprocessed bam file of interest unprocessed bam

This is the complement bed file that I want to clip

9   0   33261120
9   33262737    149000000000

After running the code samtools ampliconclip --both-ends --soft-clip -b input.bed input.bam> output.bam I get the result I want, which is all my reads clipped besides a certain genomic interval softclip

However, what I really want is the hard clipped version of these reads. However, when running the same code samtools ampliconclip --both-ends --hard-clip -b input.bed input.bam> output.bam I basically get an empty file with no reads at all. hardclip

From my understanding, using ampliconclip with --hard-clip versus --soft-clip should only change the CIGAR string and not how the intersection with the bed file should work, so I'm a little stumped as to why its giving me such different outputs. Any help is greatly appreciated!

ampliconclip samtools • 1.0k views
ADD COMMENT
1
Entering edit mode

Did you check the actual bam file? It might be masked in the graphical representation

ADD REPLY
0
Entering edit mode

Hi, yes I checked the bam file and its significantly smaller than the soft clipped one, and only contains a couple reads.

ADD REPLY
1
Entering edit mode

There's a weird return 0 on line 320, it might be a bug. Maybe you should open an issue.

ADD REPLY
0
Entering edit mode

Issue opened in GitHub. I'll take a look at it.

ADD REPLY
0
Entering edit mode

Tagging: John Marshall

ADD REPLY

Login before adding your answer.

Traffic: 3213 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6