#!/usr/bin/env bash
# Bulk download script for GSE214108
# Generated from Yeo Lab Publications Database
# Total files: 98

OUTDIR="GSE214108"
mkdir -p "$OUTDIR"
cd "$OUTDIR"

# --- GEO supplementary files ---
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE214nnn/GSE214108/suppl/GSE214108_featureCounts_CDS.txt.gz" -O "GSE214108_featureCounts_CDS.txt.gz"

# --- SRA run files ---
# Tip: use 'fasterq-dump' from SRA Toolkit for FASTQ conversion
#      with optional renaming to original submitted FASTQ names.
# Set to 1 to rename SRR outputs (e.g. SRR_1.fastq.gz -> sample_R1.fastq.gz)
RENAME_SRA_TO_ORIGINAL=1

_compress_if_exists() {
  local stem="$1"
  if [ -f "${stem}.fastq" ]; then
    gzip -f "${stem}.fastq"
    echo "${stem}.fastq.gz"
    return 0
  fi
  if [ -f "${stem}.fq" ]; then
    gzip -f "${stem}.fq"
    echo "${stem}.fq.gz"
    return 0
  fi
  return 1
}

# Option A: Download via SRA Toolkit (recommended)
fasterq-dump --split-files "SRR21696962"
gz1="$(_compress_if_exists 'SRR21696962_1' || true)"
gz2="$(_compress_if_exists 'SRR21696962_2' || true)"
gzs="$(_compress_if_exists 'SRR21696962' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "C3-T_4_S68_L001_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "C3-T_4_S68_L001_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21696963"
gz1="$(_compress_if_exists 'SRR21696963_1' || true)"
gz2="$(_compress_if_exists 'SRR21696963_2' || true)"
gzs="$(_compress_if_exists 'SRR21696963' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "C3-T_3_S67_L001_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "C3-T_3_S67_L001_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21696964"
gz1="$(_compress_if_exists 'SRR21696964_1' || true)"
gz2="$(_compress_if_exists 'SRR21696964_2' || true)"
gzs="$(_compress_if_exists 'SRR21696964' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "C3-T_2_S66_L001_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "C3-T_2_S66_L001_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21696965"
gz1="$(_compress_if_exists 'SRR21696965_1' || true)"
gz2="$(_compress_if_exists 'SRR21696965_2' || true)"
gzs="$(_compress_if_exists 'SRR21696965' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "C3-T_1_S65_L001_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "C3-T_1_S65_L001_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21696966"
gz1="$(_compress_if_exists 'SRR21696966_1' || true)"
gz2="$(_compress_if_exists 'SRR21696966_2' || true)"
gzs="$(_compress_if_exists 'SRR21696966' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "C3-L_4_S64_L001_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "C3-L_4_S64_L001_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21696967"
gz1="$(_compress_if_exists 'SRR21696967_1' || true)"
gz2="$(_compress_if_exists 'SRR21696967_2' || true)"
gzs="$(_compress_if_exists 'SRR21696967' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "C3-L_3_S63_L001_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "C3-L_3_S63_L001_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21696968"
gz1="$(_compress_if_exists 'SRR21696968_1' || true)"
gz2="$(_compress_if_exists 'SRR21696968_2' || true)"
gzs="$(_compress_if_exists 'SRR21696968' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "C3-L_2_S62_L001_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "C3-L_2_S62_L001_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21696969"
gz1="$(_compress_if_exists 'SRR21696969_1' || true)"
gz2="$(_compress_if_exists 'SRR21696969_2' || true)"
gzs="$(_compress_if_exists 'SRR21696969' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "C3-L_1_S61_L001_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "C3-L_1_S61_L001_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21696970"
gz1="$(_compress_if_exists 'SRR21696970_1' || true)"
gz2="$(_compress_if_exists 'SRR21696970_2' || true)"
gzs="$(_compress_if_exists 'SRR21696970' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "C2-T_4_S56_L001_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "C2-UT_4_S60_L001_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21696971"
gz1="$(_compress_if_exists 'SRR21696971_1' || true)"
gz2="$(_compress_if_exists 'SRR21696971_2' || true)"
gzs="$(_compress_if_exists 'SRR21696971' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "C2-T_3_S55_L001_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "C2-T_3_S55_L001_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21696972"
gz1="$(_compress_if_exists 'SRR21696972_1' || true)"
gz2="$(_compress_if_exists 'SRR21696972_2' || true)"
gzs="$(_compress_if_exists 'SRR21696972' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "C2-T_2_S54_L001_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "C2-T_2_S54_L001_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21696973"
gz1="$(_compress_if_exists 'SRR21696973_1' || true)"
gz2="$(_compress_if_exists 'SRR21696973_2' || true)"
gzs="$(_compress_if_exists 'SRR21696973' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "C2-T_1_S53_L001_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "C2-T_1_S53_L001_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21696974"
gz1="$(_compress_if_exists 'SRR21696974_1' || true)"
gz2="$(_compress_if_exists 'SRR21696974_2' || true)"
gzs="$(_compress_if_exists 'SRR21696974' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "C2-L_4_S52_L001_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "C2-L_4_S52_L001_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21696975"
gz1="$(_compress_if_exists 'SRR21696975_1' || true)"
gz2="$(_compress_if_exists 'SRR21696975_2' || true)"
gzs="$(_compress_if_exists 'SRR21696975' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "C2-L_3_S51_L001_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "C2-L_3_S51_L001_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21696976"
gz1="$(_compress_if_exists 'SRR21696976_1' || true)"
gz2="$(_compress_if_exists 'SRR21696976_2' || true)"
gzs="$(_compress_if_exists 'SRR21696976' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "C2-L_2_S50_L001_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "C2-L_2_S50_L001_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21696977"
gz1="$(_compress_if_exists 'SRR21696977_1' || true)"
gz2="$(_compress_if_exists 'SRR21696977_2' || true)"
gzs="$(_compress_if_exists 'SRR21696977' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "C2-L_1_S49_L001_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "C2-L_1_S49_L001_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21696978"
gz1="$(_compress_if_exists 'SRR21696978_1' || true)"
gz2="$(_compress_if_exists 'SRR21696978_2' || true)"
gzs="$(_compress_if_exists 'SRR21696978' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "C1-T_4_S44_L001_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "C1-T_4_S44_L001_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21696979"
gz1="$(_compress_if_exists 'SRR21696979_1' || true)"
gz2="$(_compress_if_exists 'SRR21696979_2' || true)"
gzs="$(_compress_if_exists 'SRR21696979' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "C1-T_3_S43_L001_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "C1-T_3_S43_L001_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21696980"
gz1="$(_compress_if_exists 'SRR21696980_1' || true)"
gz2="$(_compress_if_exists 'SRR21696980_2' || true)"
gzs="$(_compress_if_exists 'SRR21696980' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "C1-T_2_S42_L001_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "C1-T_2_S42_L001_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21696981"
gz1="$(_compress_if_exists 'SRR21696981_1' || true)"
gz2="$(_compress_if_exists 'SRR21696981_2' || true)"
gzs="$(_compress_if_exists 'SRR21696981' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "C1-T_1_S41_L001_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "C1-T_1_S41_L001_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21696982"
gz1="$(_compress_if_exists 'SRR21696982_1' || true)"
gz2="$(_compress_if_exists 'SRR21696982_2' || true)"
gzs="$(_compress_if_exists 'SRR21696982' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "C1-L_4_S40_L001_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "C1-L_4_S40_L001_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21696983"
gz1="$(_compress_if_exists 'SRR21696983_1' || true)"
gz2="$(_compress_if_exists 'SRR21696983_2' || true)"
gzs="$(_compress_if_exists 'SRR21696983' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "C1-L_3_S39_L001_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "C1-L_3_S39_L001_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21696984"
gz1="$(_compress_if_exists 'SRR21696984_1' || true)"
gz2="$(_compress_if_exists 'SRR21696984_2' || true)"
gzs="$(_compress_if_exists 'SRR21696984' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "C1-L_2_S38_L001_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "C1-L_2_S38_L001_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21696985"
gz1="$(_compress_if_exists 'SRR21696985_1' || true)"
gz2="$(_compress_if_exists 'SRR21696985_2' || true)"
gzs="$(_compress_if_exists 'SRR21696985' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "C1-L_1_S37_L001_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "C1-L_1_S37_L001_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21696986"
gz1="$(_compress_if_exists 'SRR21696986_1' || true)"
gz2="$(_compress_if_exists 'SRR21696986_2' || true)"
gzs="$(_compress_if_exists 'SRR21696986' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "71-T_4_S32_L001_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "71-T_4_S32_L001_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21696987"
gz1="$(_compress_if_exists 'SRR21696987_1' || true)"
gz2="$(_compress_if_exists 'SRR21696987_2' || true)"
gzs="$(_compress_if_exists 'SRR21696987' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "71-T_3_S31_L001_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "71-T_3_S31_L001_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21696988"
gz1="$(_compress_if_exists 'SRR21696988_1' || true)"
gz2="$(_compress_if_exists 'SRR21696988_2' || true)"
gzs="$(_compress_if_exists 'SRR21696988' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "71-T_2_S30_L001_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "71-T_2_S30_L001_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21696989"
gz1="$(_compress_if_exists 'SRR21696989_1' || true)"
gz2="$(_compress_if_exists 'SRR21696989_2' || true)"
gzs="$(_compress_if_exists 'SRR21696989' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "71-T_1_S29_L001_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "71-T_1_S29_L001_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21696990"
gz1="$(_compress_if_exists 'SRR21696990_1' || true)"
gz2="$(_compress_if_exists 'SRR21696990_2' || true)"
gzs="$(_compress_if_exists 'SRR21696990' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "71-L_4_S28_L001_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "71-L_4_S28_L001_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21696991"
gz1="$(_compress_if_exists 'SRR21696991_1' || true)"
gz2="$(_compress_if_exists 'SRR21696991_2' || true)"
gzs="$(_compress_if_exists 'SRR21696991' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "71-L_3_S27_L001_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "71-L_3_S27_L001_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21696992"
gz1="$(_compress_if_exists 'SRR21696992_1' || true)"
gz2="$(_compress_if_exists 'SRR21696992_2' || true)"
gzs="$(_compress_if_exists 'SRR21696992' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "71-L_2_S26_L001_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "71-L_2_S26_L001_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21696993"
gz1="$(_compress_if_exists 'SRR21696993_1' || true)"
gz2="$(_compress_if_exists 'SRR21696993_2' || true)"
gzs="$(_compress_if_exists 'SRR21696993' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "71-L_1_S25_L001_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "71-L_1_S25_L001_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21696994"
gz1="$(_compress_if_exists 'SRR21696994_1' || true)"
gz2="$(_compress_if_exists 'SRR21696994_2' || true)"
gzs="$(_compress_if_exists 'SRR21696994' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "66-T_4_S20_L001_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "66-T_4_S20_L001_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21696995"
gz1="$(_compress_if_exists 'SRR21696995_1' || true)"
gz2="$(_compress_if_exists 'SRR21696995_2' || true)"
gzs="$(_compress_if_exists 'SRR21696995' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "66-T_3_S19_L001_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "66-T_3_S19_L001_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21696996"
gz1="$(_compress_if_exists 'SRR21696996_1' || true)"
gz2="$(_compress_if_exists 'SRR21696996_2' || true)"
gzs="$(_compress_if_exists 'SRR21696996' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "66-T_2_S18_L001_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "66-T_2_S18_L001_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21696997"
gz1="$(_compress_if_exists 'SRR21696997_1' || true)"
gz2="$(_compress_if_exists 'SRR21696997_2' || true)"
gzs="$(_compress_if_exists 'SRR21696997' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "66-T_1_S17_L001_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "66-T_1_S17_L001_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21696998"
gz1="$(_compress_if_exists 'SRR21696998_1' || true)"
gz2="$(_compress_if_exists 'SRR21696998_2' || true)"
gzs="$(_compress_if_exists 'SRR21696998' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "66-L_4_S16_L001_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "66-L_4_S16_L001_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21696999"
gz1="$(_compress_if_exists 'SRR21696999_1' || true)"
gz2="$(_compress_if_exists 'SRR21696999_2' || true)"
gzs="$(_compress_if_exists 'SRR21696999' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "66-L_3_S15_L001_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "66-L_3_S15_L001_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21697000"
gz1="$(_compress_if_exists 'SRR21697000_1' || true)"
gz2="$(_compress_if_exists 'SRR21697000_2' || true)"
gzs="$(_compress_if_exists 'SRR21697000' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "66-L_2_S14_L001_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "66-L_2_S14_L001_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21697001"
gz1="$(_compress_if_exists 'SRR21697001_1' || true)"
gz2="$(_compress_if_exists 'SRR21697001_2' || true)"
gzs="$(_compress_if_exists 'SRR21697001' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "66-L_1_S13_L001_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "66-L_1_S13_L001_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21697002"
gz1="$(_compress_if_exists 'SRR21697002_1' || true)"
gz2="$(_compress_if_exists 'SRR21697002_2' || true)"
gzs="$(_compress_if_exists 'SRR21697002' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "109-T_4_S8_L001_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "109-T_4_S8_L001_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21697003"
gz1="$(_compress_if_exists 'SRR21697003_1' || true)"
gz2="$(_compress_if_exists 'SRR21697003_2' || true)"
gzs="$(_compress_if_exists 'SRR21697003' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "109-T_3_S7_L001_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "109-T_3_S7_L001_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21697004"
gz1="$(_compress_if_exists 'SRR21697004_1' || true)"
gz2="$(_compress_if_exists 'SRR21697004_2' || true)"
gzs="$(_compress_if_exists 'SRR21697004' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "109-T_2_S6_L001_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "109-T_2_S6_L001_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21697005"
gz1="$(_compress_if_exists 'SRR21697005_1' || true)"
gz2="$(_compress_if_exists 'SRR21697005_2' || true)"
gzs="$(_compress_if_exists 'SRR21697005' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "109-T_1_S5_L001_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "109-T_1_S5_L001_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21697006"
gz1="$(_compress_if_exists 'SRR21697006_1' || true)"
gz2="$(_compress_if_exists 'SRR21697006_2' || true)"
gzs="$(_compress_if_exists 'SRR21697006' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "109-L_4_S4_L001_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "109-L_4_S4_L001_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21697007"
gz1="$(_compress_if_exists 'SRR21697007_1' || true)"
gz2="$(_compress_if_exists 'SRR21697007_2' || true)"
gzs="$(_compress_if_exists 'SRR21697007' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "109-L_3_S3_L001_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "109-L_3_S3_L001_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21697008"
gz1="$(_compress_if_exists 'SRR21697008_1' || true)"
gz2="$(_compress_if_exists 'SRR21697008_2' || true)"
gzs="$(_compress_if_exists 'SRR21697008' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "109-L_2_S2_L001_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "109-L_2_S2_L001_R2_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21697009"
gz1="$(_compress_if_exists 'SRR21697009_1' || true)"
gz2="$(_compress_if_exists 'SRR21697009_2' || true)"
gzs="$(_compress_if_exists 'SRR21697009' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "109-L_1_S1_L001_R1_001.fastq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "109-L_1_S1_L001_R2_001.fastq.gz"
fi


# Option B: Direct download (larger .sra files)
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696962/SRR21696962"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696963/SRR21696963"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696964/SRR21696964"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696965/SRR21696965"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696966/SRR21696966"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696967/SRR21696967"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696968/SRR21696968"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696969/SRR21696969"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696970/SRR21696970"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696971/SRR21696971"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696972/SRR21696972"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696973/SRR21696973"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696974/SRR21696974"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696975/SRR21696975"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696976/SRR21696976"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696977/SRR21696977"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696978/SRR21696978"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696979/SRR21696979"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696980/SRR21696980"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696981/SRR21696981"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696982/SRR21696982"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696983/SRR21696983"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696984/SRR21696984"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696985/SRR21696985"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696986/SRR21696986"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696987/SRR21696987"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696988/SRR21696988"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696989/SRR21696989"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696990/SRR21696990"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696991/SRR21696991"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696992/SRR21696992"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696993/SRR21696993"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696994/SRR21696994"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696995/SRR21696995"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696996/SRR21696996"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696997/SRR21696997"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696998/SRR21696998"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696999/SRR21696999"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21697000/SRR21697000"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21697001/SRR21697001"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21697002/SRR21697002"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21697003/SRR21697003"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21697004/SRR21697004"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21697005/SRR21697005"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21697006/SRR21697006"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21697007/SRR21697007"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21697008/SRR21697008"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21697009/SRR21697009"

# --- Additional data files ---
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21697009/SRR21697009"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21697008/SRR21697008"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21697007/SRR21697007"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21697006/SRR21697006"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21697005/SRR21697005"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21697004/SRR21697004"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21697003/SRR21697003"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21697002/SRR21697002"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21697001/SRR21697001"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21697000/SRR21697000"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696999/SRR21696999"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696998/SRR21696998"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696997/SRR21696997"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696996/SRR21696996"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696995/SRR21696995"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696994/SRR21696994"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696993/SRR21696993"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696992/SRR21696992"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696991/SRR21696991"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696990/SRR21696990"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696989/SRR21696989"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696988/SRR21696988"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696987/SRR21696987"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696986/SRR21696986"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696985/SRR21696985"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696984/SRR21696984"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696983/SRR21696983"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696982/SRR21696982"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696981/SRR21696981"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696980/SRR21696980"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696979/SRR21696979"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696978/SRR21696978"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696977/SRR21696977"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696976/SRR21696976"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696975/SRR21696975"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696974/SRR21696974"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696973/SRR21696973"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696972/SRR21696972"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696971/SRR21696971"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696970/SRR21696970"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696969/SRR21696969"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696968/SRR21696968"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696967/SRR21696967"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696966/SRR21696966"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696965/SRR21696965"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696964/SRR21696964"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696963/SRR21696963"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21696962/SRR21696962"
curl -L -O -C - "https://sra-downloadb.be-md.ncbi.nlm.nih.gov/sos4/sra-pub-zq-3/SRR021/21696/SRR21696966/SRR21696966.lite.1"

echo "Download complete. Files saved to $OUTDIR"