cram_fd shrinkage and ditching of cram v1.0.
@jkbonfield is already working on this.
Since Apr 20, 2017.
Assessment
This issue has not been assessed yet.
Description
To-do when dropping CRAM v1.x support. Realistically it should have been ditched ages ago as I don't believe C and Java implementations were particularly interchangeable due to spec problems. I doubt any 1.x files exist in the wild.
Cram_fd has 32k of pointless data, but changing it now I suspect is an API breakage (I'd need to check the scope of that struct; size changing may be a problem). In cram_structs.h we have:
// lookup tables, stored here so we can be trivially multi-threaded
unsigned int bam_flag_swap[0x1000]; // cram -> bam flags
unsigned int cram_flag_swap[0x1000];// bam -> cram flags
These are intialised in cram_io.c. For CRAM v1.0 they were translation tables of BAM flags to CRAM flags and vice versa because the CRAM flags were identical but in a different bit order. This was one of things we sanitised when creating CRAM v2.0 so it is now essentially flag[i]=i and a nop. If we ditched support for v1.0 we could simplify a lot of this code base, including this chunk.
Why does it matter? If we're doing a merge and sharing headers between cram streams then up to 15% of memory usage may be that lookup table!
- Dominant language
- C
- Stars
- 950
- Forks
- 475
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 11
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from samtools/htslib
-
Difficulty 3/5 1-2 days Newbie friendliness 74/100
-
Difficulty 3/5 1-2 days Newbie friendliness 76/100
-
tabix performance Open
Similar issues
-
[adam] AdamNet network read doesn't cap to MAX_ADAM_PACKET_LEN, overflows client receive buffers Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
FujiNetWIFI/fujinet-firmware#1649 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
HarbourMasters/Shipwright#7229 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
riscv-software-src/riscv-isa-sim#2435 · 1 comment ·
-
bug Self Built Image SNAPSHOT Supported Device target/ramips
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100