Dear all,

I have FASTQ files and on start of my read I have 7 nucleotides tag - I would like to extract reads with this specific tag.

I would like to search in first 15 nucleotides of my reads, if match - extract this read to new fastq files.

Thank you for any ideas or help.
You can use Heng Li's <a href="https://github.com/lh3/bioawk">bioawk</a>:

To check if the tag is part of the first 15 bases

    bioawk -c fastx 'substr($seq,0,15) ~ /$TAG/ { print }' reads.fq.gz

To match the first 7 bases to your tag,

    bioawk -c fastx 'substr($seq,0,7) == $TAG { print }' reads.fq.gz