AWS Builder Center
AWS for Bioinformatics: Running Docking and Sequence-Analysis Workflows on EC2, AWS Batch, and HealthOmics, and What It Costs

AWS for Bioinformatics: Running Docking and Sequence-Analysis Workflows on EC2, AWS Batch, and HealthOmics, and What It Costs

Explore how to run computational biology workflows on AWS, from molecular docking and DNA sequence analysis to scalable, cloud-native pipelines. Compare EC2, AWS Batch, and HealthOmics, including architecture choices, performance considerations, and practical cost breakdowns to build efficient, production-ready bioinformatics solutions.

Series: AWS (6 articles)

  1. 2
    AWS for Bioinformatics: Running Docking and Sequence-Analysis Workflows on EC2, AWS Batch, and HealthOmics, and What It Costs This article
Tech Entrepreneur | Empowering Career-Ready Talent
Bioinformatics rarely needs computing power in a steady stream. It needs a lot of it all at once, and then nothing for days. You might have 5,000 candidate ligands to dock against a protein target, or 200 genomes to align and variant-call before a deadline. After that, the cluster sits idle. A fixed lab server handles this pattern badly: it is either too small during the crunch or wasted during the quiet weeks.
Cloud computing fits this shape of work well, but "use AWS" is not a single decision. For a bioinformatics workflow there are three common ways to run it: plain Amazon EC2, AWS Batch, and AWS HealthOmics. They differ in how much infrastructure you manage, how well they suit different workload shapes, and, importantly, how the bill is built.
This article walks through all three using two realistic workloads, a molecular docking screen and a sequence-analysis pipeline. It then shows how to estimate the cost before you spend anything.

1. Two workloads, two different shapes

Before choosing a service, name the shape of your workload, because that decides almost everything.

Molecular docking: many small, independent jobs

A virtual screening campaign docks each ligand in a library against a target protein. Every ligand is independent of every other one. This is the textbook "embarrassingly parallel" problem: ten thousand ligands can be split across thousands of small jobs, and the order does not matter. Each job is short (seconds to minutes), needs little memory, and writes a small result file (a score and a pose).
The cost drivers are the total instance-hours, whether you use CPUs or GPUs, and, if you use commercial docking software, the license terms. Storage is minor.

Sequence analysis: a few long, dependent steps

A pipeline such as quality control, then alignment, then sorting and duplicate marking, then variant calling has a very different profile. Steps depend on each other. Each step needs a different amount of CPU and memory: alignment is CPU-hungry, and some variant-calling steps are memory-hungry. The intermediate files, such as BAM files, can run to hundreds of gigabytes per sample.
Here the cost drivers are right-sizing each step, the scratch storage that holds intermediates, and the long-term storage of raw data and results.
Keep these two shapes in mind. The first points toward Batch with Spot capacity; the second points toward HealthOmics or a workflow engine.

2. Option one: Amazon EC2

The simplest approach is to launch an EC2 instance, install your tools, copy in your data, run the job, and stop the instance.
What you gain. Total control and almost no learning curve. If you already run your analysis on a Linux workstation, an EC2 instance is the same thing with a bigger, rentable machine. It is a good way to learn, to prototype a pipeline, or to run a single long analysis that needs, for example, a large-memory instance.
What you manage. Everything: software installation, copying data in and out, monitoring the job, restarting after a failure, and shutting the instance down. Nothing retries a failed job for you.
How the bill works. You pay for the instance for as long as it runs, billed per second for most Linux instances, whether or not your job is using every vCPU. The classic mistake is forgetting to stop or terminate the instance. A second cost is the EBS volume attached to it, which keeps billing even when the instance is stopped.
Good habits on EC2. Keep your software in a container or an AMI so the setup is reproducible. Store inputs and results in Amazon S3, not only on the instance disk. Add an automatic shutdown at the end of your script, so a finished job stops costing money.
Best for: prototyping, one-off analyses, interactive work, and learning.

3. Option two: AWS Batch

AWS Batch is a managed job scheduler. You package your tool in a container, describe how to run it in a job definition, and submit jobs to a job queue. Batch decides where to run them and launches extra EC2 capacity (or Fargate containers) when jobs are waiting. When the queue empties, it scales back down.
The key pricing fact is simple: there is no additional charge for AWS Batch itself. You pay only for the underlying resources it creates, such as EC2 instances or Fargate.

Why Batch suits docking

A docking screen maps neatly onto an array job. You submit one job with an array size equal to the number of ligand chunks, and each child job reads its own index from the environment variable  AWS_BATCH_JOB_ARRAY_INDEX  to decide which chunk of the library to dock.
A minimal submission looks like this:
aws batch submit-job --job-name vina-screen-001 --job-queue spot-docking-queue --job-definition vina-dock:1 --array-properties size=2000 --container-overrides file://overrides.json
where  overrides.json  sets the bucket locations as environment variables:
{
"environment": [
{"name": "LIGAND_BUCKET", "value": "s3://my-bucket/ligand-chunks/"},
{"name": "RESULT_BUCKET", "value": "s3://my-bucket/results/"}
]
}
Inside the container, your entry script uses the array index to pick its input:
#!/bin/bash
set -euo pipefail
IDX=${AWS_BATCH_JOB_ARRAY_INDEX}
aws s3 cp "${LIGAND_BUCKET}chunk_${IDX}.tar.gz" .
tar xzf chunk_${IDX}.tar.gz
for lig in chunk_${IDX}/*.pdbqt; do
vina --receptor receptor.pdbqt --ligand "$lig" --config config.txt --out "out_$(basename "$lig")"
done
aws s3 sync . "${RESULT_BUCKET}chunk_${IDX}/" --exclude "*" --include "out_*"
This uses AutoDock Vina as an example of an open-source docking engine; adapt it to your own tool.
Grouping ligands into chunks, rather than one job per ligand, matters. Each Batch job has startup overhead, so a job that runs for seconds wastes most of its time launching. Aim for jobs that run for several minutes.

Spot capacity: the big saving

EC2 Spot Instances use spare AWS capacity at discounts of up to 90% compared with On-Demand prices. The catch is that AWS can reclaim a Spot instance with a two-minute warning. That is a poor fit for a long, unrecoverable job, but an excellent fit for docking: if a chunk is interrupted, you simply run it again.
In Batch you set this up in a managed compute environment by choosing Spot, selecting the  SPOT_PRICE_CAPACITY_OPTIMIZED  allocation strategy, and allowing a wide range of instance types so it can find capacity. Then add a retry strategy to the job definition so that Spot interruptions are retried automatically while real application errors are not:
"retryStrategy": {
"attempts": 3,
"evaluateOnExit": [
{"onStatusReason": "Host EC2*", "action": "RETRY"},
{"onReason": "*", "action": "EXIT"}
]
}
Treat "up to 90%" as a best case. Real savings depend on the instance family, region, and time, and are commonly lower. Check the Spot price history in your region before you budget.

CPU or GPU for docking?

Some docking and scoring tools can use GPUs. Do not choose by hourly price alone. Compare the cost per ligand: a GPU instance that costs three times as much per hour but docks twenty times as many ligands is cheaper overall. Benchmark a few hundred ligands on each type and compare.

What you manage on Batch

You build and push the container image to Amazon ECR, define the compute environment, queue, and job definition, and handle data staging to and from S3. It is more setup than EC2, but far less operational effort than running your own cluster.
Best for: large virtual screens, any workload made of many independent jobs, and teams comfortable with containers.

4. Option three: AWS HealthOmics

AWS HealthOmics is a managed service built specifically for omics data. It has three parts: workflows (running pipelines), sequence stores (storing raw reads and alignments), and variant and annotation stores. This article focuses on workflows.
HealthOmics runs pipelines written in Nextflow, WDL, or CWL, the standard bioinformatics workflow languages. You bring your workflow definition and its container images, and the service provisions compute and temporary storage for each run, runs the tasks, and tears everything down. There are also Ready2Run workflows, which are prebuilt pipelines that you run without writing a workflow definition.

How a run works

You register your workflow, then start a run with your inputs and an output location in S3:
aws omics start-run --workflow-id 1234567 --role-arn arn:aws:iam::111122223333:role/OmicsRunRole --output-uri s3://my-bucket/omics-output/ --storage-type DYNAMIC --parameters file://params.json --name sample-001-alignment
Each task in your workflow declares the vCPUs and memory it needs. HealthOmics maps each task to the smallest omics instance that satisfies the request, so a light QC step and a heavy variant-calling step each run on an appropriately sized instance, not on one machine sized for the worst case. This per-task right-sizing is one of the service's main advantages for sequence-analysis pipelines.

The run storage choice

Every run gets a temporary file system, called run storage, for intermediate files. You choose between two types:
  • Dynamic run storage (the default) grows and shrinks automatically. You never have to guess a size, and a run does not fail because it ran out of space. It costs more per GB-hour.
  • Static run storage is a fixed size you choose in advance. It is cheaper per GB-hour, but you must size it correctly, including a small overhead (the base file system uses about 7% of the capacity).
A sensible approach is to use dynamic storage while developing, read the maximum storage a run used, and then switch to static storage, sized with a margin, for production runs at scale.

What you manage on HealthOmics

Very little infrastructure: no compute environments, queues, or instances to tune. You still manage the workflow definition, container images, IAM roles, and your S3 data. HealthOmics also gives you run-level tracking and run caching, which help with reproducibility.
Best for: standard genomics pipelines (for example, nf-core pipelines), repeated production runs, and teams that want reproducibility and less infrastructure work.

A caution on fit

HealthOmics is designed around the workflow languages above. If your docking job is a simple fan-out of thousands of short tasks, Batch with Spot will usually be the more natural and cheaper fit. If it is wrapped in a Nextflow pipeline, HealthOmics is a reasonable home for it.

5. How the bill is built

The three options charge in different ways, which is why comparing them takes care.

EC2
AWS Batch
HealthOmics
Service fee
None
None
No separate fee; you pay for task instances and storage
Compute billed
Whole instance, per second, while running
Whole EC2 instances (or Fargate), per second
Per task, on the smallest omics instance that fits, per second (60-second minimum)
Intermediate storage
EBS volumes
EBS volumes or local disk
Run storage, billed per GB-hour
Main compute savings
Spot, Savings Plans
Spot, Savings Plans
Right-sizing, run caching, commitments for large production use
Idle waste risk
High if you forget to stop
Low (scales to zero)
Very low

A worked example from AWS's own pricing page

AWS publishes pricing examples for HealthOmics private workflows. In one, a WDL workflow in US East (N. Virginia) has two tasks and runs for 5.75 hours:
  • Task 1, an  omics.c.4xlarge  at $0.9180 per hour for 3.5 hours: about $3.21
  • Task 2, an  omics.r.8xlarge  at $2.7216 per hour for 2.25 hours: about $6.12
  • Dynamic run storage at $0.0004110 per GB-hour for 3,000 GB-hours: about $1.23
The total is roughly $10.57 for one run. The pattern is typical: compute dominates, and storage is a smaller but real slice. These figures come from AWS's published example, are region-specific, and can change, so always check the current pricing page.

A general formula

For any of the three options, a useful estimate is:
Total cost = compute + intermediate storage + long-term storage + data transfer + licenses
Compute is the sum of (instance rate x hours) for every instance or task, and intermediate storage is (storage rate x GB-hours). Two terms are easy to forget:
  • Long-term storage. Raw FASTQ files and result BAMs accumulate in S3 month after month. If you keep them in a HealthOmics sequence store, you pay per gigabase-month, with cheaper archive tiers for data you rarely touch. S3 lifecycle rules can move old data to cheaper tiers automatically.
  • Data transfer. Moving data into AWS is generally free, but moving it out to the internet is charged. Do your downstream analysis inside AWS where possible.

A docking cost model you can adapt

Here is a template with illustrative numbers that are assumptions, not real prices. Replace them with current prices for your region.
  • Library size: 1,000,000 ligands
  • Measured throughput on your chosen instance: say 4 ligands per vCPU-minute (you must measure this)
  • Instance: 16 vCPUs at an assumed On-Demand price of P dollars per hour
  • Ligands per instance-hour: 16 vCPUs x 4 x 60 = 3,840
  • Instance-hours needed: 1,000,000 / 3,840, about 260 hours
  • On-Demand cost: about 260 x P
  • With Spot at a hypothetical 60% discount: about 260 x 0.4 x P
The point is the method: measure throughput on a small sample, convert to cost per ligand, then scale. Then add S3 storage for results and any license costs. Do not extrapolate from a guess.

6. Practical ways to cut the bill

  1. Run a pilot first. Dock 1,000 ligands or run one sample, and look at the real cost and runtime before launching the full campaign.
  1. Match requests to instance sizes. On HealthOmics, asking for 15 vCPUs and 33 GiB gets you a 16 vCPU, 64 GB instance, and you pay for all of it. Request values that fit an instance size.
  1. Batch samples into one run. HealthOmics allocates one run-storage file system per workflow run, so processing several samples in a single run can spread that cost.
  1. Group tiny tasks. Many very short tasks pay startup overhead each time. Combine them where you can.
  1. Use Spot for anything retryable. Docking, and many pipeline steps, tolerate interruption.
  1. Use run caching and resume. Do not recompute steps whose inputs have not changed.
  1. Try Graviton (Arm) where your tools support it. Many open-source bioinformatics tools now have Arm builds, which can lower the price per unit of work. Test your tool first.
  1. Set budgets and alerts. Create an AWS Budget with email alerts, and tag every resource with a project name so Cost Explorer shows what each project costs. HealthOmics also has an open-source Run Analyzer tool that produces a cost report per run.
  1. Clean up. Delete unused EBS volumes, old snapshots, and stale intermediate S3 data.
  1. Use the free tier. New AWS customers receive free-tier allowances that include HealthOmics usage. Free-tier terms change, so confirm the current offer.

7. Security and compliance notes

Genomic data can be sensitive, especially if it comes from people. Whichever option you choose:
  • Keep data in private S3 buckets with encryption enabled.
  • Give each job or run an IAM role with the minimum permissions it needs.
  • Use VPC endpoints so traffic to S3 stays on the AWS network.
  • If you handle regulated data, confirm that the services you use are eligible for your compliance requirements before you start. HealthOmics is described by AWS as HIPAA-eligible, but check the current compliance documentation for your own situation.
For docking against public protein structures and commercial compound libraries, data sensitivity is usually low, but license terms for the compound library and the software are not.

8. Licensing: the cost that is not on the AWS bill

Open-source tools such as AutoDock Vina, BWA, GATK, and samtools can be containerized and scaled freely. Commercial packages, including commercial docking suites, have license agreements that may limit the number of concurrent cores or jobs, may tie licenses to specific hosts, or may require a license server. A million-ligand screen on thousands of cloud cores may break terms written for a lab workstation. Check the license before you design the architecture, not after.

9. Which should you choose?

Your situation
Start with
Exploring, learning, or running one analysis
EC2
Docking thousands to millions of ligands
AWS Batch with Spot
Running standard Nextflow, WDL, or CWL genomics pipelines repeatedly
HealthOmics
A mix of both workloads
Batch for the screen, HealthOmics for the pipelines
These options are not exclusive. A common path is to prototype on EC2, move the large parallel screening workload to Batch, and put production sequencing pipelines on HealthOmics. The habits carry across all three: containerize your tools, keep data in S3, measure on a small sample, read the cost report, and only then scale up.

Conclusion

Cloud bioinformatics is no longer something only large genomics centers can do. With EC2 you can start in an afternoon. With Batch and Spot, a docking campaign that would take weeks on one workstation can finish in hours for a modest, predictable cost. With HealthOmics, a sequencing pipeline becomes a reproducible, per-task-billed service rather than a cluster you maintain.
The cost of any of these is not mysterious. It is compute plus storage plus the small items people forget, and you can estimate it from a short pilot. Start small, measure honestly, and scale only when the numbers make sense.
Pricing and feature details in this article are drawn from AWS's public pricing pages and documentation at the time of writing, are region-specific, and change over time. Always check the current AWS HealthOmics, EC2, and Batch documentation before budgeting. The cost model in section 5 uses assumed numbers for illustration only.

Series: AWS (6 articles)

  1. 2
    AWS for Bioinformatics: Running Docking and Sequence-Analysis Workflows on EC2, AWS Batch, and HealthOmics, and What It Costs This article
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article