andersen-lab / ivar

iVar is a computational package that contains functions broadly useful for viral amplicon-based sequencing.
https://andersen-lab.github.io/ivar/html/
GNU General Public License v3.0
115 stars 39 forks source link

Does ivar trim only from the ends of aligned BAM files? #177

Open yl315504 opened 3 months ago

yl315504 commented 3 months ago

Hello,

The kit we are using will generate overlapped sequences. The reason is that the forward primers start at different location and the reverse primers have a fixed location. Please see an example below.

NC_045512.2 25 301 covid19genome_0-200_s0_M1 3 25 covid19genome_0-200_s0_M1F 301 322 NC_045512.2 56 301 covid19genome_0-200_s0_M2 33 56 covid19genome_0-200_s0_M2F 301 322 NC_045512.2 200 301 covid19genome_200-29703_s7490_U_88 182 200 covid19genome_200-29703_s7490_U_88F 301 322

If ivar also trims sequences in the middle, some sequences from (25, 301) will be trimmed because ivar will trim (182, 200), which is the primer sequence from the 3rd primer.

If ivar only trims from the ends (left and right), not the middle, we won't have any concerns.

Thanks, Yan Liu from UT Southwestern Medical Center, Dallas

cmaceves commented 3 months ago

Hi! So in the instance you're describing, if you have paired reads ivar will take the direction of the read into account. In other words for a reverse read, it will trim only the reverse primers (from the ends).

xiaoziyayaya commented 2 months ago

Hello, ivar trim -b db/primers.bed -p sample.trimmed -i sample.sorted.bam,This command to produce the “sample.trimmed.sorted.bam ”file is not in strict accordance with the position of the primer to prune 微信图片_20240519142107

The primer length is 18bp, but only 7bp was clipped,I noticed that the numerical description of XA was added to the resulting bam file, and I wonder if it is related to soft clipping?

Thanks, ziman xing