High-Performance Computing at the NIH
GitHub YouTube @nih_hpc RSS Feed
crossmap on Biowulf & Helix


CrossMap is a program for convenient conversion of genome coordinates between different assemblies (e.g. mm9->mm10). It can convert SAM, BAM, bed, GTF, GFF, wig/bigWig, and VCF files.

There may be multiple versions of crossmap available. An easy way of selecting the version is to use modules. To see the modules available, type

module avail crossmap 

To select a module use

module load crossmap/[version]

where [version] is the version of choice.

Environment variables set



Web sites

On Helix

Convert a bed file from hg18 to hg19 and compare it to the expected output. Note that in addition to the standard CrossMap.py command there is also a more keyboard friendly alias called crossmap

helix$ td=/usr/local/apps/crossmap/TEST_DATA
helix$ crossmap bed $td/hg18ToHg19.over.chain $td/test_input > test_output
helix$ head -n2 test_output
chr1    142614848       142617697       ->      chr1    143903503       143906352
chr1    142617697       142623312       ->      chr1    143906355       143911970
helix$ diff --ignore-all-space expected_output test_output
Batch job on Biowulf

Create a batch script similar to the following example:

#! /bin/bash

function fail() {
    echo "$@" >&2
    exit 1

module load crossmap || fail "could not load crossmap module"
if [[ ! -f hg19ToHg38.over.chain.gz ]]; then
    wget http://hgdownload.soe.ucsc.edu/goldenPath/mm9/liftOver/hg19ToHg38.over.chain.gz
crossmap bam hg19ToHg38.over.chain.gz hg19_example.bam out
Submit to the queue with sbatch:
b2$ sbatch crossmap_bamm.sh
Swarm of jobs on Biowulf

Create a swarm command file similar to the following example:

crossmap bam hg19ToHg38.over.chain.gz sample1.bam sample1_hg38.bam
crossmap bam hg19ToHg38.over.chain.gz sample2.bam sample2_hg38.bam
crossmap bam hg19ToHg38.over.chain.gz sample3.bam sample3_hg38.bam

And submit to the queue with swarm

b2$ swarm -f crossmap.swarm --module crossmap
Interactive job on Biowulf

Allocate an interactive session with sinteractive and use as described above

b2$ sinteractive 
node$ CrossMap.py bigwig hg19ToHg38.over.chain.gz in.bw out
node$ exit