Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error downloading GRCm38.p6 #23

Closed
peterch405 opened this issue Jul 15, 2018 · 8 comments
Closed

Error downloading GRCm38.p6 #23

peterch405 opened this issue Jul 15, 2018 · 8 comments
Milestone

Comments

@peterch405
Copy link

$genomepy install GRCm38.p6 Ensembl
downloading from ftp://ftp.ensembl.org/pub/release-92/fasta/mus_musculus/dna/Mus_musculus.GRCm38.dna_sm.toplevel.fa.gz...
done...
name: GRCm38.p6
local name: GRCm38.p6
fasta: /media/chovanec/My_Passport/genomes/GRCm38.p6/GRCm38.p6.fa
Traceback (most recent call last):
  File "/home/chovanec/anaconda3/lib/python3.5/site-packages/pyfaidx/__init__.py", line 351, in __init__
    if mutable else 'rb')
IsADirectoryError: [Errno 21] Is a directory: 'GRCm38.p6'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/chovanec/anaconda3/lib/python3.5/site-packages/genomepy/functions.py", line 282, in __init__
    super(Genome, self).__init__(name)
  File "/home/chovanec/anaconda3/lib/python3.5/site-packages/pyfaidx/__init__.py", line 962, in __init__
    rebuild=rebuild)
  File "/home/chovanec/anaconda3/lib/python3.5/site-packages/pyfaidx/__init__.py", line 360, in __init__
    "Cannot read FASTA file %s" % filename)
pyfaidx.FastaNotFoundError: Cannot read FASTA file GRCm38.p6

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/chovanec/anaconda3/bin/genomepy", line 11, in <module>
    load_entry_point('genomepy==0.5.1', 'console_scripts', 'genomepy')()
  File "/home/chovanec/anaconda3/lib/python3.5/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/home/chovanec/anaconda3/lib/python3.5/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/home/chovanec/anaconda3/lib/python3.5/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/chovanec/anaconda3/lib/python3.5/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/chovanec/anaconda3/lib/python3.5/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/chovanec/anaconda3/lib/python3.5/site-packages/genomepy/cli.py", line 38, in install
    regex=regex, invert_match=not(match), annotation=annotation)
  File "/home/chovanec/anaconda3/lib/python3.5/site-packages/genomepy/functions.py", line 200, in install_genome
    g = Genome(name, genome_dir=genome_dir)
  File "/home/chovanec/anaconda3/lib/python3.5/site-packages/genomepy/functions.py", line 304, in __init__
    os.path.join(genome_dir, name)
FileNotFoundError: no *.fa files found in genome_dir GRCm38.p6/GRCm38.p6
@simonvh
Copy link
Member

simonvh commented Jul 16, 2018

Thanks for reporting. I tried the same command on my system, which works fine. That means it will be somewhat harder to debug but I'll try. Can you post the contents of the directory /media/chovanec/My_Passport/genomes/GRCm38.p6/? Do other genomes from Ensembl work? You can try with a small genome, for instance:

$ genomepy install WBcel235 Ensembl

@peterch405
Copy link
Author

The smaller genome installed no problem. I tried GRCm38.p6 again, same error. I am not sure why its doubling the dir path to GRCm38.p6/GRCm38.p6

$ls /media/chovanec/My_Passport/genomes/GRCm38.p6/
GRCm38.p6.fa  README.txt

These are my dependency versions:

pytest==2.9.2
click==6.6
pyfaidx==0.5.3
norns==0.1.2
xmltodict==0.9.2
msgpack==0.5.6
bucketcache==0.12.0
requests==2.13.0
appdirs==1.4.3

Python 3.5.5

@simonvh
Copy link
Member

simonvh commented Jul 17, 2018

Thanks for posting the dependencies. I have created an environment with the same versions, and that seems to work on my side. Is the GRCm38.p6.fa that is created a valid & correct FASTA file? Can you post the contents of ~/.config/genomepy/genomepy.yaml?

@peterch405
Copy link
Author

Yes seems to be a valid fasta. I do not have the genomepy.yaml file. When I was trying to generate it I got this error so I kinda gave up there:

$ genomepy config generate
Traceback (most recent call last):
  File "/home/chovanec/anaconda3/bin/genomepy", line 11, in <module>
    load_entry_point('genomepy==0.5.1', 'console_scripts', 'genomepy')()
  File "/home/chovanec/anaconda3/lib/python3.5/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/home/chovanec/anaconda3/lib/python3.5/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/home/chovanec/anaconda3/lib/python3.5/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/chovanec/anaconda3/lib/python3.5/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/chovanec/anaconda3/lib/python3.5/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/chovanec/anaconda3/lib/python3.5/site-packages/genomepy/cli.py", line 64, in config
    genomepy.functions.manage_config(command)
  File "/home/chovanec/anaconda3/lib/python3.5/site-packages/genomepy/functions.py", line 37, in manage_config
    with open(fname, "w") as fout:
FileNotFoundError: [Errno 2] No such file or directory: '/home/chovanec/.config/genomepy/genomepy.yaml'

I instead edited the default.yaml to get a custom genome directory. Maybe I broke something :S

@simonvh
Copy link
Member

simonvh commented Jul 18, 2018

Ah, that is a bug that a should fix in any case. What are the contents of default.yaml?

@peterch405
Copy link
Author

genome_dir: /media/chovanec/My_Passport/genomes/
plugin:
- gaps
- sizes

@simonvh
Copy link
Member

simonvh commented Jul 18, 2018

That config looks fine, but I think I might have found the error. Is there a directory called GRCm38.p6 in the directory from which you run genomepy? If so, genomepy should run fine when you run it from a different directory. This a situation that I had somehow not considered, a bug that I will fix for the next release.

simonvh added a commit that referenced this issue Jul 18, 2018
…ist.

* Fix issue where `genomepy install` fails if there is a directory with the genome name in the cwd.

See issue #23
@simonvh simonvh added this to the 0.5.3 milestone Nov 23, 2018
@simonvh
Copy link
Member

simonvh commented Mar 19, 2019

Should be fixed in 0.5.4. Feel free to re-open or post another issue if this is not the case.

@simonvh simonvh closed this as completed Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants