masif icon indicating copy to clipboard operation
masif copied to clipboard

StrBioInfo problem

Open tao840813 opened this issue 3 years ago • 8 comments

Hi I have install StrBioInfo 0.9a0.dev1.

However, when I execute line "struct_assembly = struct.apply_biomolecule_matrices()[0]" in "00b-generate_assembly.py ",it show error AttributeError: 'PDBFrame' object has no attribute 'apply_biomolecule_matrices'

will this package gets update?

tao840813 avatar Sep 29 '21 07:09 tao840813

Hi, you need to use version v0.2.2 https://pypi.org/project/StrBioInfo/0.2.2/#history, which is the one that supports python2 as needed for the script in this repo.

jaumebonet avatar Sep 29 '21 21:09 jaumebonet

Not sure if you still need help with this, but I was able to get it working with the following setup for an anaconda environment, which did install StrBioInfo v0.2.2.

name: sbienv channels: - defaults - conda-forge - powerai dependencies: - strbioinfo

carlosmr12 avatar Dec 02 '21 03:12 carlosmr12

How to install StrBioInfo v0.2.2 in the py3 env of this project?

OtaviaW avatar May 10 '22 08:05 OtaviaW

Hi, v0.2.2 of StrBioInfo only supports py2 https://pypi.org/project/StrBioInfo/#history the pre-release version there (StrBioInfo 0.9a0.dev1) will support py3, but not the functions needed by the pipeline of masif, as is a full rewrite as dev is in standby. You'll need to run this one script in a py2 environment.

jaumebonet avatar May 16 '22 18:05 jaumebonet

Hi, v0.2.2 of StrBioInfo only supports py2 https://pypi.org/project/StrBioInfo/#history the pre-release version there (StrBioInfo 0.9a0.dev1) will support py3, but not the functions needed by the pipeline of masif, as is a full rewrite as dev is in standby. You'll need to run this one script in a py2 environment.

Thanks for telling me this, but I am still confusing. Does it means that the data preprocess pipeline all need to run in a py2 environment or just masif_ligand app specifically.

OtaviaW avatar May 17 '22 02:05 OtaviaW

That I cannot say for sure. My guess is that only the script that depends on the SrtBioInfo runs in py2 and all the rest in py3.

jaumebonet avatar May 17 '22 05:05 jaumebonet

Hi, v0.2.2 of StrBioInfo only supports py2 https://pypi.org/project/StrBioInfo/#history the pre-release version there (StrBioInfo 0.9a0.dev1) will support py3, but not the functions needed by the pipeline of masif, as is a full rewrite as dev is in standby. You'll need to run this one script in a py2 environment.

Thanks for telling me this, but I am still confusing. Does it means that the data preprocess pipeline all need to run in a py2 environment or just masif_ligand app specifically.

Only

python2.7 $masif_source/data_preparation/00b-generate_assembly.py $1 python2.7 $masif_source/data_preparation/00c-save_ligand_coords.py $1

run in python2. This is why in data_prepare_one.sh there is a line prior activating a python2 venv environment. After the two lines run we switch back to the python3 environment.

Basically you will need two separate environments and you must switch between them in the .sh script with "source your_python2_env/bin/activate"

I hope this helps!

Best, Oz

ozkilim avatar Jul 15 '22 11:07 ozkilim

I just faced the same problem. 00b-generate_assembly.py just generates the biological assembly from the asymmetric unit present in the PDB file. This might not be relevant for all PDB files as for many the biological assembly is the asymmetric unit. If this is important, you can generate it with pymol. 00c-save_ligand_coords.py just saves the coordinates of the ligand and the atom types into 2 npy files. The PDB_ligand_coords.npy has the shape (n_molecules, n_atoms, 3) and contains the X,Y,Z coordinates of the atoms The PDB_ligand_types.npy has the shape (n_molecules,) and contains a string with the ligand name, e.g: 'NAD'

If it is just this, we can easily skip the SBI(StrBioInfo) library, but I didn't dig deep.

eduardoftoliveira avatar Sep 30 '22 10:09 eduardoftoliveira