Ask Your Question

Christophe Lambert's profile - activity

2021-12-03 12:37:57 -0600 received badge  Teacher (source)
2021-12-03 12:37:57 -0600 received badge  Necromancer (source)
2021-12-03 09:22:20 -0600 received badge  Editor (source)
2021-12-03 08:48:22 -0600 answered a question How can I load a file in CRAM format into my GH browser?

A workaround I used was to install the open-source samtools software, and convert from the CRAM to BAM format via the command:

samtools view -b -o outfile.bam infile.cram

Note you can speed this up by using, say 24 threads via:

samtools view -@ 24 -b -o outfile.bam infile.cram

This will work if your CRAM file has header information that provides MD5 sums for the reference sequence, and samtools will even automatically download needed reference data for you (into ~/.cache/hts-ref/), see this post:

If you have the reference sequence FASTA file that was used to build the CRAM file, you can specify it (say it was called ref.fa) by running the command:

samtools view -@ 24 -b -T ref.fa -o outfile.bam infile.cram

samtools is available here:

Under Ubuntu I was able to install samtools (though not the latest version) via:

sudo apt-get install samtools

Under RedHat / CentOS I was able to install samtools via:

sudo yum install samtools