<p>I want to use <a href="https://faculty.washington.edu/browning/conform-gt.html" rel="nofollow noreferrer">conform-gt</a> to get rid of some REF prefix differences see <a href="https://bioinformatics.stackexchange.com/questions/19977/large-amount-of-ref-prefix-differences-after-lifting?noredirect=1#comment29310_19977">here</a>. Conform-gt needs the reference FASTA file split by chromosome and in .vcf.gz format. How can I do this?</p>
<p>I already tried <code>faidx</code> with</p>
<pre><code>faidx --transform bed reference/GRCh38_full_analysis_set_plus_decoy_hla.fa &gt; reference/GRCh38_full_analysis_set_plus_decoy_hla.bed
</code></pre>
<p>but this produced the following error:</p>
<pre><code>Traceback (most recent call last):
  File &quot;/home/oem/.local/bin/faidx&quot;, line 8, in &lt;module&gt;
    sys.exit(main())
  File &quot;/home/oem/.local/lib/python3.9/site-packages/pyfaidx/cli.py&quot;, line 202, in main
    write_sequence(args)
  File &quot;/home/oem/.local/lib/python3.9/site-packages/pyfaidx/cli.py&quot;, line 51, in write_sequence
    outfile.write(transform_sequence(args, fasta, name, start, end))
  File &quot;/home/oem/.local/lib/python3.9/site-packages/pyfaidx/cli.py&quot;, line 121, in transform_sequence
    line_len = fasta.faidx.index[name].lenc
KeyError: 'HLA-A*01'
</code></pre>

CC BY-SA 4.0
2022-11-09T18:19:57.780Z
Can you please [edit] your question and explain what you mean a bit more? Your title talks about converting fasta (sequences) to bed (regions) which is odd, but could be done if you mean "read the fasta and tell me what regions of a reference genome they map to". But then your question talks about converting fasta to "vcf.gz" format and this doesn't make sense unless you want some sort of gVCF file with an entry for every position of a genome.
terdon
CC BY-SA 4.0
2022-11-09T20:16:53.727Z
I reconsidered my question. I don't think that I really fully understood what I want to achieve with this format-conversion nor if I really understood what conform-gt really does. Back to the drawing board I guess. I will close this question and hope that the original question in my OP can solve my problem.
mugdi
<format-conversion><python>
Conversion FASTA to BED fails
# Conversion FASTA to BED fails

(Asked by: username_0 on 2022-11-09)

I want to use conform-gt to get rid of some REF prefix differences see here. Conform-gt needs the reference FASTA file split by chromosome and in .vcf.gz format. How can I do this?
I already tried faidx with
faidx --transform bed reference/GRCh38_full_analysis_set_plus_decoy_hla.fa > reference/GRCh38_full_analysis_set_plus_decoy_hla.bed

but this produced the following error:
Traceback (most recent call last):
  File "/home/oem/.local/bin/faidx", line 8, in 
    sys.exit(main())
  File "/home/oem/.local/lib/python3.9/site-packages/pyfaidx/cli.py", line 202, in main
    write_sequence(args)
  File "/home/oem/.local/lib/python3.9/site-packages/pyfaidx/cli.py", line 51, in write_sequence
    outfile.write(transform_sequence(args, fasta, name, start, end))
  File "/home/oem/.local/lib/python3.9/site-packages/pyfaidx/cli.py", line 121, in transform_sequence
    line_len = fasta.faidx.index[name].lenc
KeyError: 'HLA-A*01'

**Tags:** format-conversion, python
> **Comments:**
> **username_1**: Can you please [edit] your question and explain what you mean a bit more? Your title talks about converting fasta (sequences) to bed (regions) which is odd, but could be done if you mean "read the fasta and tell me what regions of a reference genome they map to". But then your question talks about converting fasta to "vcf.gz" format and this doesn't make sense unless you want some sort of gVCF file with an entry for every position of a genome.  
> **username_0**: I reconsidered my question. I don't think that I really fully understood what I want to achieve with this format-conversion nor if I really understood what conform-gt really does. Back to the drawing board I guess. I will close this question and hope that the original question in my OP can solve my problem.  

---

## 0 answers

