DaehwanKimLab / hisat-genotype

GNU General Public License v3.0
25 stars 15 forks source link

FileNotFoundError: [Errno 2] No such file or directory: 'genotype_genome.locus' #22

Closed davetang closed 4 years ago

davetang commented 4 years ago

Hi Chris,

thank you for the latest updates. The option to specify where the index files are located is useful. However, I'm getting the following error:

wget https://github.com/DaehwanKimLab/hisat-genotype/archive/v1.3.1.tar.gz -O hisat-genotype-v1.3.1.tar.gz
tar -xzf hisat-genotype-v1.3.1.tar.gz
cd hisat-genotype-1.3.1/

./setup.sh -r -x test
wget ftp://ftp.ccb.jhu.edu/pub/infphilo/hisat-genotype/data/hla/ILMN.tar.gz
tar xvzf ILMN.tar.gz

# --index_dir is already set to test by default but I specified it again
./hisatgenotype --base hla --locus-list A -1 ILMN/NA12892.extracted.1.fq.gz -2 ILMN/NA12892.extracted.2.fq.gz --index_dir test --assembly
Traceback (most recent call last):
  File "./hisatgenotype", line 762, in <module>
    typing_process(args)
  File "./hisatgenotype", line 514, in typing_process
    args.verbose)
  File "/home/dtang/tmp/hisat-genotype-1.3.1/hisatgenotype_modules/hisatgenotype_typing_process.py", line 1356, in extract_reads
    for line in open("%s.locus" % base_fname):
FileNotFoundError: [Errno 2] No such file or directory: 'genotype_genome.locus'

genotype_genome.locus is in test.

ls test/genotype_genome.locus
test/genotype_genome.locus

Have I missed something?

Thanks, Dave

nikolasthuesen commented 4 years ago

I've had the same error, and I think there is a general issue here with relative path vs full path in this tool. I think the issue here is, that the tool is looking only for "genotype_genome.locus" which doesn't exist in the folder, you're in (/path/to/hisat-genotype-1.3.1/) but instead in (/path/to/hisat-genotype-1.3.1/test/genotype_genome.locus) I then tried to fix this by giving the full path to genotype_genome locus:

hisatgenotype -x /path/to/hisatgenotype/indicies/genotype_genome --base hla -p 10 -1 path/to/data/testdata/chr6_1.fq.gz -2 path/to/data/jens_testdata/chr6_2.fq.gz --out-dir /path/to/output/hisatgenotype It then returns:

No /path/to/hisatgenotype/indicies//path/to/hisatgenotype/indicies/genotype_genome.fa 
file found
Error:  /path/to/hisatgenotype/indicies/genotype_genome related files are missing in /path/to/hisatgenotype/indicies!

The tool only expects a relative path to genotype_genome_locus from your wd, and returns an error, if given the full path or anything else. It would be nice, if it was possible to give the full path, but that's maybe for the future.

chbe-helix commented 4 years ago

Hi Dave and Nikolas,

Thank you both for directing me to this error! I will have an emergency update to hisatgenotype (version 1.3.2) released by the end of the day to fix my oversight.

Thanks, Chris

chbe-helix commented 4 years ago

Hi Dave and Nikolas,

I have corrected the error and a few others that popped up along the way. Please use version 1.3.2 for the most stable version of HISATgenotype. Thanks for you patience!

Thanks, Chris