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?
Have you tried the checkorient option in trim.seqs?
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?
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.