<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://stab.st-andrews.ac.uk/wiki/index.php?action=history&amp;feed=atom&amp;title=Cramtools</id>
		<title>Cramtools - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://stab.st-andrews.ac.uk/wiki/index.php?action=history&amp;feed=atom&amp;title=Cramtools"/>
		<link rel="alternate" type="text/html" href="http://stab.st-andrews.ac.uk/wiki/index.php?title=Cramtools&amp;action=history"/>
		<updated>2026-05-06T05:04:31Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://stab.st-andrews.ac.uk/wiki/index.php?title=Cramtools&amp;diff=908&amp;oldid=prev</id>
		<title>Rf: Created page with &quot;= Introduction =  CRAM is a (further) compressed form of a bam file. It&#039;s necessary due the high numbers of bam files being generated in NGS.  Samtools is able to handle CRAM...&quot;</title>
		<link rel="alternate" type="text/html" href="http://stab.st-andrews.ac.uk/wiki/index.php?title=Cramtools&amp;diff=908&amp;oldid=prev"/>
				<updated>2016-12-22T13:21:28Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;= Introduction =  CRAM is a (further) compressed form of a bam file. It&amp;#039;s necessary due the high numbers of bam files being generated in NGS.  Samtools is able to handle CRAM...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
CRAM is a (further) compressed form of a bam file. It&amp;#039;s necessary due the high numbers of bam files being generated in NGS.&lt;br /&gt;
&lt;br /&gt;
Samtools is able to handle CRAM files, but the EBI&amp;#039;s ENA department has produced a JAVA based toolset called cramtools, available on marvin with&lt;br /&gt;
&lt;br /&gt;
 module load cramtools&lt;br /&gt;
&lt;br /&gt;
There is a wrapper script called &amp;#039;&amp;#039;&amp;#039;cramtools.sh&amp;#039;&amp;#039;&amp;#039; which may be used, it is simply a short cut to the main program.&lt;br /&gt;
&lt;br /&gt;
= Usage =&lt;br /&gt;
&lt;br /&gt;
The main help is as follows:&lt;br /&gt;
&lt;br /&gt;
 Version 3.0-b203 &lt;br /&gt;
 &lt;br /&gt;
 Usage: cramtools [options] [command] [command options]&lt;br /&gt;
  Options:    -h, --help  Print help and quit (default: false)&lt;br /&gt;
  Commands:&lt;br /&gt;
    bam         CRAM to BAM conversion. &lt;br /&gt;
    cram        BAM to CRAM converter. &lt;br /&gt;
    index       BAM/CRAM indexer. &lt;br /&gt;
    merge       Tool to merge CRAM or BAM files. &lt;br /&gt;
    fastq       CRAM to FastQ dump conversion. &lt;br /&gt;
    fixheader   A tool to fix CRAM header without re-writing the whole file.&lt;br /&gt;
    getref      Download reference sequences.&lt;br /&gt;
    qstat       Quality score statistics.&lt;br /&gt;
&lt;br /&gt;
Cramtools has more than just converting between CRAM and BAM. In particular it can download the reference sequence associated with the CRAM, via its subcommand &amp;#039;&amp;#039;&amp;#039;getref&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
 Usage: &amp;lt;main class&amp;gt; [options]&lt;br /&gt;
 A list of MD5 checksums for which the sequences should be downloaded.&lt;br /&gt;
  Options:    --destination-file, -F  Destination file.&lt;br /&gt;
    --fasta-line-length     Wrap fasta lines accroding to this value. (default: 80)&lt;br /&gt;
    --gzip, -z              Compress fasta with gzip. (default: false)&lt;br /&gt;
    --ignore-not-found      Don&amp;#039;t fail on not found sequences, just issue a warning. (default: false)&lt;br /&gt;
    --input-file, -I        The path to the CRAM or BAM file to extract sequence MD5 checksums.&lt;br /&gt;
    -h, --help              Print help and quit (default: false)&lt;br /&gt;
    -l, --log-level         Change log level: DEBUG, INFO, WARNING, ERROR. (default: ERROR)&lt;br /&gt;
&lt;br /&gt;
So we can invoke it as follows:&lt;br /&gt;
&lt;br /&gt;
 java -jar $CRAMJARFILE getref -I 17261_1#45.cram &amp;gt;_45.fa&lt;br /&gt;
&lt;br /&gt;
The top 3 lines of the output is as follows:&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;ENA|CU458896|CU458896.1 ffb37b1f4cfc02b01cc8f3cafebf1e8e&lt;br /&gt;
 TTGACTGACGAACTGAATTCCCAGTTCACGGCGGTATGGAATACCGTCGTCGCAGAGCTCAACGGTGACGACAATCAATA&lt;br /&gt;
 TCTGTCGAGCTTCCCGCCGCTGACCCCGCAACAGCGCGCCTGGCTTACCCTCGTCAAACCACTCACCATGGCCGAGGGTT&lt;br /&gt;
&lt;br /&gt;
So we can see it is a standard FASTA file with a code that looks like an MD5 code on the ID line. This code in fact, can also be used to obtain the same reference file via another method, as detail on the ENA website&lt;br /&gt;
&lt;br /&gt;
 wget www.ebi.ac.uk/ena/cram/md5/&amp;lt;hashvalue&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will not download the ID line, just the raw sequence with no newline-style formatting for easy visualisation.&lt;/div&gt;</summary>
		<author><name>Rf</name></author>	</entry>

	</feed>