BDI-pathogens / phyloscanner

Phylogenetics between and within hosts at once, all along the genome.
GNU General Public License v3.0
44 stars 14 forks source link

TranslateCoords Error #33

Closed averagehat closed 5 years ago

averagehat commented 5 years ago

This error is from CentOS 7, using the InputFileList.csv and example commands defined in the readme.

-bash-4.2$ python ../phyloscanner_make_trees.py InputFileList.csv --auto-window-params 300,-700,1000,8300 --alignment-of-other-refs ../InfoAndInputs/2refs_HXB2_C.BW.fasta --pairwise-align-to B.FR.83.HXB2_LAI_IIIB_BRU.K03455
phyloscanner was called thus:
../phyloscanner_make_trees.py InputFileList.csv --auto-window-params 300,-700,1000,8300 --alignment-of-other-refs ../InfoAndInputs/2refs_HXB2_C.BW.fasta --pairwise-align-to B.FR.83.HXB2_LAI_IIIB_BRU.K03455
Warning: RAxML files are present in the working directory. If their names clash with those that phyloscanner will try to create, RAxML will fail to run. Continuing.
Traceback (most recent call last):
  File "/data/VD_Research/Admin/PBS/Software/phyloscanner/tools/TranslateCoords.py", line 85, in <module>
    AlignmentLength = len(SeqDict.values()[0])
TypeError: 'odict_values' object does not support indexing
Problem executing /data/VD_Research/Admin/PBS/Software/phyloscanner/tools/TranslateCoords.py. Quitting.
Traceback (most recent call last):
  File "../phyloscanner_make_trees.py", line 889, in <module>
    args.pairwise_align_to] + [str(coord) for coord in WindowCoords])
  File "../phyloscanner_make_trees.py", line 754, in TranslateCoords
    CoordsString = subprocess.check_output([TranslateCoordsCode]+CodeArgs)
  File "/media/VD_Research/Admin/PBS/Software/newconda/lib/python3.6/subprocess.py", line 336, in check_output
    **kwargs).stdout
  File "/media/VD_Research/Admin/PBS/Software/newconda/lib/python3.6/subprocess.py", line 418, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['/data/VD_Research/Admin/PBS/Software/phyloscanner/tools/TranslateCoords.py', 'temp_2RefsAln.fasta', 'B.FR.83.HXB2_LAI_IIIB_BRU.K03455', '1000', '1299', '2000', '2299', '3000', '3299', '4000', '4299', '5000', '5299', '6000', '6299', '7000', '7299', '8000', '8299']' returned n
on-zero exit status 1.

The result of running TranslateCoords.py alone:

-bash-4.2$ /data/VD_Research/Admin/PBS/Software/phyloscanner/tools/TranslateCoords.py temp_2RefsAln.fasta B.FR.83.HXB2_LAI_IIIB_BRU.K03455 1000 1299 2000 2299 3000 3299 4000 4299 5000 5299 6000 6299 7000 7299 8000 8299
Traceback (most recent call last):
  File "/data/VD_Research/Admin/PBS/Software/phyloscanner/tools/TranslateCoords.py", line 85, in <module>
    AlignmentLength = len(SeqDict.values()[0])
TypeError: 'odict_values' object does not support indexing
ChrisHIV commented 5 years ago

Hi there. This error looks like python 3 is being used; phyloscanner is in python 2. I've just updated the code to allow you to choose which of your python versions will be used: once you update your code to the latest version (changing directory to where your code lives and running 'git pull'), instead of running $ phyloscanner make trees.py [input and options] you can run $ python phyloscanner make trees.py [input and options] replacing python by your desired executable, e.g. python2, python2.7, /usr/bin/python etc. Does that fix the problem?

averagehat commented 5 years ago

Yes that resolved this error.