Getting samtools cram-to-bam error “[E::cram_get_ref] Failed to populate reference for id”?

Open
#662 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
30/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
c

Research direction

Start with the samtools view command and the referenced file.cram, reference.fa, reference.dict, and log.txt. Trace the reported cram_get_ref failures and determine whether the conversion is expected to emit these errors; done means the cause and expected behavior are established.

Written by the indexing model from the issue text.

Description

I am trying to convert a cram to a bam using the following samtools command set-up:

samtools view -h -b -@ 16 file.cram -o file.bam -T reference.fa 2>&1 | tee -a log.txt

However, when I try this, I get the following error:

    [E::cram_get_ref] Failed to populate reference for id 76
    [E::cram_get_ref] Failed to populate reference for id 102
    [E::cram_get_ref] Failed to populate reference for id 129
    .
    .
    .
    .
    [continues for over 20 lines like this]

I'm not sure why I am getting this error. I've made sure to use the same reference file that was used to generate the cram (I was using a different reference file before) and have also included the reference.dict file.

It's also noteworthy that, although I'm getting this error, the cram file still gets converted to a bam and downstream processes like GATK are still able to run on the bam. It's just concerning to be getting such an error message.

Dominant language
C
Stars
950
Forks
475
Avg merge
3d 13h
Merged PRs (30d)
11

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from samtools/htslib

All issues in samtools/htslib

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.