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

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

# --- GEO supplementary files ---
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE220nnn/GSE220459/suppl/GSE220459_NPC_TPM.xlsx" -O "GSE220459_NPC_TPM.xlsx"

# --- 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 "SRR22570245"
gz1="$(_compress_if_exists 'SRR22570245_1' || true)"
gz2="$(_compress_if_exists 'SRR22570245_2' || true)"
gzs="$(_compress_if_exists 'SRR22570245' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "UP_C9_CKDL220004752-1a-19_HHJWLBBXX_L1_1.fq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "UP_C9_CKDL220004752-1a-19_HHJWLBBXX_L1_2.fq.gz"
fi

fasterq-dump --split-files "SRR22570246"
gz1="$(_compress_if_exists 'SRR22570246_1' || true)"
gz2="$(_compress_if_exists 'SRR22570246_2' || true)"
gzs="$(_compress_if_exists 'SRR22570246' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "UP_C9_CKDL220004752-1a-19_HHJT3BBXX_L8_1.fq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "UP_C9_CKDL220004752-1a-19_HHJT3BBXX_L8_2.fq.gz"
fi

fasterq-dump --split-files "SRR22570247"
gz1="$(_compress_if_exists 'SRR22570247_1' || true)"
gz2="$(_compress_if_exists 'SRR22570247_2' || true)"
gzs="$(_compress_if_exists 'SRR22570247' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "UP_C8_CKDL220004752-1a-14_HHJWLBBXX_L1_1.fq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "UP_C8_CKDL220004752-1a-14_HHJWLBBXX_L1_2.fq.gz"
fi

fasterq-dump --split-files "SRR22570248"
gz1="$(_compress_if_exists 'SRR22570248_1' || true)"
gz2="$(_compress_if_exists 'SRR22570248_2' || true)"
gzs="$(_compress_if_exists 'SRR22570248' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "UP_C8_CKDL220004752-1a-14_HHJT3BBXX_L8_1.fq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "UP_C8_CKDL220004752-1a-14_HHJT3BBXX_L8_2.fq.gz"
fi

fasterq-dump --split-files "SRR22570249"
gz1="$(_compress_if_exists 'SRR22570249_1' || true)"
gz2="$(_compress_if_exists 'SRR22570249_2' || true)"
gzs="$(_compress_if_exists 'SRR22570249' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "UP_C6_CKDL220004752-1a-6_HHJWLBBXX_L1_1.fq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "UP_C6_CKDL220004752-1a-6_HHJWLBBXX_L1_2.fq.gz"
fi

fasterq-dump --split-files "SRR22570250"
gz1="$(_compress_if_exists 'SRR22570250_1' || true)"
gz2="$(_compress_if_exists 'SRR22570250_2' || true)"
gzs="$(_compress_if_exists 'SRR22570250' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "UP_C6_CKDL220004752-1a-6_HHJT3BBXX_L8_1.fq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "UP_C6_CKDL220004752-1a-6_HHJT3BBXX_L8_2.fq.gz"
fi

fasterq-dump --split-files "SRR22570251"
gz1="$(_compress_if_exists 'SRR22570251_1' || true)"
gz2="$(_compress_if_exists 'SRR22570251_2' || true)"
gzs="$(_compress_if_exists 'SRR22570251' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "UP_C5_CKDL220004752-1a-27_HHJWLBBXX_L1_1.fq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "UP_C5_CKDL220004752-1a-27_HHJWLBBXX_L1_2.fq.gz"
fi

fasterq-dump --split-files "SRR22570252"
gz1="$(_compress_if_exists 'SRR22570252_1' || true)"
gz2="$(_compress_if_exists 'SRR22570252_2' || true)"
gzs="$(_compress_if_exists 'SRR22570252' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "UP_C5_CKDL220004752-1a-27_HHJT3BBXX_L8_1.fq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "UP_C5_CKDL220004752-1a-27_HHJT3BBXX_L8_2.fq.gz"
fi

fasterq-dump --split-files "SRR22570253"
gz1="$(_compress_if_exists 'SRR22570253_1' || true)"
gz2="$(_compress_if_exists 'SRR22570253_2' || true)"
gzs="$(_compress_if_exists 'SRR22570253' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "UP_C4_CKDL220004752-1a-21_HHJWLBBXX_L1_1.fq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "UP_C4_CKDL220004752-1a-21_HHJWLBBXX_L1_2.fq.gz"
fi

fasterq-dump --split-files "SRR22570254"
gz1="$(_compress_if_exists 'SRR22570254_1' || true)"
gz2="$(_compress_if_exists 'SRR22570254_2' || true)"
gzs="$(_compress_if_exists 'SRR22570254' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "UP_C3_CKDL220004752-1a-9_HHJWLBBXX_L1_1.fq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "UP_C3_CKDL220004752-1a-9_HHJWLBBXX_L1_2.fq.gz"
fi

fasterq-dump --split-files "SRR22570255"
gz1="$(_compress_if_exists 'SRR22570255_1' || true)"
gz2="$(_compress_if_exists 'SRR22570255_2' || true)"
gzs="$(_compress_if_exists 'SRR22570255' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "UP_C3_CKDL220004752-1a-9_HHJT3BBXX_L8_1.fq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "UP_C3_CKDL220004752-1a-9_HHJT3BBXX_L8_2.fq.gz"
fi

fasterq-dump --split-files "SRR22570256"
gz1="$(_compress_if_exists 'SRR22570256_1' || true)"
gz2="$(_compress_if_exists 'SRR22570256_2' || true)"
gzs="$(_compress_if_exists 'SRR22570256' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "UM_9_CKDL220004752-1a-15_HHJWLBBXX_L1_1.fq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "UM_9_CKDL220004752-1a-15_HHJWLBBXX_L1_2.fq.gz"
fi

fasterq-dump --split-files "SRR22570257"
gz1="$(_compress_if_exists 'SRR22570257_1' || true)"
gz2="$(_compress_if_exists 'SRR22570257_2' || true)"
gzs="$(_compress_if_exists 'SRR22570257' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "UM_9_CKDL220004752-1a-15_HHJT3BBXX_L8_1.fq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "UM_9_CKDL220004752-1a-15_HHJT3BBXX_L8_2.fq.gz"
fi

fasterq-dump --split-files "SRR22570258"
gz1="$(_compress_if_exists 'SRR22570258_1' || true)"
gz2="$(_compress_if_exists 'SRR22570258_2' || true)"
gzs="$(_compress_if_exists 'SRR22570258' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "UP_C4_CKDL220004752-1a-21_HHJT3BBXX_L8_1.fq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "UP_C4_CKDL220004752-1a-21_HHJT3BBXX_L8_2.fq.gz"
fi

fasterq-dump --split-files "SRR22570259"
gz1="$(_compress_if_exists 'SRR22570259_1' || true)"
gz2="$(_compress_if_exists 'SRR22570259_2' || true)"
gzs="$(_compress_if_exists 'SRR22570259' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "UM_8_CKDL220004752-1a-7_HHJWLBBXX_L1_1.fq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "UM_8_CKDL220004752-1a-7_HHJWLBBXX_L1_2.fq.gz"
fi

fasterq-dump --split-files "SRR22570260"
gz1="$(_compress_if_exists 'SRR22570260_1' || true)"
gz2="$(_compress_if_exists 'SRR22570260_2' || true)"
gzs="$(_compress_if_exists 'SRR22570260' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "UM_8_CKDL220004752-1a-7_HHJT3BBXX_L8_1.fq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "UM_8_CKDL220004752-1a-7_HHJT3BBXX_L8_2.fq.gz"
fi

fasterq-dump --split-files "SRR22570261"
gz1="$(_compress_if_exists 'SRR22570261_1' || true)"
gz2="$(_compress_if_exists 'SRR22570261_2' || true)"
gzs="$(_compress_if_exists 'SRR22570261' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "UM_6_CKDL220004752-1a-2_HHJWLBBXX_L1_1.fq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "UM_6_CKDL220004752-1a-2_HHJWLBBXX_L1_2.fq.gz"
fi

fasterq-dump --split-files "SRR22570262"
gz1="$(_compress_if_exists 'SRR22570262_1' || true)"
gz2="$(_compress_if_exists 'SRR22570262_2' || true)"
gzs="$(_compress_if_exists 'SRR22570262' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "UM_6_CKDL220004752-1a-2_HHJT3BBXX_L8_1.fq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "UM_6_CKDL220004752-1a-2_HHJT3BBXX_L8_2.fq.gz"
fi

fasterq-dump --split-files "SRR22570263"
gz1="$(_compress_if_exists 'SRR22570263_1' || true)"
gz2="$(_compress_if_exists 'SRR22570263_2' || true)"
gzs="$(_compress_if_exists 'SRR22570263' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "UM_5_CKDL220004752-1a-22_HHJWLBBXX_L1_1.fq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "UM_5_CKDL220004752-1a-22_HHJWLBBXX_L1_2.fq.gz"
fi

fasterq-dump --split-files "SRR22570264"
gz1="$(_compress_if_exists 'SRR22570264_1' || true)"
gz2="$(_compress_if_exists 'SRR22570264_2' || true)"
gzs="$(_compress_if_exists 'SRR22570264' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "UM_5_CKDL220004752-1a-22_HHJT3BBXX_L8_1.fq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "UM_5_CKDL220004752-1a-22_HHJT3BBXX_L8_2.fq.gz"
fi

fasterq-dump --split-files "SRR22570265"
gz1="$(_compress_if_exists 'SRR22570265_1' || true)"
gz2="$(_compress_if_exists 'SRR22570265_2' || true)"
gzs="$(_compress_if_exists 'SRR22570265' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "UM_4_CKDL220004752-1a-10_HHJWLBBXX_L1_1.fq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "UM_4_CKDL220004752-1a-10_HHJWLBBXX_L1_2.fq.gz"
fi

fasterq-dump --split-files "SRR22570266"
gz1="$(_compress_if_exists 'SRR22570266_1' || true)"
gz2="$(_compress_if_exists 'SRR22570266_2' || true)"
gzs="$(_compress_if_exists 'SRR22570266' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "UM_4_CKDL220004752-1a-10_HHJT3BBXX_L8_1.fq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "UM_4_CKDL220004752-1a-10_HHJT3BBXX_L8_2.fq.gz"
fi

fasterq-dump --split-files "SRR22570267"
gz1="$(_compress_if_exists 'SRR22570267_1' || true)"
gz2="$(_compress_if_exists 'SRR22570267_2' || true)"
gzs="$(_compress_if_exists 'SRR22570267' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "UM_3_CKDL220004752-1a-1_HHJWLBBXX_L1_1.fq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "UM_3_CKDL220004752-1a-1_HHJWLBBXX_L1_2.fq.gz"
fi

fasterq-dump --split-files "SRR22570268"
gz1="$(_compress_if_exists 'SRR22570268_1' || true)"
gz2="$(_compress_if_exists 'SRR22570268_2' || true)"
gzs="$(_compress_if_exists 'SRR22570268' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "UC_9_CKDL220004752-1a-16_HHJWLBBXX_L1_1.fq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "UC_9_CKDL220004752-1a-16_HHJWLBBXX_L1_2.fq.gz"
fi

fasterq-dump --split-files "SRR22570269"
gz1="$(_compress_if_exists 'SRR22570269_1' || true)"
gz2="$(_compress_if_exists 'SRR22570269_2' || true)"
gzs="$(_compress_if_exists 'SRR22570269' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "UC_9_CKDL220004752-1a-16_HHJT3BBXX_L8_1.fq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "UC_9_CKDL220004752-1a-16_HHJT3BBXX_L8_2.fq.gz"
fi

fasterq-dump --split-files "SRR22570270"
gz1="$(_compress_if_exists 'SRR22570270_1' || true)"
gz2="$(_compress_if_exists 'SRR22570270_2' || true)"
gzs="$(_compress_if_exists 'SRR22570270' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "UC_8_CKDL220004752-1a-12_HHJWLBBXX_L1_1.fq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "UC_8_CKDL220004752-1a-12_HHJWLBBXX_L1_2.fq.gz"
fi

fasterq-dump --split-files "SRR22570271"
gz1="$(_compress_if_exists 'SRR22570271_1' || true)"
gz2="$(_compress_if_exists 'SRR22570271_2' || true)"
gzs="$(_compress_if_exists 'SRR22570271' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "UC_8_CKDL220004752-1a-12_HHJT3BBXX_L8_1.fq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "UC_8_CKDL220004752-1a-12_HHJT3BBXX_L8_2.fq.gz"
fi

fasterq-dump --split-files "SRR22570272"
gz1="$(_compress_if_exists 'SRR22570272_1' || true)"
gz2="$(_compress_if_exists 'SRR22570272_2' || true)"
gzs="$(_compress_if_exists 'SRR22570272' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "UM_3_CKDL220004752-1a-1_HHJT3BBXX_L8_1.fq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "UM_3_CKDL220004752-1a-1_HHJT3BBXX_L8_2.fq.gz"
fi

fasterq-dump --split-files "SRR22570273"
gz1="$(_compress_if_exists 'SRR22570273_1' || true)"
gz2="$(_compress_if_exists 'SRR22570273_2' || true)"
gzs="$(_compress_if_exists 'SRR22570273' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "UC_6_CKDL220004752-1a-4_HHJWLBBXX_L1_1.fq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "UC_6_CKDL220004752-1a-4_HHJWLBBXX_L1_2.fq.gz"
fi

fasterq-dump --split-files "SRR22570274"
gz1="$(_compress_if_exists 'SRR22570274_1' || true)"
gz2="$(_compress_if_exists 'SRR22570274_2' || true)"
gzs="$(_compress_if_exists 'SRR22570274' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "UC_6_CKDL220004752-1a-4_HHJT3BBXX_L8_1.fq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "UC_6_CKDL220004752-1a-4_HHJT3BBXX_L8_2.fq.gz"
fi

fasterq-dump --split-files "SRR22570275"
gz1="$(_compress_if_exists 'SRR22570275_1' || true)"
gz2="$(_compress_if_exists 'SRR22570275_2' || true)"
gzs="$(_compress_if_exists 'SRR22570275' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "UC_5_CKDL220004752-1a-23_HHJWLBBXX_L1_1.fq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "UC_5_CKDL220004752-1a-23_HHJWLBBXX_L1_2.fq.gz"
fi

fasterq-dump --split-files "SRR22570276"
gz1="$(_compress_if_exists 'SRR22570276_1' || true)"
gz2="$(_compress_if_exists 'SRR22570276_2' || true)"
gzs="$(_compress_if_exists 'SRR22570276' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "UC_5_CKDL220004752-1a-23_HHJT3BBXX_L8_1.fq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "UC_5_CKDL220004752-1a-23_HHJT3BBXX_L8_2.fq.gz"
fi

fasterq-dump --split-files "SRR22570277"
gz1="$(_compress_if_exists 'SRR22570277_1' || true)"
gz2="$(_compress_if_exists 'SRR22570277_2' || true)"
gzs="$(_compress_if_exists 'SRR22570277' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "UC_4_CKDL220004752-1a-11_HHJWLBBXX_L1_1.fq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "UC_4_CKDL220004752-1a-11_HHJWLBBXX_L1_2.fq.gz"
fi

fasterq-dump --split-files "SRR22570278"
gz1="$(_compress_if_exists 'SRR22570278_1' || true)"
gz2="$(_compress_if_exists 'SRR22570278_2' || true)"
gzs="$(_compress_if_exists 'SRR22570278' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "UC_4_CKDL220004752-1a-11_HHJT3BBXX_L8_1.fq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "UC_4_CKDL220004752-1a-11_HHJT3BBXX_L8_2.fq.gz"
fi

fasterq-dump --split-files "SRR22570279"
gz1="$(_compress_if_exists 'SRR22570279_1' || true)"
gz2="$(_compress_if_exists 'SRR22570279_2' || true)"
gzs="$(_compress_if_exists 'SRR22570279' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "UC_3_CKDL220004752-1a-3_HHJWLBBXX_L1_1.fq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "UC_3_CKDL220004752-1a-3_HHJWLBBXX_L1_2.fq.gz"
fi

fasterq-dump --split-files "SRR22570280"
gz1="$(_compress_if_exists 'SRR22570280_1' || true)"
gz2="$(_compress_if_exists 'SRR22570280_2' || true)"
gzs="$(_compress_if_exists 'SRR22570280' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "UC_3_CKDL220004752-1a-3_HHJT3BBXX_L8_1.fq.gz"
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" "UC_3_CKDL220004752-1a-3_HHJT3BBXX_L8_2.fq.gz"
fi


# Option B: Direct download (larger .sra files)
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570245/SRR22570245"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570246/SRR22570246"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570247/SRR22570247"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570248/SRR22570248"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570249/SRR22570249"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570250/SRR22570250"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570251/SRR22570251"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570252/SRR22570252"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570253/SRR22570253"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570254/SRR22570254"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570255/SRR22570255"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570256/SRR22570256"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570257/SRR22570257"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570258/SRR22570258"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570259/SRR22570259"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570260/SRR22570260"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570261/SRR22570261"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570262/SRR22570262"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570263/SRR22570263"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570264/SRR22570264"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570265/SRR22570265"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570266/SRR22570266"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570267/SRR22570267"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570268/SRR22570268"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570269/SRR22570269"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570270/SRR22570270"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570271/SRR22570271"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570272/SRR22570272"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570273/SRR22570273"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570274/SRR22570274"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570275/SRR22570275"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570276/SRR22570276"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570277/SRR22570277"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570278/SRR22570278"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570279/SRR22570279"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570280/SRR22570280"

# --- Additional data files ---
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570280/SRR22570280"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570279/SRR22570279"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570278/SRR22570278"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570277/SRR22570277"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570276/SRR22570276"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570275/SRR22570275"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570274/SRR22570274"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570273/SRR22570273"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570271/SRR22570271"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570270/SRR22570270"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570269/SRR22570269"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570268/SRR22570268"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570272/SRR22570272"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570267/SRR22570267"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570266/SRR22570266"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570265/SRR22570265"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570264/SRR22570264"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570263/SRR22570263"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570262/SRR22570262"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570261/SRR22570261"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570260/SRR22570260"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570259/SRR22570259"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570257/SRR22570257"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570256/SRR22570256"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570255/SRR22570255"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570254/SRR22570254"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570258/SRR22570258"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570253/SRR22570253"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570252/SRR22570252"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570251/SRR22570251"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570250/SRR22570250"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570249/SRR22570249"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570248/SRR22570248"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570247/SRR22570247"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570246/SRR22570246"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR22570245/SRR22570245"

echo "Download complete. Files saved to $OUTDIR"