Format specifications

The CRAM format specification is available as follows:

For detailed information about the preservation of data source BAM data in CRAM format please refer to ArchiveCRAM 1.0 specification.

 Reporting bugs

Please report any bugs, issues and problems as follows:

 Mailing list

Join the mailing list for discussions and announcements relating to CRAM tools. Mailing list archives are available here.

 Download

Download the Java toolkit

The CRAM Java toolkit can be downloaded as follows:

CRAM 2.0 is also supported in the latest Staden io_lib package.

Download the executable

Download the .jar executables as follows:

The program requires java 1.6 runtime or higher, available from:

Download and build from source

To build the program from source, you will need to check out the source code from github using the git client (http://git-scm.com/).

Make sure you have java 1.6 SDK or higher, available from:

You will also need ant version 1.7 or higher (http://ant.apache.org/).

Run one of the following commands:

git clone git://github.com/enasequence/cramtools.git (to retrieve CRAM 2.1)
git clone git://github.com/vadimzalunin/crammer.git (to retrieve CRAM 1.0)

 

and then both of the following commands:

ant -f build/build.xml runnable
java -jar cramtools.jar

 

To run unit tests:

ant -f build/build.xml test

 

Accessing command line help

General options:

java -jar cramtools-<version>.jar

 

BAM to CRAM conversion options:

java -jar cramtools-<version>.jar bam

 

CRAM to BAM conversion options:

java -jar cramtools-<version>.jar cram 

Reference sequences

The search order to obtain a reference is similar to SAMTools:

  1. Use any local file specified by the command line option --reference-fasta-file or -R.
  2. Look for MD5 via REF_CACHE environment variable.
  3. Look for MD5 in each element of the REF_PATH environment variable.
  4. Look for a local file listed in the UR: header tag.

For details of the REF_CACHE and REF_PATH variables please refer to the SAMTools 1.1.

 

Convert a BAM file to a CRAM file

A typical command to convert a BAM file into a CRAM file is:

java -jar cramtools-<version>.jar cram --input-bam-file <bam file> --reference-fasta-file <reference fasta file> [--output-cram-file <output cram file>] 

 

Input files:

  1. <bam file>: BAM file sorted by reference coordinates
  2. <bam file>.bai: BAM index file created using samtools index <bam file>
  3. <reference fasta file>: Reference sequence in fasta format
  4. <reference fasta file>.fai: Reference sequence index file created using samtools faidx <reference fasta file>

Convert a CRAM file to a BAM file

java -jar cramtools-<version>.jar bam --input-cram-file <cram file> --reference-fasta-file <reference fasta file> --output-bam-file <output bam file>

 

Input files:

  1. <cram file>: CRAM file
  2. <reference fasta file>: Uncompressed reference sequence in fasta format
  3. <reference fasta file>.fai: Reference sequence index file

Latest ENA news

09 Dec 2014: ENA release 122
Release 122 of ENA's assembled/annotated sequences is now available.

12 Nov 2014: Simplification of data release procedures
The European Nucleotide Archive will couple the public release of sequence records and the release of study records that contain these sequence records, with immediate effect.

11 Nov 2014: ENA/EMG Sample Record Annotation Workshop
European Nucleotide Archive (ENA) and EBI Metagenomics Portal (EMG), are organising the ENA/EMG Sample Record Annotation Workshop on the 1-5 December 2014 to enrich the environmental sample records.