This is a test version of Biostars. For the public version, visit https://www.biostars.org.
TreeMix: ERROR: cannot open file treemix.freq.gz

Hi,

I'm running Mac OS Mojave and I've encountered an error trying to run TreeMix.

ERROR: cannot open file treemix.freq.gz

Here are the steps I have used:

Convert .vcf file to plink format (ped):

vcftools --vcf data.vcf --plink --out data

Convert to binary format (bin bam bed):

plink --file data --noweb --make-bed --recode --missing-genotype 0 --out data

Make and stratified plink file Edit the .fam file and write the population names in the third column and save as cluster file

plink --bfile data --freq --missing --within data.clust --noweb

OR

plink --bfile data --write-cluster --family

Edit clust file and place population names in the third column

plink --bfile data --freq --missing --within data.clst --noweb

zip file

gzip plink.frq.strat

use python script to convert to treemix file

plink2treemix.py plink.frq.strat.gz treemix.frq.gz

TreeMix:

treemix -i treemix.freq.gz -o out_stem
# ERROR: cannot open file treemix.freq.gz

I feel like this might be an issue with zipping on Mac? As, all the datafiles appear to be fine.

treemix gzip error snp plink

1 answer

Very simple solution here I just figured out. I changed my file name from treemix.frq.gz to treemix.gz and this worked!

Log in to answer this question.