trim.seqs and primer removal

I’m using trim.seqs() to remove PacBio ccs reads that do not match certain criteria (for example, too short or too long, if they have too many mismatches with the primers etc). By default, the trim.seqs() function should automatically remove the primer sequences, but it seems that in my case, it only removes the primer sequences for a fraction of the reads.

I discovered that this is because of the direction of the read. So if a ccs read happened to be in the reverse direction (about half of the reads), trim.seqs() (when using checkorient=T) would recognize the primer, but not remove it. But if it would be in the forward direction, it would remove it.

Is this intended? Or is it possible to use trim.seqs() in some way to also remove primers from reverse reads?

Hello,

I believe you want to use the flip argument (flip=T) for trim.seqs() to remove the primers from the reverse oriented sequences.

Cheers
Richard

I tried that as well, but it did not work for me.

In the end what worked was to change the oligos file to contain both directions, so it would look something like this:

primer fwdrev
primer revfwd

With all primers written in their 5’->3’ directions

  1. Have you tried the checkorient option in trim.seqs?
  2. Have you looked at the failing sequences to see why they are failing? Can you post one of the sequences that you think shouldn’t be failing with the primers you are using?

Thanks
Pat

  1. Yes (see first post)
  2. Yes. At first I thought it was because there were maybe too many mismatches with the primers, but I could find at least a few examples where the sequences had a perfect match with the primer. Then I checked the orientation. For all reads that were in the reverse orientation, the trimming failed. For all reads that were in the forward orientation, the trimming worked.

The trick I’m using (see second post) produces the right behaviour, so I’m using that for now.

Can you post one of the sequences that you think shouldn’t be failing with the primers you are using?