% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/extract.R
\name{extract_batch}
\alias{extract_batch}
\title{Submit a large-scale phenotype extraction job via table-exporter}
\usage{
extract_batch(
  field_id,
  dataset = NULL,
  file = NULL,
  instance_type = NULL,
  priority = c("low", "high")
)
}
\arguments{
\item{field_id}{(integer) Vector of UKB Field IDs to extract.
\code{eid} is always included automatically.}

\item{dataset}{(character) Dataset file name. Default: \code{NULL}
(auto-detect from project root).}

\item{file}{(character) Output file name on the cloud (without extension),
e.g. \code{"ad_cscc_pheno"}. Default: \code{NULL} (auto-generate as
\code{"ukb_pheno_YYYYMMDD_HHMMSS"} to avoid same-day collisions).}

\item{instance_type}{(character) DNAnexus instance type, e.g.
\code{"mem1_ssd1_v2_x16"}. Default: \code{NULL} (auto-select:
\code{x4} for up to 20 cols, \code{x8} for up to 100 cols,
\code{x16} for up to 500 cols, \code{x36} for more than 500 cols).}

\item{priority}{(character) Job scheduling priority. \code{"low"}
(recommended, cheaper) or \code{"high"} (faster queue). Default:
\code{"low"}.}
}
\value{
Invisibly returns the job ID string (e.g. \code{"job-XXXX"}).
}
\description{
Submits an asynchronous table-exporter job on the DNAnexus Research
Analysis Platform for large-scale phenotype extraction. Use this instead
of \code{extract_pheno()} when extracting many fields (e.g. 50+).
}
\details{
The job runs on the cloud and typically completes in 20-40 minutes.
Monitor progress and retrieve results using the \code{job_} series.
}
\examples{
\dontrun{
job_id <- extract_batch(core_field_ids)
job_id <- extract_batch(core_field_ids, file = "ad_cscc_pheno")
job_id <- extract_batch(core_field_ids, priority = "high")
# Monitor: job_status(job_id)
# Download: job_result(job_id, dest = "data/pheno.csv")
}
}
