text: user298: I am working on a sample which was sequenced using an amplicon kit and I would like to ensure that no variants are called in the PCR primer sequences. I know that the primer sequences are part of the genome and a variant there is no less valid than a variant anywhere else, but for reasons I cannot control, I need to ensure that no variants can be called in the primer regions. 
  My first thought was to use a soft-clipping tool like BAMClipper. However, the variant caller I am using (Sentieon's implementation of GATK) preforms a local realignment when calling and if it finds that soft-clipped regions align perfectly against the genome, it will remove the soft clips. This makes perfect sense for cases where the softclips were added by the aligner, but sadly breaks my workflow since I need the softclipped primers to remain clipped.
  I would therefore like to hard clip, to completely remove the primer sequences from the bam file before variant calling. I have found one tool that seems to be able to do this, TrimPrimers by Fulcrum Genomics, but this fails on my input bam file with an error I can't really make much of. 
  Is there any other tool that can take a list of regions (e.g. a bedpe file) and a BAM and hard-clip the regions from the BAM?
  
  user2388: 
  I know that the primer sequences are part of the genome and a variant
    there is no less valid than a variant anywhere else,
  
  You won't see variants under PCR primers.  You get the primer sequence itself in the vast majority of reads.
  I wouldn't clip the bam file, I'd clip either the fastq, or clip within bcl2fastq while making the fastqs.
  
  user964: Another option would be to adjust the quality of the primer bases to be below the threshold that your variant caller uses.  In my case I have "masked" the primer bases by dropping the quality to 0.  This prevents the variants from being called based that are synthetic but if you have an overlapping amplicon it will call bases from those reads.
  
original_text: 298: <p>I am working on a sample which was sequenced using an amplicon kit and I would like to ensure that no variants are called in the PCR primer sequences. I know that the primer sequences are part of the genome and a variant there is no less valid than a variant anywhere else, but for reasons I cannot control, I need to ensure that no variants can be called in the primer regions. </p>
  
  <p>My first thought was to use a soft-clipping tool like <a href="https://github.com/tommyau/bamclipper" rel="nofollow noreferrer">BAMClipper</a>. However, the variant caller I am using (<a href="https://www.sentieon.com/products/" rel="nofollow noreferrer">Sentieon's implementation of GATK</a>) preforms a local realignment when calling and if it finds that soft-clipped regions align perfectly against the genome, it will remove the soft clips. This makes perfect sense for cases where the softclips were added by the aligner, but sadly breaks my workflow since I need the softclipped primers to remain clipped.</p>
  
  <p>I would therefore like to hard clip, to completely remove the primer sequences from the bam file before variant calling. I have found one tool that seems to be able to do this, <a href="http://fulcrumgenomics.github.io/fgbio/tools/latest/TrimPrimers.html" rel="nofollow noreferrer">TrimPrimers</a> by Fulcrum Genomics, but this fails on my input bam file with <a href="https://pastebin.com/QRYK2kJY" rel="nofollow noreferrer">an error</a> I can't really make much of. </p>
  
  <p>Is there any other tool that can take a list of regions (e.g. a bedpe file) and a BAM and hard-clip the regions from the BAM?</p>
   2388: <blockquote>
    <p>I know that the primer sequences are part of the genome and a variant
    there is no less valid than a variant anywhere else,</p>
  </blockquote>
  
  <p>You won't see variants under PCR primers.  You get the primer sequence itself in the vast majority of reads.</p>
  
  <p>I wouldn't clip the bam file, I'd clip either the fastq, or clip within bcl2fastq while making the fastqs.</p>
   964: <p>Another option would be to adjust the quality of the primer bases to be below the threshold that your variant caller uses.  In my case I have "masked" the primer bases by dropping the quality to 0.  This prevents the variants from being called based that are synthetic but if you have an overlapping amplicon it will call bases from those reads.</p>
  