reynoldsk / pySCA

A python implementation of the Statistical Coupling Analysis (SCA)
BSD 3-Clause "New" or "Revised" License
26 stars 23 forks source link

Error!!! Something wrong with PDBid or path... #8

Open chemgeeklian opened 5 years ago

chemgeeklian commented 5 years ago

I found an issue related to the MSAsearch function in scaTools.py. I am new to python and just came up with a naive solution. But the output it not consist with that described in the pySCA tutorial.

Firstly I have ggsearch36 installed, which means I can use ggsearch36 in command lines :

$ ggsearch36
USAGE
 ggsearch36 [-options] query_file library_file
 ggsearch36 -help for a complete option list

DESCRIPTION
 GGSEARCH performs a global/global database searches
 version: 36.3.8 Jul, 2015

COMMON OPTIONS (options must preceed query_file library_file)
 -s:  scoring matrix;
 -f:  gap-open penalty;
 -g:  gap-extension penalty;
 -S   filter lowercase (seg) residues;
 -b:  high scores reported (limited by -E by default);
 -d:  number of alignments shown (limited by -E by default);
 -I   interactive mode;

And in python3, I tried ./scaProcessMSA.py Inputs/s1Ahalabi_1470_nosnakes.an -s 3TGI -c E -t -n to do MSA for the S1A family.

It gives error outputs:

Trying MSASearch with ggsearch
Trying MSASearch with EMBOSS
Trying MSASearch with BioPython
Error!!! Something wrong with PDBid or path...

After debugging for days I found this issue comes from this line in scaTools.py: i_0 = [i for i in range(len(hd)) if output.split('\t')[1] in hd[i]]

It is that the byte type is not consist with str. I just solved it by modifying it to: i_0 = [i for i in range(len(hd)) if output.split(b'\t')[1] in bytes(hd[i],'utf-8')]

It works and could give the final MSA outputs, but with 205 positions for S1A instead of 245.

Thank you very much for your help.

dxu16 commented 5 years ago

I encountered the same problem with python 3.7. However, later I realized that it was probably coded based on python 2. After switching to python 2.7, I was able to execute the original code without any problem.

chemgeeklian commented 5 years ago

I encountered the same problem with python 3.7. However, later I realized that it was probably coded based on python 2. After switching to python 2.7, I was able to execute the original code without any problem.

I do not think it is the right way since python2 will be deprecated in 2020.

dxu16 commented 5 years ago

I encountered the same problem with python 3.7. However, later I realized that it was probably coded based on python 2. After switching to python 2.7, I was able to execute the original code without any problem.

I do not think it is the right way since python2 will be deprecated in 2020.

That is true. I have also tried using your solution and I think I got the same output as in python 2 in the tutorial. Why do you think that there should be 245 positions in the MSA instead of 205?

chemgeeklian commented 5 years ago

I encountered the same problem with python 3.7. However, later I realized that it was probably coded based on python 2. After switching to python 2.7, I was able to execute the original code without any problem.

I do not think it is the right way since python2 will be deprecated in 2020.

That is true. I have also tried using your solution and I think I got the same output as in python 2 in the tutorial. Why do you think that there should be 245 positions in the MSA instead of 205?

It's just my misunderstanding. Sorry for that.

vapourisedman commented 4 years ago

I am having the same problem now. vapour@osman:~/pySCA-master$ /usr/local/miniconda2/bin/python2.7 ./scaProcessMSA.py Inputs/s1Ahalabi_1470_nosnakes.an -s 3TGI -c E -t -n >> Outputs/s1A_halabi.log /usr/local/miniconda2/lib/python2.7/site-packages/Bio/PDB/StructureBuilder.py:91: PDBConstructionWarning: WARNING: Chain E is discontinuous at line 2569. PDBConstructionWarning) /usr/local/miniconda2/lib/python2.7/site-packages/Bio/PDB/StructureBuilder.py:91: PDBConstructionWarning: WARNING: Chain I is discontinuous at line 2570. PDBConstructionWarning) /usr/local/miniconda2/lib/python2.7/site-packages/Bio/PDB/StructureBuilder.py:91: PDBConstructionWarning: WARNING: Chain E is discontinuous at line 2580. PDBConstructionWarning) /usr/local/miniconda2/lib/python2.7/site-packages/Bio/PDB/StructureBuilder.py:91: PDBConstructionWarning: WARNING: Chain I is discontinuous at line 2758. PDBConstructionWarning) Error!!! Something wrong with PDBid or path...

I guess python 2 api is not supported anymore -- and things needs an update. if there is any solution outthere, ill be glad to hear it.

Cheers,