Import problem with Phred64V2

I have check my **.fastq.gz file with codes:

# Loop through all .fastq.gz files in the directory
for file in "$input_directory"/*.fastq.gz; do
  # Get the first 1000 lines from the file
  head -n 1000 "$file" | \
    # Extract the quality scores and format as space-separated numbers
    awk '{if(NR%4==0) printf("%s",$0);}' | \
    # Convert the space-separated numbers to integers
    od -A n -t u1 -v | \
    # Calculate the minimum and maximum values
    awk 'BEGIN{min=100;max=0;} {for(i=1;i<=NF;i++) {if($i>max) max=$i; if($i<min) min=$i;}} \
      END {if(max<=74 && min>=33) print "Phred33"; \
           else if(max>73 && min<=66) print "Phred64"; \
           else if(min>=59 && min<64 && max>73) print "Solexa64"; \
           else print "Unknown score encoding";}' \
    # Append the result to the output file with the file name
    >> "$output_file"

and the result is phred64, but when I use command:

time qiime tools import \
  --type 'SampleData[PairedEndSequencesWithQuality]' \
  --input-path my_manifest.tsv \
  --output-path paired-end-demux.qza \
  --input-format PairedEndFastqManifestPhred64V2

It comes: File.....File....File ".../qiime2-2023.2/lib/python3.8/site-packages/skbio/io/format/", line 34, in _decode_qual_to_phred
raise ValueError("Decoded Phred score is out of range [%d, %d]."
ValueError: Decoded Phred score is out of range [0, 62].

An unexpected error has occurred:

Decoded Phred score is out of range [0, 62].

See above for debug info.
I don't know what's going on

Ranges in AWK script look strange for me.

Variant ASCII Range Offset Quality Range Notes
sanger 33 to 126 33 0 to 93 Equivalent to OBF’s fastq-sanger.
illumina1.3 64 to 126 64 0 to 62 Equivalent to OBF’s fastq-illumina. Use this if your data was generated using Illumina 1.3-1.7 software.
illumina1.8 33 to 95 33 0 to 62 Equivalent to sanger but with 0 to 62 quality score range check. Use this if your data was generated using Illumina 1.8 software or later.
solexa 59 to 126 64 -5 to 62 Not currently implemented.

May be another ManifestPhred will make things done
Regards, sn

Hello @TequilaSunrise84,

Do you know what the Phred encoding was before your conversion script? Why did you choose to convert to Phred+64, which is an older format?

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.