fgvieira / ngsLD

Calculation of pairwise Linkage Disequilibrium (LD) under a probabilistic framework
GNU General Public License v2.0
43 stars 7 forks source link

ngsLD unable to read genotype input file #47

Closed BKrek89 closed 1 year ago

BKrek89 commented 1 year ago

Hello,

I'm not sure this was the correct place to post this but I'm having trouble getting ngsLD to run properly and it appears to have a problem with the format of my genotype file. I have a genotype file with samples as columns and rows as sites. Genotypes are denoted by -1, 0, 1, and 2. It's a tab-delimited text file with no headers (I tried with headers as well).

When I run ngsLD --n_threads 15 --geno snp.ngsld.geno.gz --posH pos.ngsld.txt --n_ind 134 --n_sites 14412 --out mylu.ld

I get the error message: ERROR: [read_geno] cannot read GZip GENO file. Check GENO file and number of sites!

It also has a bunch of rows of Header found! skipping line....

I have n_sites as 14412 and wc -l snp.ngsld.geno 14412

When I unzip and run it I get the error message ==> BINARY input file (always lkl)

===== ERROR: [main] invalid/corrupt genotype input file!

Is this something you could help me with? Thanks, -Bobby

fgvieira commented 1 year ago

Can you send me a small example file so I can reproduce the error? Maybe just a couple of SNPs and samples.

BKrek89 commented 1 year ago

Sure, will do. I've attached the position and genotype files containing 10 sites and 6 samples. sample.pos.txt sample.snp.txt

fgvieira commented 1 year ago

Were those files created in windows? If so, can you try running dos2unix on them and then compressing the geno file with gzip?

BKrek89 commented 1 year ago

Hey, sorry for the late reply. It worked! Those files were altered in windows before I tried running ngsld.

Thank you!