# CRAM support?

**URL:** <https://discourse.julialang.org/t/cram-support/28222>\
**Category:** Biology, Health, and Medicine\
**Tags:** question\
**Created:** [August 30, 2019, 10:40pm UTC](https://discourse.julialang.org/t/cram-support/28222 "2019-08-30T22:40:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![brendanofallon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/brendanofallon/32/9955_2.png) [@brendanofallon](https://discourse.julialang.org/u/brendanofallon)\
**Post date:** [August 30, 2019, 10:40pm UTC](https://discourse.julialang.org/t/cram-support/28222/1 "2019-08-30T22:40:53Z")

</div>

Hello, I’m wondering if there’s support, or plans for support, of the CRAM alignment format in BioJulia? I didn’t come across anything obvious reading the documentation, but perhaps it’s hiding somewhere, or a work in progress? Thanks!

---

<div class="post-metadata">

**Author:** ![Ward9250](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ward9250/32/42768_2.png) [@Ward9250](https://discourse.julialang.org/u/Ward9250)\
**Post date:** [August 30, 2019, 11:30pm UTC](https://discourse.julialang.org/t/cram-support/28222/2 "2019-08-30T23:30:40Z")

</div>

We have SAM and BAM in BioAlignments.jl currently. I don’t think we have anything for CRAM yet.

---

<div class="post-metadata">

**Author:** ![brendanofallon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/brendanofallon/32/9955_2.png) [@brendanofallon](https://discourse.julialang.org/u/brendanofallon)\
**Post date:** [September 1, 2019, 12:54am UTC](https://discourse.julialang.org/t/cram-support/28222/3 "2019-09-01T00:54:51Z")

</div>

OK, thanks for the info. I’m a bioinformatician new to Julia and was wondering what the current state of affairs is. It’s great to see so much good work in the bioinformatics realm already.

---

<div class="post-metadata">

**Author:** ![bicycle1885](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bicycle1885/32/107_2.png) [@bicycle1885](https://discourse.julialang.org/u/bicycle1885)\
**Post date:** [September 1, 2019, 11:41am UTC](https://discourse.julialang.org/t/cram-support/28222/4 "2019-09-01T11:41:05Z")

</div>

I tried to support CRAM a few years ago but I couldn’t mainly because the specs of CRAM were not well documented and had many ambiguous description. Perhaps it’s good time for me to revisit.

---

<div class="post-metadata">

**Author:** ![jonathanBieler](https://avatars.discourse-cdn.com/v4/letter/j/82dd89/32.png) [@jonathanBieler](https://discourse.julialang.org/u/jonathanBieler)\
**Post date:** [September 1, 2019, 1:12pm UTC](https://discourse.julialang.org/t/cram-support/28222/5 "2019-09-01T13:12:25Z")

</div>

BioAlignments.jl doesn’t use HTSlib, correct ? It looks like they have support for CRAM in there.

---

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [September 1, 2019, 2:10pm UTC](https://discourse.julialang.org/t/cram-support/28222/6 "2019-09-01T14:10:56Z")

</div>

HTSlib DOES support CRAM, but Julia’s wrapper currently doesn’t support that part of the library (e.g. Rust’s wrapper does), or I didn’t notice it documented:

[https://htslibjl.readthedocs.io/en/latest/](https://htslibjl.readthedocs.io/en/latest/)

I don’t know anything really about this CRAM, but I noticed in other thread here, that people are using the pysam library through PyCall.jl and it supports CRAM:

[https://pysam.readthedocs.io/en/latest/usage.html](https://pysam.readthedocs.io/en/latest/usage.html)

D language also has support for formats (and I see claims, not sure about CRAM):

> **[GitHub - biod/sambamba: Tools for working with SAM/BAM data](https://github.com/biod/sambamba)**
>
> Tools for working with SAM/BAM data. Contribute to biod/sambamba development by creating an account on GitHub.

> For example for flagstat sambamba is 1.4x faster than samtools. For index they are similar. For Markdup almost 6x faster and for view 4x faster. For sort sambamba has been beaten, though sambamba is up to 2x faster than samtools on large RAM machines (120GB+).

> **[GitHub - symmetryinvestments/juliad: Embed Julia in Dlang](https://github.com/symmetryinvestments/juliad)**
>
> Embed Julia in Dlang. Contribute to symmetryinvestments/juliad development by creating an account on GitHub.

There some limited support to CALL Julia from D (not seen other direction), updated 2 days ago, now with “1D Arrays to Julia”, but not e.g. “1D Arrays from Julia” (not yet checked, maybe this package is in rapid development).

I’m not really suggesting calling D library, or the Rust wrapper, when you can call the C library straight or Python’s wrapper if it helps.
