#!/bin/bash
# Run all tramadol ADR phenotypes GWAS with regenie_dosages method
# 96 ADR phenotypes (ICD-10 codes)

PHENOTYPES=(
  "tramadol__R13"
  "tramadol__K30"
  "tramadol__J22"
  "tramadol__E780"
  "tramadol__M513"
  "tramadol__R798"
  "tramadol__I849"
  "tramadol__I251"
  "tramadol__J449"
  "tramadol__R55"
  "tramadol__R410"
  "tramadol__N309"
  "tramadol__K409"
  "tramadol__K20"
  "tramadol__I739"
  "tramadol__K625"
  "tramadol__K219"
  "tramadol__K590"
  "tramadol__C61"
  "tramadol__I501"
  "tramadol__K589"
  "tramadol__G473"
  "tramadol__M199"
  "tramadol__E86"
  "tramadol__N328"
  "tramadol__M543"
  "tramadol__D649"
  "tramadol__K529"
  "tramadol__K802"
  "tramadol__L039"
  "tramadol__R103"
  "tramadol__R11"
  "tramadol__H269"
  "tramadol__A419"
  "tramadol__K297"
  "tramadol__R634"
  "tramadol__D509"
  "tramadol__G439"
  "tramadol__K922"
  "tramadol__M549"
  "tramadol__G560"
  "tramadol__R074"
  "tramadol__F329"
  "tramadol__N40"
  "tramadol__R104"
  "tramadol__R101"
  "tramadol__R252"
  "tramadol__I209"
  "tramadol__M255"
  "tramadol__E785"
  "tramadol__M858"
  "tramadol__M479"
  "tramadol__R21"
  "tramadol__M069"
  "tramadol__J459"
  "tramadol__J441"
  "tramadol__I802"
  "tramadol__K579"
  "tramadol__A099"
  "tramadol__L089"
  "tramadol__R05"
  "tramadol__H919"
  "tramadol__N189"
  "tramadol__M796"
  "tramadol__E039"
  "tramadol__I10"
  "tramadol__N179"
  "tramadol__R268"
  "tramadol__R31"
  "tramadol__R51"
  "tramadol__K298"
  "tramadol__N390"
  "tramadol__K760"
  "tramadol__N200"
  "tramadol__R060"
  "tramadol__R53"
  "tramadol__T810"
  "tramadol__I48"
  "tramadol__R945"
  "tramadol__M819"
  "tramadol__L309"
  "tramadol__F419"
  "tramadol__M139"
  "tramadol__D70"
  "tramadol__J069"
  "tramadol__K573"
  "tramadol__I959"
  "tramadol__K449"
  "tramadol__B029"
  "tramadol__L409"
  "tramadol__I269"
  "tramadol__R509"
  "tramadol__M542"
  "tramadol__R42"
  "tramadol__J189"
  "tramadol__R33"
)

echo "Starting tramadol ADR GWAS analysis (${#PHENOTYPES[@]} phenotypes) - submitting every 30s"
echo "========================================"

for pheno in "${PHENOTYPES[@]}"; do
  echo "$(date '+%H:%M:%S') Submitting: $pheno"
  ./manhattan.sh --phenotype "$pheno" --method regenie_dosages --tag tramadol --covariates all &
  sleep 30
done

echo "========================================"
echo "All tramadol ADR phenotypes submitted!"
echo "========================================"
