You can use bbduk.shor reformat.sh from BBMap suite with qtrim=rl trimq=1. That will only trim trailing and leading bases with Q-score below 1, which means Q0, which means N (in either fasta or fastq format). If the entire read is N then it will be taken out.
Use outm= to grab filtered reads is a separate file. If you have a paired-end data set then you can use outm1= and outm2= to grab both reads.
bbduk.sh in=file.fq qtrim=rl trimq=1 out=clean.fq outm=capture.fq minlength=read_length. This will capture any read that has at least one N in the outm file (replace read_length = number of cycles in your reads).
Note: This will trim the N's out though. Which is not what you seem to want. So use @Pierre's solution for now until I (or Brian Bushnell ) can help figure out a BBMap way.
You can use
bbduk.sh
orreformat.sh
from BBMap suite withqtrim=rl trimq=1
. That will only trim trailing and leading bases with Q-score below 1, which means Q0, which means N (in either fasta or fastq format). If the entire read is N then it will be taken out.It didnt work they way you said. I want all the reads with N in separate file.
Use
outm=
to grab filtered reads is a separate file. If you have a paired-end data set then you can useoutm1=
andoutm2=
to grab both reads.bbduk.sh in=file.fq qtrim=rl trimq=1 out=clean.fq outm=capture.fq minlength=read_length
. This will capture any read that has at least one N in theoutm
file (replace read_length = number of cycles in your reads).Note: This will trim the N's out though. Which is not what you seem to want. So use @Pierre's solution for now until I (or Brian Bushnell ) can help figure out a BBMap way.
#### : Closing a post is an action generally use by moderators during moderation.
If your question has been solved then accept one (or more) of the answers below (green check mark) to provide closure to the thread.