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

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

# --- GEO supplementary files ---
wget -nc "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE157nnn/GSE157048/suppl/GSE157048_normed_heps.txt.gz" -O "GSE157048_normed_heps.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 "SRR12539766"
gz1="$(_compress_if_exists 'SRR12539766_1' || true)"
gz2="$(_compress_if_exists 'SRR12539766_2' || true)"
gzs="$(_compress_if_exists 'SRR12539766' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "WTUT_JVN7_S7_R1_001.fastq.gz"
fi

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

fasterq-dump --split-files "SRR12539830"
gz1="$(_compress_if_exists 'SRR12539830_1' || true)"
gz2="$(_compress_if_exists 'SRR12539830_2' || true)"
gzs="$(_compress_if_exists 'SRR12539830' || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" "AMPKIns_JVN33_S33_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/SRR12539766/SRR12539766"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539767/SRR12539767"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539768/SRR12539768"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539769/SRR12539769"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539770/SRR12539770"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539771/SRR12539771"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539772/SRR12539772"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539773/SRR12539773"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539774/SRR12539774"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539775/SRR12539775"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539776/SRR12539776"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539777/SRR12539777"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539778/SRR12539778"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539779/SRR12539779"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539780/SRR12539780"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539781/SRR12539781"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539782/SRR12539782"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539783/SRR12539783"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539784/SRR12539784"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539785/SRR12539785"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539786/SRR12539786"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539787/SRR12539787"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539788/SRR12539788"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539789/SRR12539789"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539790/SRR12539790"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539791/SRR12539791"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539792/SRR12539792"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539793/SRR12539793"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539794/SRR12539794"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539795/SRR12539795"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539796/SRR12539796"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539797/SRR12539797"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539798/SRR12539798"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539799/SRR12539799"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539800/SRR12539800"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539801/SRR12539801"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539802/SRR12539802"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539803/SRR12539803"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539804/SRR12539804"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539805/SRR12539805"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539806/SRR12539806"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539807/SRR12539807"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539808/SRR12539808"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539809/SRR12539809"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539810/SRR12539810"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539811/SRR12539811"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539812/SRR12539812"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539813/SRR12539813"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539814/SRR12539814"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539815/SRR12539815"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539816/SRR12539816"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539817/SRR12539817"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539818/SRR12539818"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539819/SRR12539819"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539820/SRR12539820"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539821/SRR12539821"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539822/SRR12539822"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539823/SRR12539823"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539824/SRR12539824"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539825/SRR12539825"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539826/SRR12539826"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539827/SRR12539827"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539828/SRR12539828"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539829/SRR12539829"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539830/SRR12539830"

# --- Additional data files ---
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539794/SRR12539794"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539793/SRR12539793"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539792/SRR12539792"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539791/SRR12539791"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539790/SRR12539790"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539789/SRR12539789"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539788/SRR12539788"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539787/SRR12539787"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539786/SRR12539786"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539818/SRR12539818"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539817/SRR12539817"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539816/SRR12539816"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539815/SRR12539815"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539814/SRR12539814"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539813/SRR12539813"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539812/SRR12539812"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539811/SRR12539811"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539810/SRR12539810"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539809/SRR12539809"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539808/SRR12539808"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539807/SRR12539807"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539785/SRR12539785"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539784/SRR12539784"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539783/SRR12539783"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539830/SRR12539830"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539829/SRR12539829"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539828/SRR12539828"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539827/SRR12539827"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539826/SRR12539826"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539825/SRR12539825"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539824/SRR12539824"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539823/SRR12539823"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539822/SRR12539822"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539821/SRR12539821"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539820/SRR12539820"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539819/SRR12539819"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539806/SRR12539806"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539805/SRR12539805"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539804/SRR12539804"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539803/SRR12539803"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539802/SRR12539802"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539801/SRR12539801"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539800/SRR12539800"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539799/SRR12539799"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539798/SRR12539798"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539797/SRR12539797"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539796/SRR12539796"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539795/SRR12539795"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539782/SRR12539782"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539781/SRR12539781"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539780/SRR12539780"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539775/SRR12539775"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539779/SRR12539779"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539778/SRR12539778"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539777/SRR12539777"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539776/SRR12539776"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539774/SRR12539774"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539773/SRR12539773"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539772/SRR12539772"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539771/SRR12539771"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539770/SRR12539770"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539769/SRR12539769"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539768/SRR12539768"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539767/SRR12539767"
curl -L -O -C - "https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR12539766/SRR12539766"

echo "Download complete. Files saved to $OUTDIR"