Cram is a compression format like BAM (binary alignment/map) format. However, cram is supposed to be more efficient in data compression and available in lossy and lossless compression formats (like song compression-lossy and lossless). Samtools, in current git repositories (as of 27th July, 2014) support cram rudimentarily (as view). Cramtool kit from EBI can convert bam files to cram files. It is java based tool and can be downloaded from https://github.com/enasequence/cramtools/blob/master/cramtools-2.1.jar?raw=true (working link as of 27th July, 2014). However, it doesn't support indexing cram files as I understand. For indexing cram files, staden_io_utils package has to be installed on computer. 1000 genomes support cram format (http://www.1000genomes.org/faq/what-are-cram-files).

Samtools, Cram toolkit can convert bam to cram and samtools and staden_io_libs can index cram files. However in my use, i found cram toolkit better than samtools. Samtools can convert bam to cram easy, but converting back to bam to cram takes lots of time, compared to cram tool kit.

Prerequisites:
1) Compile latest samtools from samtools git repository
2) Down load install cram toolkit from EBI (https://github.com/enasequence/cramtools/blob/master/cramtools-2.1.jar?raw=true (working link as of 27th July, 2014)
3) Install staden-io-lib-utils  (available in Debian and ubuntu repositories)

Convert bam to cram:

1) using samtools:

$ samtools view -C <input.bam> -T <reference.fasta> -o <output.cram>
example code: $ samtools view -C tumor.bam -T ../bioinfo_software/hg19/ref.fa -o tumor_st.cram

2) Using cram tool kit

$  java -jar <path to cramtools>/cramtools-2.1.jar cram  -I <input.bam> -R <reference.fasta> -O <output.cram>

example code: $ java -jar /opt/biotools/cramtools-2.1.jar cram  -I tumor.bam -R ../bioinfo_software/hg19/ref.fa -O tumor_ls.cram

For an example bam (original. bam with 1.3 Mb size),  I found cram toolkit compresses bam better than samtools.
Index cram files:

1) Using samtools

$ samtools index <input>.cram
example code: samtools index cramtools_lossless.cram

However, i got this error if we supply command samtools index *.cram (for batch indexing)
"Samtools-htslib-API: bam_index_build2() not yet implemented. fish: Job 1, “samtools index *.cram ” terminated by signal SIGABRT (Abort)" ( I am using fish shell)

2) Using cram_index from staden-io-lib-utils

 $ cram_index <input>.cram
Example code:  $ cram_index samtools.cram

However, cram_index doesn't support "cram_index *.cram" command either for compressing multiple cram files.

Next step was to recreate original bam file from compressed cram file using samtools and cramtool kit and comparing them:

1) Samtools takes lots of time in  converting cram to bam.  In fact, I have to stop converting as it went silent for considerable time and cramtool kit converted the cram files back into bam files within no time. However there are  size differences which I will have to look into.

commands used are (for cramtools):

1) java -jar /opt/biotools/cramtools-2.1.jar bam  -I cramtools_lossy.cram  -R ../bioinfo_software/hg19/ref.fa -O cramtools_lossy.bam
2) java -jar /opt/biotools/cramtools-2.1.jar bam  -I cramtools_lossless.cram -R ../bioinfo_software/hg19/ref.fa -O cramtools_lossless.bam



Samtools was able to index recreated bam files. Remember that parsing a cram files always needs reference file that was used while creating cram file.