This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Problems in use of seqtk subseq

Hi,everyone, I want to extract read sequences from a fastq file with reads ID (a name list file), and try to use the seqtk, with a command seqtk subseq input.fastq IDlist.lst > out.fastq. However, the out.fastq only contains the first character of each record lines, maybe it's because that there is a white space in each read ID. Dose anyone know how to solve this problem? thanks:)

subseq seqtk

Thanks for the help of rtliu and Brian Bushnell, it's really kind of you:). The seqtk subseq cannot output reads in the order specified by the ID list. And, as a new one in this filed, I am now trying to install the BBTools...by the way, there is always no respond when I click the button "ADD REPLY"or "ADD COMMENT", should I change a Internet Explorer or something?

I'm not sure if you are replying to me or rtliu, but BBTools does not have the ability to output reads in the order specified by the ID list. I will put it on my list of features to add, though. I'm not sure where or not seqtk can do that.

The inability to add a reply is something I have experienced in Firefox with certain extensions that block things like javascript, or 3rd-party websites, and so forth; I had to allow the entire page to get it to work correctly. The latest version of Firefox or Chrome with no blocking extensions should work fine.

As for installing BBTools, all you need to do is unzip and untar it. But you do need Java installed. To see if Java is installed, just type java -Xmx100m -version.

2 answers

Try to replace whitespace with underscore for input.fastq and IDlist.lst

sed 's/[ \t]/_/g' input.fastq > in.fq
sed 's/[ \t]/_/g' IDlist.lst > ID.lst

BBTools should handle this situation correctly, as it tries to match the whole string regardless of whitespace.

filterbyname.sh in=reads.fq names=names.txt out=filtered.fq

If that does not work, it would be helpful for you to post a couple of the read names so we can see the format.

Log in to answer this question.