suchestoncampbelllab / gwasurvivr

GWAS Survival Package in R
11 stars 12 forks source link

Error in open.TabixFile(vcf) : 'indexname' must be character(1) #12

Closed pmk2020 closed 1 year ago

pmk2020 commented 3 years ago

Hi, I am trying to run this for a project and I get the following error: Error in open.TabixFile(vcf) : 'indexname' must be character(1)

I am not sure what is the reason for this error and was hoping maybe you can shed some light.

I am using vcf file and a .txt phenotype file

michiganCoxSurv(vcf.file=vcf.file, covariate.file=pheno.file, id.column="newid", time.to.event="time_to_event.", event="event", covariates=NULL, inter.term=NULL, print.covs="only", out.file=tempfile("michigan_only"), chunk.size=100, verbose=TRUE, clusterObj=NULL)

Thanks!

gaguerra commented 3 years ago

For anyone else who runs into this problem, you need to first generate an index file for your vcf.gz file. This can be done on the command line with bcftools bcftools index --tbi myfile.vcf.gz

The code seems to search for the file myfile.vcf.gz.tbi in the same directory that your vcf.gz file is in.

The documentation mentions a .csi index file is needed, but I still received the same error until I instead generated a .tbi file.

Hope this helps!