I wrote an R function to do soft-trimming, right clipping FastQ reads based on quality.
This function has the option of leaving out sequences trimmed to extinction and will do left-side fixed trimming as well.
#softTrim #trim first position lower than minQuality and all subsequent positions #omit sequences that after trimming are shorter than minLength #left trim to firstBase, (1 implies no left trim) #input: ShortReadQ reads # integer minQuality # integer firstBase # integer minLength #output: ShortReadQ trimmed reads library("ShortRead") softTrim
library("ShortRead") source("softTrimFunction.R") #or whatever you want to name this reads
I strongly recommend reading the excellent UC Riverside HT-Sequencing Wiki cookbook and tutorial if you wish to venture into using R for NGS handling. Among other things, it will explain how to perform casting if you have Solexa scaled (base 64) fastq files. The function should respect that. http://manuals.bioinformatics.ucr.edu/home/ht-seq