I want to extract all the unique read IDs in a fastq file and output the unique read IDs to a text file. (I have done the same task for bam files using the samtools but I don't know any tools that would handle fastq files.)
for BAM files: samtools view input.bam|cut -f1 | sort | uniq >> unique.reads.txt
for fastq: (need help)
Looking for a one-liner command or a tool that can do that.
Thank you.