<pre><code>$&gt;freebayes -f Subject_1 output.Sorted.bam &gt; output.Sorted.vcf 

terminate called after throwing an instance of 'std::out_of_range'
  what():  basic_string::substr: __pos (which is 166) &gt; this-&gt;size() (which is 0)
Aborted (core dumped)
<span class="math-container">```</span>
</code></pre>

CC BY-SA 4.0
2024-12-24T16:30:42.137Z
Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
Community
CC BY-SA 4.0
2024-12-25T07:48:39.207Z
Please add more context to your question. In particular, explain what you want to do, and what you expected to happen. Because your error appears to be due to an input parsing issue, please also include the first few lines of input including header information, e.g. the output of `samtools view -h output.Sorted.bam | head -n 50`
gringer
CC BY-SA 4.0
2024-12-26T07:35:43.477Z
I tried to use NCBI BLAST output in SAM format as input to convert to BCF format. I converted the SAM to BAM format using SAMTOOLS and then indexed it. The error generated above is while trying to do this. When I try to use FREEBAYES for BWA MEM based aligner in SAM format, it did not generate any error, but the result file was empty. I tried using BCFTOOLS to convert the SAM format file, and it worked without any issues. Am I missing here something for how to use FREEBAYES ?
ABHISHEK SINGH
<genome><sequence-annotation><sequence-analysis><genome-sequencing><alignments>
Freebayes giving problem in converting SAM to BCF
# Freebayes giving problem in converting SAM to BCF

(Asked by: username_0 on 2024-12-24)

$>freebayes -f Subject_1 output.Sorted.bam > output.Sorted.vcf 

terminate called after throwing an instance of 'std::out_of_range'
  what():  basic_string::substr: __pos (which is 166) > this->size() (which is 0)
Aborted (core dumped)
```

**Tags:** genome, sequence-annotation, sequence-analysis, genome-sequencing, alignments
> **Comments:**
> **username_1**: Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.  
> **username_2**: Please add more context to your question. In particular, explain what you want to do, and what you expected to happen. Because your error appears to be due to an input parsing issue, please also include the first few lines of input including header information, e.g. the output of `samtools view -h output.Sorted.bam | head -n 50`  
> **username_0**: I tried to use NCBI BLAST output in SAM format as input to convert to BCF format. I converted the SAM to BAM format using SAMTOOLS and then indexed it. The error generated above is while trying to do this. When I try to use FREEBAYES for BWA MEM based aligner in SAM format, it did not generate any error, but the result file was empty. I tried using BCFTOOLS to convert the SAM format file, and it worked without any issues. Am I missing here something for how to use FREEBAYES ?  

---

## 0 answers

