This is a test version of Biostars. For the public version, visit https://www.biostars.org.
seqtk subseq command not pulling full fastq reads

When I run the seqtk subseq to extract sequences, it completely disregards the quality scores and the sequence.

>>>./seqtk subseq file.fastq IDs.txt
@NS500126:798:HWTLTAFXX:1:11101:10771:1083:1-1 1:N:0:AATGGTCG+NGACCATT
G
+
A
@NS500126:798:HWTLTAFXX:1:11101:2195:1084:1-1 1:N:0:AATGGTCG+NGACCATT
G
+
A
@NS500126:798:HWTLTAFXX:1:11101:2581:1084:1-1 1:N:0:AATGGTCG+NGACCATT
T
+
A

It's pulling the first character in the quality score and read; however, it's not pulling the full line.

Is there a way to fix that?

next-gen sequencing

can you show us the output of

grep -A3 NS500126:798:HWTLTAFXX:1:11101:10771:1083:1-1 file.fastq

It doesn't seem to output anything.

if I look at the first couple lines of file.fastq it looks like this:

@NS500126:798:HWTLTAFXX:1:11101:10771:1083 1:N:0:AATGGTCG+NGACCATT
GTTGAGGCAAAGCACCCGCGAAGGCACCAGAGCCCGAGTCATCCCAGCCTTCAGAGCCAATCCTTATCCCGCAGTTACGGATCTAATTTGCCGACTTCCCTTACCTACATTGATCTATCGCCTAGAGACTCTAAACCTTGGAGACCTGCT
+
AAAAAEEAAEEEEAEEEEEEEEEEEAEAEEAEEEEEEEAE/EE/EEEAE6EEAE/EA6EAEEAEEEAEE6</AAEAEEEE/</EEEEEE/EA<E</6E/EEE<AE/E/EAAAEA/EAEAE//EEEEEE/EEA/<E/<E<<E/AAEA6A/A
@NS500126:798:HWTLTAFXX:1:11101:2195:1084 1:N:0:AATGGTCG+NGACCATT
GGGAATTCCAGGTTCATATGGACCATTTCAATCCATAATCCCGACTAAATGAGCATTTCAGTGATTTCCCGCGCCTTTCGGCGTAGGGTACACGCTGCTGCTCACATTGTAGCGCGCGTGCAGACCAGAACATCTAAGGGCATCACGGAC
+

This header in original post

@NS500126:798:HWTLTAFXX:1:11101:10771:1083:1-1 1:N:0:AATGGTCG+NGACCATT

does not match the example posted above

@NS500126:798:HWTLTAFXX:1:11101:10771:1083 1:N:0:AATGGTCG+NGACCATT

What gives?

As per seqtk results, remove spaces in sequence header in fastq file and ids.txt and try again.

try seqkit:

$ seqkit grep -nf id.txt test.fq

The command you provided worked!! Though I'm not sure why you suggested I remove spaces.

1 answer

That is because there is a whitespace in the header of the fastq.

@NS500126:798:HWTLTAFXX:1:11101:10771:1083:1-1 1:N:0:AATGGTCG+NGACCATT

Only the part before "1:N:0:AATGGTCG+NGACCATT" is the fastq name, the rest is not.

https://github.com/lh3/seqtk/issues/141

Log in to answer this question.