Genomics

Sort it, index it,and count what mapped

The common path over a SAM, BAM or CRAM file.Sorted, indexed and summarized, into output.

SAMtools 1.244 cores · 4 GBRuns as a job
hub://samtools

$ dxflow workflow create --identity samtools hub://samtools --start

01Pick a machinecores, memory and a rate per hour
02Create the workflowpulled from the hub, once
03Run it, then stopstopped when the work is done
The application

Three steps,and one job

Sort, index and flagstat, over whatever INPUT is pointing at.

Any of three formats

SAM, BAM or CRAM — samtools works out the format on its own here.

Sorted and indexed

sorted.bam and its .bai, ready for whatever needs to seek in one.

And counted

flagstat.txt: the totals, the mapped, the paired, the duplicates.

How you run it

Sort it, index it,then count what is there

One alignment goes through the common path, and two variables steer it.

INPUTThe alignment to work on. SAM, BAM or CRAM, and it works out which from the file.
THREADSThreads given to the sort and to compression. More cores, fewer minutes.
a run, end to end

$ dxflow artifact upload sample.bam input/

$ dxflow workflow start samtools --override env.job.INPUT=/data/input/sample.bam

$ dxflow artifact download output/ ./aligned/

The job

It runs,and then it stops

A job, not a session — it ends once the three files are written.

inputInputyour alignment, read-only
outputOutputsorted, indexed, counted
Point INPUT at itThe default is /data/input/sample.sam — override it per run.
Watch it from the CLIdxflow workflow logs follows the run, and list shows the state.
Good to know

The common path,and the way past it

The step covers sort, index and summarize. Everything else SAMtools does is a shell away.

Three formats, one door

SAM, BAM and CRAM all go in the same way. The format is read off the file, not declared.

What comes out

A sorted BAM, its index beside it, and the flagstat and stats tables for the run.

Anything else

view, merge, mpileup and depth are all in the image. Open a shell and drive them yourself.

The image

Pulled once,then it stays

SAMtools arrives as one image. This is what comes down the first time, and what the disk should have free for it.

173Mamd64compressed, the way the registry counts it
10GOn diskunpacked, with room to work beside it
What it asks for

What it wants,and what it needs

The definition asks for 4 cores and 4 GB. The image comes up on less than that, and a start given --fit trims the ask to whatever the machine actually has.

4 cores · 4 GBAsks forwhat the definition writes down
2 cores · 2 GBRuns onthe least the image comes up on
Not neededGPUit works on the cores alone
The ask is not the floorThe definition writes down what suits the work. The image itself starts on less, which is what the second figure is.
--fit caps it to the hostA start given --fit trims each step to what the machine actually has, for that start alone. The definition is never rewritten.

Machines that fit it

SAMtools asks for 4 cores and 4 GB. Cheapest first.

E2 Highcpu-4
$0.124/ hour4 cores · 4 GBStart this machine
E2 Standard-4
$0.168/ hour4 cores · 16 GBStart this machine
B4ms
$0.208/ hour4 cores · 16 GBStart this machine
Run SAMtools on your own machinePick a machine that meets it, and it opens about a minute after you ask.