i replaced the low quality position with "N"
and then trimmed N from 5' and 3'
i got the reads which only contain the "N" in the middle
if i want to find those reads before replacement by "N"
WHAT CAN I DO?

THX
such is coding

library(ShortRead)
reads <- readFastq(fastqfile);#
ids<- id(reads); #
seqs <- sread(reads);

nCount<-alphabetFrequency(seqs)[,"N"]
nDist<- table(nCount)

qualityCutoff <- 20
qual <- PhredQuality(quality(quality(reads)))
myqual_mat <- matrix(charToRaw(as.character(unlist(qual))),
nrow=length(qual), byrow=TRUE) # convert quality score to matrix
at <- myqual_mat <
charToRaw(as.character(PhredQuality(as.integer(qualityCutoff))))
letter_subject <- DNAString(paste(rep.int("N", width(seqs)[1]),
collapse=""))
letter <- as(Views(letter_subject, start=1, end=rowSums(at)),
"DNAStringSet")
injectedseqs <- replaceLetterAt(seqs, at, letter)

trimmed <-trimLRPatterns(Rpattern = letter_subject, Lpattern =
letter_subject,subject = injectedseqs)
nCount<-alphabetFrequency(trimmed)[,"N"]
nDist<- table(nCount)

thank u

shan gao

	[[alternative HTML version deleted]]

