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

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

# --- GEO supplementary files ---
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE213nnn/GSE213867/suppl/GSE213867_EIF2B5.reproducible_enriched_re.tsv.gz" -O "GSE213867_EIF2B5.reproducible_enriched_re.tsv.gz"
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE213nnn/GSE213867/suppl/GSE213867_EIF2B5.reproducible_enriched_windows.tsv.gz" -O "GSE213867_EIF2B5.reproducible_enriched_windows.tsv.gz"
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE213nnn/GSE213867/suppl/GSE213867_EIF2D.reproducible_enriched_re.tsv.gz" -O "GSE213867_EIF2D.reproducible_enriched_re.tsv.gz"
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE213nnn/GSE213867/suppl/GSE213867_EIF2D.reproducible_enriched_windows.tsv.gz" -O "GSE213867_EIF2D.reproducible_enriched_windows.tsv.gz"
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE213nnn/GSE213867/suppl/GSE213867_EIF2S2.reproducible_enriched_re.tsv.gz" -O "GSE213867_EIF2S2.reproducible_enriched_re.tsv.gz"
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE213nnn/GSE213867/suppl/GSE213867_EIF2S2.reproducible_enriched_windows.tsv.gz" -O "GSE213867_EIF2S2.reproducible_enriched_windows.tsv.gz"
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE213nnn/GSE213867/suppl/GSE213867_EIF3J.reproducible_enriched_re.tsv.gz" -O "GSE213867_EIF3J.reproducible_enriched_re.tsv.gz"
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE213nnn/GSE213867/suppl/GSE213867_EIF3J.reproducible_enriched_windows.tsv.gz" -O "GSE213867_EIF3J.reproducible_enriched_windows.tsv.gz"
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE213nnn/GSE213867/suppl/GSE213867_RPL29.reproducible_enriched_re.tsv.gz" -O "GSE213867_RPL29.reproducible_enriched_re.tsv.gz"
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE213nnn/GSE213867/suppl/GSE213867_RPL29.reproducible_enriched_windows.tsv.gz" -O "GSE213867_RPL29.reproducible_enriched_windows.tsv.gz"
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE213nnn/GSE213867/suppl/GSE213867_RPL35A.reproducible_enriched_re.tsv.gz" -O "GSE213867_RPL35A.reproducible_enriched_re.tsv.gz"
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE213nnn/GSE213867/suppl/GSE213867_RPL35A.reproducible_enriched_windows.tsv.gz" -O "GSE213867_RPL35A.reproducible_enriched_windows.tsv.gz"
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE213nnn/GSE213867/suppl/GSE213867_RPS14.reproducible_enriched_re.tsv.gz" -O "GSE213867_RPS14.reproducible_enriched_re.tsv.gz"
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE213nnn/GSE213867/suppl/GSE213867_RPS14.reproducible_enriched_windows.tsv.gz" -O "GSE213867_RPS14.reproducible_enriched_windows.tsv.gz"
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE213nnn/GSE213867/suppl/GSE213867_RPS19.reproducible_enriched_re.tsv.gz" -O "GSE213867_RPS19.reproducible_enriched_re.tsv.gz"
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE213nnn/GSE213867/suppl/GSE213867_RPS19.reproducible_enriched_windows.tsv.gz" -O "GSE213867_RPS19.reproducible_enriched_windows.tsv.gz"
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE213nnn/GSE213867/suppl/GSE213867_RPS3A.reproducible_enriched_re.tsv.gz" -O "GSE213867_RPS3A.reproducible_enriched_re.tsv.gz"
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE213nnn/GSE213867/suppl/GSE213867_RPS3A.reproducible_enriched_windows.tsv.gz" -O "GSE213867_RPS3A.reproducible_enriched_windows.tsv.gz"
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE213nnn/GSE213867/suppl/GSE213867_all.75nt_recentered_windows.bed.gz" -O "GSE213867_all.75nt_recentered_windows.bed.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 "SRR21658955"
gz1="$(_compress_if_exists 'SRR21658955_1' || true)"
gz2="$(_compress_if_exists 'SRR21658955_2' || true)"
gzs="$(_compress_if_exists 'SRR21658955' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "EIF3J-In2_S44_L002_R1_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21658956"
gz1="$(_compress_if_exists 'SRR21658956_1' || true)"
gz2="$(_compress_if_exists 'SRR21658956_2' || true)"
gzs="$(_compress_if_exists 'SRR21658956' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "EIF3J-In1_S43_L002_R1_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21658957"
gz1="$(_compress_if_exists 'SRR21658957_1' || true)"
gz2="$(_compress_if_exists 'SRR21658957_2' || true)"
gzs="$(_compress_if_exists 'SRR21658957' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "EIF2S3-IN2-_S14_L001_R1_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21658958"
gz1="$(_compress_if_exists 'SRR21658958_1' || true)"
gz2="$(_compress_if_exists 'SRR21658958_2' || true)"
gzs="$(_compress_if_exists 'SRR21658958' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "EIF2S3-IN2-_S14_L002_R1_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21658959"
gz1="$(_compress_if_exists 'SRR21658959_1' || true)"
gz2="$(_compress_if_exists 'SRR21658959_2' || true)"
gzs="$(_compress_if_exists 'SRR21658959' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "EIF2S2--IN1-_S13_L001_R1_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21658960"
gz1="$(_compress_if_exists 'SRR21658960_1' || true)"
gz2="$(_compress_if_exists 'SRR21658960_2' || true)"
gzs="$(_compress_if_exists 'SRR21658960' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "EIF2S2--IN1-_S13_L002_R1_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21658961"
gz1="$(_compress_if_exists 'SRR21658961_1' || true)"
gz2="$(_compress_if_exists 'SRR21658961_2' || true)"
gzs="$(_compress_if_exists 'SRR21658961' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "EIF2D--IN2_S10_L001_R1_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21658962"
gz1="$(_compress_if_exists 'SRR21658962_1' || true)"
gz2="$(_compress_if_exists 'SRR21658962_2' || true)"
gzs="$(_compress_if_exists 'SRR21658962' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "EIF2D--IN2_S10_L002_R1_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21658963"
gz1="$(_compress_if_exists 'SRR21658963_1' || true)"
gz2="$(_compress_if_exists 'SRR21658963_2' || true)"
gzs="$(_compress_if_exists 'SRR21658963' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "EIF2D--IN1-_S9_L001_R1_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21658964"
gz1="$(_compress_if_exists 'SRR21658964_1' || true)"
gz2="$(_compress_if_exists 'SRR21658964_2' || true)"
gzs="$(_compress_if_exists 'SRR21658964' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "EIF2D--IN1-_S9_L002_R1_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21658965"
gz1="$(_compress_if_exists 'SRR21658965_1' || true)"
gz2="$(_compress_if_exists 'SRR21658965_2' || true)"
gzs="$(_compress_if_exists 'SRR21658965' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "EIF2B5-IN2_S2_L001_R1_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21658966"
gz1="$(_compress_if_exists 'SRR21658966_1' || true)"
gz2="$(_compress_if_exists 'SRR21658966_2' || true)"
gzs="$(_compress_if_exists 'SRR21658966' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "EIF2B5-IN2_S2_L002_R1_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21658967"
gz1="$(_compress_if_exists 'SRR21658967_1' || true)"
gz2="$(_compress_if_exists 'SRR21658967_2' || true)"
gzs="$(_compress_if_exists 'SRR21658967' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "EIF2B5-IN1_S1_L001_R1_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21658968"
gz1="$(_compress_if_exists 'SRR21658968_1' || true)"
gz2="$(_compress_if_exists 'SRR21658968_2' || true)"
gzs="$(_compress_if_exists 'SRR21658968' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "EIF2B5-IN1_S1_L002_R1_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21658969"
gz1="$(_compress_if_exists 'SRR21658969_1' || true)"
gz2="$(_compress_if_exists 'SRR21658969_2' || true)"
gzs="$(_compress_if_exists 'SRR21658969' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "RPS19_IN2_S6_L001_R1_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21658970"
gz1="$(_compress_if_exists 'SRR21658970_1' || true)"
gz2="$(_compress_if_exists 'SRR21658970_2' || true)"
gzs="$(_compress_if_exists 'SRR21658970' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "RPS19_IN1_S5_L001_R1_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21658971"
gz1="$(_compress_if_exists 'SRR21658971_1' || true)"
gz2="$(_compress_if_exists 'SRR21658971_2' || true)"
gzs="$(_compress_if_exists 'SRR21658971' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "RPL29_IN2_S22_L001_R1_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21658972"
gz1="$(_compress_if_exists 'SRR21658972_1' || true)"
gz2="$(_compress_if_exists 'SRR21658972_2' || true)"
gzs="$(_compress_if_exists 'SRR21658972' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "RPL29_IN1_S21_L001_R1_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21658973"
gz1="$(_compress_if_exists 'SRR21658973_1' || true)"
gz2="$(_compress_if_exists 'SRR21658973_2' || true)"
gzs="$(_compress_if_exists 'SRR21658973' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "RPS3A_IN2_S26_L001_R1_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21658974"
gz1="$(_compress_if_exists 'SRR21658974_1' || true)"
gz2="$(_compress_if_exists 'SRR21658974_2' || true)"
gzs="$(_compress_if_exists 'SRR21658974' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "RPS3A_IN1_S25_L001_R1_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21658975"
gz1="$(_compress_if_exists 'SRR21658975_1' || true)"
gz2="$(_compress_if_exists 'SRR21658975_2' || true)"
gzs="$(_compress_if_exists 'SRR21658975' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "RPL35A_IN2_S30_L001_R1_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21658976"
gz1="$(_compress_if_exists 'SRR21658976_1' || true)"
gz2="$(_compress_if_exists 'SRR21658976_2' || true)"
gzs="$(_compress_if_exists 'SRR21658976' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "RPL35A_IN1_S29_L001_R1_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21658977"
gz1="$(_compress_if_exists 'SRR21658977_1' || true)"
gz2="$(_compress_if_exists 'SRR21658977_2' || true)"
gzs="$(_compress_if_exists 'SRR21658977' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "IN2_RPS14_S23_L001_R1_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21658978"
gz1="$(_compress_if_exists 'SRR21658978_1' || true)"
gz2="$(_compress_if_exists 'SRR21658978_2' || true)"
gzs="$(_compress_if_exists 'SRR21658978' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "IN1_RPS14_S22_L001_R1_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21658979"
gz1="$(_compress_if_exists 'SRR21658979_1' || true)"
gz2="$(_compress_if_exists 'SRR21658979_2' || true)"
gzs="$(_compress_if_exists 'SRR21658979' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "EIF3J-IP2_S46_L002_R1_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21658980"
gz1="$(_compress_if_exists 'SRR21658980_1' || true)"
gz2="$(_compress_if_exists 'SRR21658980_2' || true)"
gzs="$(_compress_if_exists 'SRR21658980' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "EIF3J-IP1_S45_L002_R1_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21658981"
gz1="$(_compress_if_exists 'SRR21658981_1' || true)"
gz2="$(_compress_if_exists 'SRR21658981_2' || true)"
gzs="$(_compress_if_exists 'SRR21658981' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "EIF2S5-IP2-_S16_L001_R1_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21658982"
gz1="$(_compress_if_exists 'SRR21658982_1' || true)"
gz2="$(_compress_if_exists 'SRR21658982_2' || true)"
gzs="$(_compress_if_exists 'SRR21658982' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "EIF2S5-IP2-_S16_L002_R1_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21658983"
gz1="$(_compress_if_exists 'SRR21658983_1' || true)"
gz2="$(_compress_if_exists 'SRR21658983_2' || true)"
gzs="$(_compress_if_exists 'SRR21658983' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "EIF2S4-IP1-_S15_L001_R1_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21658984"
gz1="$(_compress_if_exists 'SRR21658984_1' || true)"
gz2="$(_compress_if_exists 'SRR21658984_2' || true)"
gzs="$(_compress_if_exists 'SRR21658984' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "EIF2S4-IP1-_S15_L002_R1_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21658985"
gz1="$(_compress_if_exists 'SRR21658985_1' || true)"
gz2="$(_compress_if_exists 'SRR21658985_2' || true)"
gzs="$(_compress_if_exists 'SRR21658985' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "EIF2D--IP2-_S12_L001_R1_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21658986"
gz1="$(_compress_if_exists 'SRR21658986_1' || true)"
gz2="$(_compress_if_exists 'SRR21658986_2' || true)"
gzs="$(_compress_if_exists 'SRR21658986' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "EIF2D--IP2-_S12_L002_R1_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21658987"
gz1="$(_compress_if_exists 'SRR21658987_1' || true)"
gz2="$(_compress_if_exists 'SRR21658987_2' || true)"
gzs="$(_compress_if_exists 'SRR21658987' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "EIF2D--IP1-_S11_L001_R1_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21658988"
gz1="$(_compress_if_exists 'SRR21658988_1' || true)"
gz2="$(_compress_if_exists 'SRR21658988_2' || true)"
gzs="$(_compress_if_exists 'SRR21658988' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "EIF2D--IP1-_S11_L002_R1_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21658989"
gz1="$(_compress_if_exists 'SRR21658989_1' || true)"
gz2="$(_compress_if_exists 'SRR21658989_2' || true)"
gzs="$(_compress_if_exists 'SRR21658989' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "EIF2B5-IP2-_S4_L001_R1_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21658990"
gz1="$(_compress_if_exists 'SRR21658990_1' || true)"
gz2="$(_compress_if_exists 'SRR21658990_2' || true)"
gzs="$(_compress_if_exists 'SRR21658990' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "EIF2B5-IP2-_S4_L002_R1_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21658991"
gz1="$(_compress_if_exists 'SRR21658991_1' || true)"
gz2="$(_compress_if_exists 'SRR21658991_2' || true)"
gzs="$(_compress_if_exists 'SRR21658991' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "EIF2B5-IP1-_S3_L001_R1_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21658992"
gz1="$(_compress_if_exists 'SRR21658992_1' || true)"
gz2="$(_compress_if_exists 'SRR21658992_2' || true)"
gzs="$(_compress_if_exists 'SRR21658992' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "EIF2B5-IP1-_S3_L002_R1_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21658993"
gz1="$(_compress_if_exists 'SRR21658993_1' || true)"
gz2="$(_compress_if_exists 'SRR21658993_2' || true)"
gzs="$(_compress_if_exists 'SRR21658993' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "RPS19_IP2_S14_L001_R1_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21658994"
gz1="$(_compress_if_exists 'SRR21658994_1' || true)"
gz2="$(_compress_if_exists 'SRR21658994_2' || true)"
gzs="$(_compress_if_exists 'SRR21658994' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "RPS19_IP1_S13_L001_R1_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21658995"
gz1="$(_compress_if_exists 'SRR21658995_1' || true)"
gz2="$(_compress_if_exists 'SRR21658995_2' || true)"
gzs="$(_compress_if_exists 'SRR21658995' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "RPL29_IP2_S24_L001_R1_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21658996"
gz1="$(_compress_if_exists 'SRR21658996_1' || true)"
gz2="$(_compress_if_exists 'SRR21658996_2' || true)"
gzs="$(_compress_if_exists 'SRR21658996' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "RPL29_IP1_S23_L001_R1_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21658997"
gz1="$(_compress_if_exists 'SRR21658997_1' || true)"
gz2="$(_compress_if_exists 'SRR21658997_2' || true)"
gzs="$(_compress_if_exists 'SRR21658997' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "RPS3A_IP2_S28_L001_R1_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21658998"
gz1="$(_compress_if_exists 'SRR21658998_1' || true)"
gz2="$(_compress_if_exists 'SRR21658998_2' || true)"
gzs="$(_compress_if_exists 'SRR21658998' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "RPS3A_IP1_S27_L001_R1_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21658999"
gz1="$(_compress_if_exists 'SRR21658999_1' || true)"
gz2="$(_compress_if_exists 'SRR21658999_2' || true)"
gzs="$(_compress_if_exists 'SRR21658999' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "RPL35A_IP2_S32_L001_R1_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21659000"
gz1="$(_compress_if_exists 'SRR21659000_1' || true)"
gz2="$(_compress_if_exists 'SRR21659000_2' || true)"
gzs="$(_compress_if_exists 'SRR21659000' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "RPL35A_IP1_S31_L001_R1_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21659001"
gz1="$(_compress_if_exists 'SRR21659001_1' || true)"
gz2="$(_compress_if_exists 'SRR21659001_2' || true)"
gzs="$(_compress_if_exists 'SRR21659001' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "IP2_RPS14_S25_L001_R1_001.fastq.gz"
fi

fasterq-dump --split-files "SRR21659002"
gz1="$(_compress_if_exists 'SRR21659002_1' || true)"
gz2="$(_compress_if_exists 'SRR21659002_2' || true)"
gzs="$(_compress_if_exists 'SRR21659002' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "IP1_RPS14_S24_L001_R1_001.fastq.gz"
fi


# Option B: Direct download (larger .sra files)
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658955/SRR21658955"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658956/SRR21658956"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658957/SRR21658957"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658958/SRR21658958"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658959/SRR21658959"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658960/SRR21658960"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658961/SRR21658961"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658962/SRR21658962"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658963/SRR21658963"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658964/SRR21658964"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658965/SRR21658965"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658966/SRR21658966"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658967/SRR21658967"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658968/SRR21658968"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658969/SRR21658969"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658970/SRR21658970"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658971/SRR21658971"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658972/SRR21658972"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658973/SRR21658973"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658974/SRR21658974"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658975/SRR21658975"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658976/SRR21658976"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658977/SRR21658977"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658978/SRR21658978"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658979/SRR21658979"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658980/SRR21658980"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658981/SRR21658981"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658982/SRR21658982"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658983/SRR21658983"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658984/SRR21658984"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658985/SRR21658985"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658986/SRR21658986"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658987/SRR21658987"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658988/SRR21658988"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658989/SRR21658989"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658990/SRR21658990"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658991/SRR21658991"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658992/SRR21658992"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658993/SRR21658993"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658994/SRR21658994"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658995/SRR21658995"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658996/SRR21658996"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658997/SRR21658997"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658998/SRR21658998"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658999/SRR21658999"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21659000/SRR21659000"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21659001/SRR21659001"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21659002/SRR21659002"

# --- Additional data files ---
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658967/SRR21658967"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658968/SRR21658968"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658965/SRR21658965"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658966/SRR21658966"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658991/SRR21658991"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658992/SRR21658992"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658989/SRR21658989"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658990/SRR21658990"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658963/SRR21658963"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658964/SRR21658964"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658961/SRR21658961"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658962/SRR21658962"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658987/SRR21658987"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658988/SRR21658988"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658985/SRR21658985"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658986/SRR21658986"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658959/SRR21658959"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658960/SRR21658960"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658957/SRR21658957"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658958/SRR21658958"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658983/SRR21658983"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658984/SRR21658984"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658981/SRR21658981"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658982/SRR21658982"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658956/SRR21658956"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658955/SRR21658955"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658980/SRR21658980"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658979/SRR21658979"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658978/SRR21658978"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658977/SRR21658977"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21659002/SRR21659002"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21659001/SRR21659001"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658972/SRR21658972"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658971/SRR21658971"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658996/SRR21658996"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658995/SRR21658995"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658976/SRR21658976"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658975/SRR21658975"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21659000/SRR21659000"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658999/SRR21658999"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658970/SRR21658970"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658969/SRR21658969"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658994/SRR21658994"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658993/SRR21658993"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658974/SRR21658974"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658973/SRR21658973"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658998/SRR21658998"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR21658997/SRR21658997"

echo "Download complete. Files saved to $OUTDIR"