volkamerlab / teachopencadd

TeachOpenCADD: a teaching platform for computer-aided drug design (CADD) using open source packages and data
https://projects.volkamerlab.org/teachopencadd
Creative Commons Attribution 4.0 International
713 stars 197 forks source link

T010: AttributeError: module 'Bio' has no attribute 'Alphabet' #321

Closed Debojyoti91 closed 1 year ago

Debojyoti91 commented 1 year ago

If you have a question about TeachOpenCADD please use the Discussions tab above (https://github.com/volkamerlab/teachopencadd/discussions) instead of posting it here.

Please delete this section before submitting your issue.


Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior, feel free to paste a bit of Python in here.

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Configuration (please complete the following information):

Additional context Add any other context about the problem here.

Download PDB

structures = [Structure.from_pdbid(pdb_id) for pdb_id in pdb_ids]

Strip solvent and other artifacts of crystallography

proteins = [Structure.from_atomgroup(s.select_atoms("protein")) for s in structures]

Align proteins

results = align(proteins, method=METHODS["mda"])

for this segment, I am facing this issue AttributeError Traceback (most recent call last) /var/folders/00/ry7fj0h1699fnq5ygl9wwg180000gn/T/ipykernel_13127/1840525707.py in 4 proteins = [Structure.from_atomgroup(s.select_atoms("protein")) for s in structures] 5 # Align proteins ----> 6 results = align(proteins, method=METHODS["mda"])

/usr/local/anaconda3/lib/python3.9/site-packages/opencadd/structure/superposition/api.py in align(structures, user_select, method, **kwargs) 92 for mobile in mobiles: 93 mobile = _universe_to_atomgroup(mobile) ---> 94 result = aligner.calculate(structures=[reference, mobile], selections=[]) 95 # size of whole structures 96 reference_size = len(reference.residues)

/usr/local/anaconda3/lib/python3.9/site-packages/opencadd/structure/superposition/engines/base.py in calculate(self, structures, selections, *args, kwargs) 35 assert len(structures) == 2, message 36 ---> 37 return self._calculate(structures, selections, *args, *kwargs) 38 39 def _calculate(self, structures, selections, args, kwargs):

/usr/local/anaconda3/lib/python3.9/site-packages/opencadd/structure/superposition/engines/mda.py in _calculate(self, structures, selections, *args, *kwargs) 137 138 # Get matching atoms of selection --> 139 selection, alignment = self.matching_selection(selections) 140 ref_atoms = ref_selection.select_atoms(selection["reference"]) 141 mobile_atoms = mob_selection.select_atoms(selection["mobile"])

/usr/local/anaconda3/lib/python3.9/site-packages/opencadd/structure/superposition/engines/mda.py in matching_selection(self, ref_selection, mob_selection) 230 fasta["ref"], fasta["mob"], *_empty = alignment.get_gapped_sequences() 231 fasta.write("temp.fasta") --> 232 selection = fasta2select( 233 "temp.fasta", 234 ref_resids=ref_resids,

/usr/local/anaconda3/lib/python3.9/site-packages/opencadd/structure/superposition/sequences.py in fasta2select(fastafilename, ref_resids, ref_segids, target_resids, target_segids, backbone_selection) 115 116 """ --> 117 protein_gapped = Bio.Alphabet.Gapped(Bio.Alphabet.IUPAC.protein) 118 with open(fastafilename) as fasta: 119 alignment = Bio.AlignIO.read(fasta, "fasta", alphabet=protein_gapped)

AttributeError: module 'Bio' has no attribute 'Alphabet'

dominiquesydow commented 1 year ago

Hi @Debojyoti91, could you please let me know if working with the official teachopencadd installation resolves your issues as I suggested here: https://github.com/volkamerlab/teachopencadd/issues/148#issuecomment-1401574672

dominiquesydow commented 1 year ago

This issue was resolved in https://github.com/volkamerlab/teachopencadd/issues/148#issuecomment-1409804486 🎉