The FASTQ format is a text-based format for storing both a biological sequence (usually nucleotide sequence) and its corresponding quality scores.

A FASTQ file normally uses four lines per sequence:

  1. Asks for the name of a FASTQ file (e.g., FASTQ.txt) and the name of an output file (e.g., output_file.txt) in an interactive way.
  2. Iterates over the FASTQ file and adds the raw sequences (line numbers 2) to the output file.
  3. Also print the sequences to the standard output.

Example Output:

$ ./FASTQ_summary.sh
Enter the name of the FASTQ file: FASTQ.txt
Enter the name of the output file: output_file.txt
Processing FASTQ.txt...
TGTTGAATTGAGAGCTTGTGTTNAGTAGATAGTTGA	
CCCACGTATCCAAGTCGAAGAGNAATTGATTTTCCC	
AGGGAGGGAGGGAGTGAGATTGNTTCGATCGCCAAT	
CTGGGTTTTTGTGTTATTGAGANTCTGAGTTTGAGA	
TTGTTCCTTGACGAGATTGGTGNGGCTTACGATGAG	
GATCGGAAGAGCTCGTATGCCGNCTTCTGCTTGAAA	
GCATCGAAGCCAACCTCGAACTNCTGGCCGTGGCCG	
TAAGCGTGTGGATCTAAACAATNACAAGGAGACTTT	
TATCGTCGCTATCGGGAGCTTTNTCTAGATCGGAAG	
TGCCGTTGATTAGTCCATTCTCNGAAGGAGAGATAC	
ATGTCTCGCAAACCGGAAAACANACGTTAAGTCCGG	
GTCCCTCGTTTACAGACTCAGANGTGAATAGAAAAG
Sequences have been written to output_file.txt

$ ./FASTQ_summary.sh
Enter the name of the FASTQ file: FASTQ2.txt
Enter the name of the output file: output_file.txt
Error: FASTQ2.txt does not exist.

$ echo $?
1