Body: <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>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-12-24T16:30:42.137Z
Comments.Text: 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.
Comments.UserDisplayName: Community
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-12-25T07:48:39.207Z
Comments.Text: 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`
Comments.UserDisplayName: gringer
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-12-26T07:35:43.477Z
Comments.Text: 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 ?
Comments.UserDisplayName: ABHISHEK SINGH
Tags: <genome><sequence-annotation><sequence-analysis><genome-sequencing><alignments>
Title: Freebayes giving problem in converting SAM to BCF
ThreadText: # 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
  
  