odelaneau / shapeit4

Segmented HAPlotype Estimation and Imputation Tool
MIT License
90 stars 18 forks source link

Problem opening index file #29

Open variani opened 4 years ago

variani commented 4 years ago

Hi,

When running shapeit4 v4.1.2, I get the following error in the Initialization step:

Initialization:
[E::hts_hopen] Failed to open file output/1.unphased.vcf.gz.csi
[E::hts_open_format] Failed to open file output/1.unphased.vcf.gz.csi

The command:

shapeit4 --input output/2.unphased.vcf.gz.csi --map chr2.b38.gmap.gz --region 2 --output output/2.phased.vcf.gz

I tried different ways to install shapeit4 and its dependencies, e.g. building from source or using bioconda, but the error keeps showing up.

I wonder whether you have any clue of this error. Something wrong with HTSlib? Library paths? Thank you.

Best, Andrey

variani commented 4 years ago

A clarification: the error occurs when I call shapeit4 from my snakemake analysis pipeline. In the terminal shapeit4 works fine. So please give a low priority to my error report, it is likely to be something specific to snakemake.

My current best guess is that bcftools (which I use for indexing) and shapeit4 are linked to different versions of HTSlib. That motivated me to use bioconda with shapeit4 package available there. But that didn't help.

FranjoIM commented 2 years ago

I have the same issue.

odelaneau commented 2 years ago

Did you check that the index files exist and are in the same folder than the VCF file?

FranjoIM commented 2 years ago

Yes - the issue was in actual VCF files - Plink passed non-standard VCF characters into VCF format which messed things up down the line. SHAPEIT4 now runs perfectly, after fixing this error, thanks.

zxc307 commented 2 years ago

Yes - the issue was in actual VCF files - Plink passed non-standard VCF characters into VCF format which messed things up down the line. SHAPEIT4 now runs perfectly, after fixing this error, thanks.

Hi there, I have the same issue. Can you provide some details about fixing the issue? What specific characters did you remove? Thanks.

FranjoIM commented 2 years ago

@zxc307 it's honestly been a while, and I can't remember exactly--but I think the issue was with the way indels were coded in the VCF file.