transcript / COG

Scripts and steps for making a consolidated COG database file for tools like DIAMOND.
9 stars 8 forks source link

Error trying to run merger.py #1

Open raymond4088 opened 3 years ago

raymond4088 commented 3 years ago

Hi Mr Sam,

Thank you for your contribution!

I have some issue when running the merger.py file.

On my terminal, I face a index error. Unfortunately I am just a beginner in Linux and just trying to annotate my data using KOG database. I have already unzipped the pro2003-2014.fa and the other two were left as it. All 4 files, including merger.py is in the same directory/

Thank you for your time!

My error in Terminal :-

ray@rain:~/Downloads/COG-master$ source /home/ray/anaconda2/bin/activate (base) ray@rain:~/Downloads/COG-master$ python merger.py prot2003-2014.fa cog2003-2014.csv cognames2003-2014.tab Traceback (most recent call last): File "merger.py", line 16, in cog_db[split[0]] = split[6] # GI ID == COG ID IndexError: list index out of range

My error in Spyder (Python 2.7) Console :-

runfile('/home/ray/Downloads/COG-master/merger.py', wdir='/home/ray/Downloads/COG-master') Traceback (most recent call last):

File "", line 1, in runfile('/home/ray/Downloads/COG-master/merger.py', wdir='/home/ray/Downloads/COG-master')

File "/home/ray/anaconda2/lib/python2.7/site-packages/spyder_kernels/customize/spydercustomize.py", line 827, in runfile execfile(filename, namespace)

File "/home/ray/anaconda2/lib/python2.7/site-packages/spyder_kernels/customize/spydercustomize.py", line 102, in execfile builtins.execfile(filename, *where)

File "/home/ray/Downloads/COG-master/merger.py", line 5, in prot_file = open(sys.argv[1], "r") # prot2003-2014.fa (note: unzipped)

IndexError: list index out of range

teddyaroca commented 2 years ago

Hi Mr Sam,

Thank you for your contribution!

I have some issue when running the merger.py file.

On my terminal, I face a index error. Unfortunately I am just a beginner in Linux and just trying to annotate my data using KOG database. I have already unzipped the pro2003-2014.fa and the other two were left as it. All 4 files, including merger.py is in the same directory/

Thank you for your time!

My error in Terminal :-

ray@rain:~/Downloads/COG-master$ source /home/ray/anaconda2/bin/activate (base) ray@rain:~/Downloads/COG-master$ python merger.py prot2003-2014.fa cog2003-2014.csv cognames2003-2014.tab Traceback (most recent call last): File "merger.py", line 16, in cog_db[split[0]] = split[6] # GI ID == COG ID IndexError: list index out of range

My error in Spyder (Python 2.7) Console :-

runfile('/home/ray/Downloads/COG-master/merger.py', wdir='/home/ray/Downloads/COG-master') Traceback (most recent call last):

File "", line 1, in runfile('/home/ray/Downloads/COG-master/merger.py', wdir='/home/ray/Downloads/COG-master')

File "/home/ray/anaconda2/lib/python2.7/site-packages/spyder_kernels/customize/spydercustomize.py", line 827, in runfile execfile(filename, namespace)

File "/home/ray/anaconda2/lib/python2.7/site-packages/spyder_kernels/customize/spydercustomize.py", line 102, in execfile builtins.execfile(filename, *where)

File "/home/ray/Downloads/COG-master/merger.py", line 5, in prot_file = open(sys.argv[1], "r") # prot2003-2014.fa (note: unzipped)

IndexError: list index out of range

Your cognames2003-2014.tab file is probably not in the right format. Make sure that file has one line per cog name all all the columns are separated by tab. You can copy everything from the https://ftp.ncbi.nlm.nih.gov/pub/COG/COG2020/data/cog-20.def.tab website into a new SUBLIME TEXT file or similar software to make sure that's the case.