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

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

# --- GEO supplementary files ---
wget -nc ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE198nnn/GSE198419/suppl/GSE198419_22Rv1_rMATS_result.xlsx -O GSE198419_22Rv1_rMATS_result.xlsx
wget -nc ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE198nnn/GSE198419/suppl/GSE198419_22Rv1_raw_gene_counts.csv.gz -O GSE198419_22Rv1_raw_gene_counts.csv.gz
wget -nc ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE198nnn/GSE198419/suppl/GSE198419_MCF7_raw_gene_counts.csv.gz -O GSE198419_MCF7_raw_gene_counts.csv.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 SRR18300970
gz1="$(_compress_if_exists SRR18300970_1 || true)"
gz2="$(_compress_if_exists SRR18300970_2 || true)"
gzs="$(_compress_if_exists SRR18300970 || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" KO310R3_R1_001.fastq.gz
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" KO310R3_R2_001.fastq.gz
fi

fasterq-dump --split-files SRR18300971
gz1="$(_compress_if_exists SRR18300971_1 || true)"
gz2="$(_compress_if_exists SRR18300971_2 || true)"
gzs="$(_compress_if_exists SRR18300971 || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" KO310R2_R1_001.fastq.gz
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" KO310R2_R2_001.fastq.gz
fi

fasterq-dump --split-files SRR18300972
gz1="$(_compress_if_exists SRR18300972_1 || true)"
gz2="$(_compress_if_exists SRR18300972_2 || true)"
gzs="$(_compress_if_exists SRR18300972 || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" KO310S3_R1_001.fastq.gz
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" KO310S3_R2_001.fastq.gz
fi

fasterq-dump --split-files SRR18300973
gz1="$(_compress_if_exists SRR18300973_1 || true)"
gz2="$(_compress_if_exists SRR18300973_2 || true)"
gzs="$(_compress_if_exists SRR18300973 || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" KO310S2_R1_001.fastq.gz
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" KO310S2_R2_001.fastq.gz
fi

fasterq-dump --split-files SRR18300974
gz1="$(_compress_if_exists SRR18300974_1 || true)"
gz2="$(_compress_if_exists SRR18300974_2 || true)"
gzs="$(_compress_if_exists SRR18300974 || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" KO310S1_R1_001.fastq.gz
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" KO310S1_R2_001.fastq.gz
fi

fasterq-dump --split-files SRR18300975
gz1="$(_compress_if_exists SRR18300975_1 || true)"
gz2="$(_compress_if_exists SRR18300975_2 || true)"
gzs="$(_compress_if_exists SRR18300975 || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" Ctrl210R1_R1_001.fastq.gz
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" Ctrl210R1_R2_001.fastq.gz
fi

fasterq-dump --split-files SRR18300976
gz1="$(_compress_if_exists SRR18300976_1 || true)"
gz2="$(_compress_if_exists SRR18300976_2 || true)"
gzs="$(_compress_if_exists SRR18300976 || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" Ctrl2DMSO3_R1_001.fastq.gz
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" Ctrl2DMSO3_R2_001.fastq.gz
fi

fasterq-dump --split-files SRR18300977
gz1="$(_compress_if_exists SRR18300977_1 || true)"
gz2="$(_compress_if_exists SRR18300977_2 || true)"
gzs="$(_compress_if_exists SRR18300977 || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" KO310R1_R1_001.fastq.gz
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" KO310R1_R2_001.fastq.gz
fi

fasterq-dump --split-files SRR18300978
gz1="$(_compress_if_exists SRR18300978_1 || true)"
gz2="$(_compress_if_exists SRR18300978_2 || true)"
gzs="$(_compress_if_exists SRR18300978 || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" KO3DMSO3_R1_001.fastq.gz
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" KO3DMSO3_R2_001.fastq.gz
fi

fasterq-dump --split-files SRR18300979
gz1="$(_compress_if_exists SRR18300979_1 || true)"
gz2="$(_compress_if_exists SRR18300979_2 || true)"
gzs="$(_compress_if_exists SRR18300979 || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" KO3DMSO2_R1_001.fastq.gz
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" KO3DMSO2_R2_001.fastq.gz
fi

fasterq-dump --split-files SRR18300980
gz1="$(_compress_if_exists SRR18300980_1 || true)"
gz2="$(_compress_if_exists SRR18300980_2 || true)"
gzs="$(_compress_if_exists SRR18300980 || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" KO3DMSO1_R1_001.fastq.gz
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" KO3DMSO1_R2_001.fastq.gz
fi

fasterq-dump --split-files SRR18300981
gz1="$(_compress_if_exists SRR18300981_1 || true)"
gz2="$(_compress_if_exists SRR18300981_2 || true)"
gzs="$(_compress_if_exists SRR18300981 || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" Ctrl210S3_R1_001.fastq.gz
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" Ctrl210S3_R2_001.fastq.gz
fi

fasterq-dump --split-files SRR18300982
gz1="$(_compress_if_exists SRR18300982_1 || true)"
gz2="$(_compress_if_exists SRR18300982_2 || true)"
gzs="$(_compress_if_exists SRR18300982 || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" Ctrl210S2_R1_001.fastq.gz
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" Ctrl210S2_R2_001.fastq.gz
fi

fasterq-dump --split-files SRR18300983
gz1="$(_compress_if_exists SRR18300983_1 || true)"
gz2="$(_compress_if_exists SRR18300983_2 || true)"
gzs="$(_compress_if_exists SRR18300983 || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" Ctrl210S1_R1_001.fastq.gz
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" Ctrl210S1_R2_001.fastq.gz
fi

fasterq-dump --split-files SRR18300984
gz1="$(_compress_if_exists SRR18300984_1 || true)"
gz2="$(_compress_if_exists SRR18300984_2 || true)"
gzs="$(_compress_if_exists SRR18300984 || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" Ctrl210R3_R1_001.fastq.gz
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" Ctrl210R3_R2_001.fastq.gz
fi

fasterq-dump --split-files SRR18300985
gz1="$(_compress_if_exists SRR18300985_1 || true)"
gz2="$(_compress_if_exists SRR18300985_2 || true)"
gzs="$(_compress_if_exists SRR18300985 || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" Ctrl210R2_R1_001.fastq.gz
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" Ctrl210R2_R2_001.fastq.gz
fi

fasterq-dump --split-files SRR18300986
gz1="$(_compress_if_exists SRR18300986_1 || true)"
gz2="$(_compress_if_exists SRR18300986_2 || true)"
gzs="$(_compress_if_exists SRR18300986 || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" Ctrl2DMSO2_R1_001.fastq.gz
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" Ctrl2DMSO2_R2_001.fastq.gz
fi

fasterq-dump --split-files SRR18300987
gz1="$(_compress_if_exists SRR18300987_1 || true)"
gz2="$(_compress_if_exists SRR18300987_2 || true)"
gzs="$(_compress_if_exists SRR18300987 || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" Ctrl2DMSO1_R1_001.fastq.gz
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" Ctrl2DMSO1_R2_001.fastq.gz
fi

fasterq-dump --split-files SRR18300988
gz1="$(_compress_if_exists SRR18300988_1 || true)"
gz2="$(_compress_if_exists SRR18300988_2 || true)"
gzs="$(_compress_if_exists SRR18300988 || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" SK-KO5-10S-3_R1_001.fastq.gz
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" SK-KO5-10S-3_R2_001.fastq.gz
fi

fasterq-dump --split-files SRR18300989
gz1="$(_compress_if_exists SRR18300989_1 || true)"
gz2="$(_compress_if_exists SRR18300989_2 || true)"
gzs="$(_compress_if_exists SRR18300989 || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" SK-KO5-10S-2_R1_001.fastq.gz
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" SK-KO5-10S-2_R2_001.fastq.gz
fi

fasterq-dump --split-files SRR18300990
gz1="$(_compress_if_exists SRR18300990_1 || true)"
gz2="$(_compress_if_exists SRR18300990_2 || true)"
gzs="$(_compress_if_exists SRR18300990 || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" SK-KO5-D1_R1_001.fastq.gz
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" SK-KO5-D1_R2_001.fastq.gz
fi

fasterq-dump --split-files SRR18300991
gz1="$(_compress_if_exists SRR18300991_1 || true)"
gz2="$(_compress_if_exists SRR18300991_2 || true)"
gzs="$(_compress_if_exists SRR18300991 || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" SK-KO5-D2_R1_001.fastq.gz
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" SK-KO5-D2_R2_001.fastq.gz
fi

fasterq-dump --split-files SRR18300992
gz1="$(_compress_if_exists SRR18300992_1 || true)"
gz2="$(_compress_if_exists SRR18300992_2 || true)"
gzs="$(_compress_if_exists SRR18300992 || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" SK-KO5-D3_R1_001.fastq.gz
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" SK-KO5-D3_R2_001.fastq.gz
fi

fasterq-dump --split-files SRR18300993
gz1="$(_compress_if_exists SRR18300993_1 || true)"
gz2="$(_compress_if_exists SRR18300993_2 || true)"
gzs="$(_compress_if_exists SRR18300993 || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" SK-KO5-10R-1_R1_001.fastq.gz
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" SK-KO5-10R-1_R2_001.fastq.gz
fi

fasterq-dump --split-files SRR18300994
gz1="$(_compress_if_exists SRR18300994_1 || true)"
gz2="$(_compress_if_exists SRR18300994_2 || true)"
gzs="$(_compress_if_exists SRR18300994 || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" SK-KO5-10R-2_R1_001.fastq.gz
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" SK-KO5-10R-2_R2_001.fastq.gz
fi

fasterq-dump --split-files SRR18300995
gz1="$(_compress_if_exists SRR18300995_1 || true)"
gz2="$(_compress_if_exists SRR18300995_2 || true)"
gzs="$(_compress_if_exists SRR18300995 || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" SK-KO5-10R-3_R1_001.fastq.gz
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" SK-KO5-10R-3_R2_001.fastq.gz
fi

fasterq-dump --split-files SRR18300996
gz1="$(_compress_if_exists SRR18300996_1 || true)"
gz2="$(_compress_if_exists SRR18300996_2 || true)"
gzs="$(_compress_if_exists SRR18300996 || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" SK-KO5-10S-1_R1_001.fastq.gz
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" SK-KO5-10S-1_R2_001.fastq.gz
fi

fasterq-dump --split-files SRR18300997
gz1="$(_compress_if_exists SRR18300997_1 || true)"
gz2="$(_compress_if_exists SRR18300997_2 || true)"
gzs="$(_compress_if_exists SRR18300997 || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" SK-C1-10R-2_R1_001.fastq.gz
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" SK-C1-10R-2_R2_001.fastq.gz
fi

fasterq-dump --split-files SRR18300998
gz1="$(_compress_if_exists SRR18300998_1 || true)"
gz2="$(_compress_if_exists SRR18300998_2 || true)"
gzs="$(_compress_if_exists SRR18300998 || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" SK-C1-10R-3_R1_001.fastq.gz
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" SK-C1-10R-3_R2_001.fastq.gz
fi

fasterq-dump --split-files SRR18300999
gz1="$(_compress_if_exists SRR18300999_1 || true)"
gz2="$(_compress_if_exists SRR18300999_2 || true)"
gzs="$(_compress_if_exists SRR18300999 || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" SK-C1-10S-1_R1_001.fastq.gz
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" SK-C1-10S-1_R2_001.fastq.gz
fi

fasterq-dump --split-files SRR18301000
gz1="$(_compress_if_exists SRR18301000_1 || true)"
gz2="$(_compress_if_exists SRR18301000_2 || true)"
gzs="$(_compress_if_exists SRR18301000 || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" SK-C1-10S-2_R1_001.fastq.gz
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" SK-C1-10S-2_R2_001.fastq.gz
fi

fasterq-dump --split-files SRR18301001
gz1="$(_compress_if_exists SRR18301001_1 || true)"
gz2="$(_compress_if_exists SRR18301001_2 || true)"
gzs="$(_compress_if_exists SRR18301001 || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" SK-C1-10S-3_R1_001.fastq.gz
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" SK-C1-10S-3_R2_001.fastq.gz
fi

fasterq-dump --split-files SRR18301002
gz1="$(_compress_if_exists SRR18301002_1 || true)"
gz2="$(_compress_if_exists SRR18301002_2 || true)"
gzs="$(_compress_if_exists SRR18301002 || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" SK-C1-10R-1_R1_001.fastq.gz
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" SK-C1-10R-1_R2_001.fastq.gz
fi

fasterq-dump --split-files SRR18301003
gz1="$(_compress_if_exists SRR18301003_1 || true)"
gz2="$(_compress_if_exists SRR18301003_2 || true)"
gzs="$(_compress_if_exists SRR18301003 || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" SK-C1-D3_R1_001.fastq.gz
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" SK-C1-D3_R2_001.fastq.gz
fi

fasterq-dump --split-files SRR18301004
gz1="$(_compress_if_exists SRR18301004_1 || true)"
gz2="$(_compress_if_exists SRR18301004_2 || true)"
gzs="$(_compress_if_exists SRR18301004 || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" SK-C1-D2_R1_001.fastq.gz
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" SK-C1-D2_R2_001.fastq.gz
fi

fasterq-dump --split-files SRR18301005
gz1="$(_compress_if_exists SRR18301005_1 || true)"
gz2="$(_compress_if_exists SRR18301005_2 || true)"
gzs="$(_compress_if_exists SRR18301005 || true)"
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz1" ]; then
  mv -f "$gz1" SK-C1-D1_R1_001.fastq.gz
fi
if [ "$RENAME_SRA_TO_ORIGINAL" = "1" ] && [ -n "$gz2" ]; then
  mv -f "$gz2" SK-C1-D1_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/SRR18300970/SRR18300970
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300971/SRR18300971
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300972/SRR18300972
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300973/SRR18300973
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300974/SRR18300974
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300975/SRR18300975
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300976/SRR18300976
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300977/SRR18300977
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300978/SRR18300978
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300979/SRR18300979
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300980/SRR18300980
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300981/SRR18300981
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300982/SRR18300982
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300983/SRR18300983
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300984/SRR18300984
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300985/SRR18300985
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300986/SRR18300986
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300987/SRR18300987
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300988/SRR18300988
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300989/SRR18300989
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300990/SRR18300990
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300991/SRR18300991
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300992/SRR18300992
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300993/SRR18300993
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300994/SRR18300994
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300995/SRR18300995
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300996/SRR18300996
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300997/SRR18300997
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300998/SRR18300998
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300999/SRR18300999
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18301000/SRR18301000
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18301001/SRR18301001
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18301002/SRR18301002
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18301003/SRR18301003
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18301004/SRR18301004
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18301005/SRR18301005

# --- Additional data files ---
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300975/SRR18300975
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300985/SRR18300985
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300984/SRR18300984
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300983/SRR18300983
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300982/SRR18300982
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300981/SRR18300981
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300987/SRR18300987
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300986/SRR18300986
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300976/SRR18300976
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300977/SRR18300977
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300971/SRR18300971
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300970/SRR18300970
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300974/SRR18300974
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300973/SRR18300973
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300972/SRR18300972
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300980/SRR18300980
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300979/SRR18300979
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300978/SRR18300978
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18301002/SRR18301002
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300997/SRR18300997
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300998/SRR18300998
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300999/SRR18300999
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18301000/SRR18301000
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18301001/SRR18301001
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18301005/SRR18301005
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18301004/SRR18301004
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18301003/SRR18301003
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300993/SRR18300993
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300994/SRR18300994
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300995/SRR18300995
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300996/SRR18300996
curl -L -O -C - https://sra-downloadb.be-md.ncbi.nlm.nih.gov/sos1/sra-pub-zq-38/SRR018/18300/SRR18300996/SRR18300996.lite.1
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300989/SRR18300989
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300988/SRR18300988
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300990/SRR18300990
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300991/SRR18300991
curl -L -O -C - https://sra-pub-run-odp.s3.amazonaws.com/sra/SRR18300992/SRR18300992
curl -L -O -C - https://sra-downloadb.be-md.ncbi.nlm.nih.gov/sos1/sra-pub-zq-38/SRR018/18300/SRR18300972/SRR18300972.lite.1
curl -L -O -C - https://sra-downloadb.be-md.ncbi.nlm.nih.gov/sos9/sra-pub-zq-922/SRR018/18300/SRR18300997/SRR18300997.lite.1

echo "Download complete. Files saved to $OUTDIR"