zwdzwd / transvar

TransVar - multiway annotator for precision medicine
Other
115 stars 34 forks source link

AttributeError: 'RefGenome' object has no attribute 'faidx_handle' #53

Open LiviaMoura opened 2 years ago

LiviaMoura commented 2 years ago

Hello... I just installed transvar and I followed the Quick starting Guide

# set up databases
transvar config --download_anno --refversion hg19/hg38

# in case you don't have a reference
transvar config --download_ref --refversion hg19/hg38

It seems that the reference isn't being downloaded (arrow below)

--> transvar panno -i 'EGFR:p.D770_N771insNPG' --ucsc
Reference sequence doesn't exist
samtools faidx file doesn't exist for reference.    <------------------------
Traceback (most recent call last):
  File "/Users/liviamoura/.pyenv/versions/3.6.13/bin/transvar", line 197, in <module>
    args.func(args)
  File "/Users/liviamoura/.pyenv/versions/3.6.13/lib/python3.6/site-packages/transvar/anno.py", line 206, in main_anno
    db = AnnoDB(args, config)
  File "/Users/liviamoura/.pyenv/versions/3.6.13/lib/python3.6/site-packages/transvar/annodb.py", line 52, in __init__
    faidx.init_refgenome(args.reference if args.reference else None)
  File "/Users/liviamoura/.pyenv/versions/3.6.13/lib/python3.6/site-packages/transvar/faidx.py", line 103, in init_refgenome
    refgenome = RefGenome(r) if r else None
  File "/Users/liviamoura/.pyenv/versions/3.6.13/lib/python3.6/site-packages/transvar/faidx.py", line 26, in __init__
    self.load_faidx()
  File "/Users/liviamoura/.pyenv/versions/3.6.13/lib/python3.6/site-packages/transvar/faidx.py", line 37, in load_faidx
    for line in self.faidx_handle:
AttributeError: 'RefGenome' object has no attribute 'faidx_handle'
SophieS9 commented 1 year ago

Hi @LiviaMoura did you find a solution for this problem? I am also seeing the same issue!

tetedange13 commented 1 year ago

Hi both @SophieS9 and @LiviaMoura,

Maybe you should find your transvar.cfg (config file) => For @LiviaMoura, path should be like : "/Users/liviamoura/.pyenv/versions/3.6.13/lib/python3.6/site-packages/transvar/transvar.cfg" => Otherwise use find /path/to/install/transvar -name "transvar.cfg"

Then you open it with an editor and check for line reference = of your wanted assembly (add it if absent) => There you should put the path towards a FASTA corresponding to your assembly (it should be indexed too)

I have not tried it myself but I think you can also use transvar config --refversion hg19/hg38 --download_ref

Hope this helps ! Have a nice day. Felix.