simonhmartin / genomics_general

General tools for genomic analyses.
343 stars 93 forks source link

IndexError in raxml_sliding_window.py #78

Closed MinaEvo closed 2 years ago

MinaEvo commented 2 years ago

Hello,

I got following error while running raxml_sliding_window.py in python2.7 to generate input gene tree data for astral from phased SNP vcf file.

$ python raxml_sliding_windows.py --windType coordinate --windSize 20000 --minSites 50 --genoFile phased_input.vcf --prefix out

started worker 0
Traceback (most recent call last):
  File "/home/nakaharu/tools/genomics_general-master/phylo/raxml_sliding_windows.py", line 302, in <module>
    for window in windowGenerator:
  File "/home/nakaharu/tools/genomics_general-master/phylo/genomics.py", line 1924, in slidingCoordWindows
    site = reader.nextSite(asDict = extractSpecificGTs)
  File "/home/nakaharu/tools/genomics_general-master/phylo/genomics.py", line 1882, in nextSite
    self.precompDict, addToPrecomp=self.precompDict["__counter__"]<self.precompDict["__maxSize__"])
  File "/home/nakaharu/tools/genomics_general-master/phylo/genomics.py", line 1840, in parseGenoLine
    "position": int(lineData[posCol]) if posCol >= 0 else None,
IndexError: list index out of range

I sincerely appreciate if someone could tell me solution.

Best regards, Mina

simonhmartin commented 2 years ago

Are you using a vcf file as input. If so, you'll need to convert it to my .geno format. Instructions here: https://github.com/simonhmartin/genomics_general/tree/master/VCF_processing

MinaEvo commented 2 years ago

Yes, it worked after I converted VCF to geno. Thank you so much.