Remove `pdb` from init_from_file options for BuildingBlock
See original GitHub issueThe minimum working example at the bottom shows clearly that if you write
and then init_from_file
, you will lose bond order information. This is because PDB files do not contain bond order information in their “CONECT” records.
Therefore, I suggest removing it as an init function (the with_structure_from_file
method is completely fine because it just loads the coordinates). Perhaps a warning is added for 6 months before removing?
What do you think, @lukasturcani?
import stk
from collections import Counter
pdb_writer = stk.PdbWriter()
bb = stk.BuildingBlock(
'CN(c1ccc(cc1)N=Cc2cccnc2)c3nc(nc(n3)N(C)c4ccc(cc4)N=Cc5ccccn5)'
'N(C)c6ccc(cc6)N=Cc7ccccn7'
)
# Get bond order information.
orders = []
for bond in bb.get_bonds():
orders.append(bond.get_order())
# Write to PDB.
bb.write(f'first.pdb')
# Read from PDB.
bb2 = stk.BuildingBlock.init_from_file('first.pdb')
# Get bond order information.
orders2 = []
for bond in bb2.get_bonds():
orders2.append(bond.get_order())
print(Counter(orders), Counter(orders2)) ## >> Counter({1.0: 72, 2.0: 24}) Counter({1.0: 96})
# Write to PDB.
bb.write(f'second.pdb')
# Compare text of PDBs.
s1 = pdb_writer.to_string(bb)
s2 = pdb_writer.to_string(bb2)
print(s1 == s2)
Issue Analytics
- State:
- Created a year ago
- Comments:15 (8 by maintainers)
Top Results From Across the Web
DROP PLUGGABLE DATABASE
Use the DROP PLUGGABLE DATABASE statement to drop a pluggable database (PDB). When you drop a PDB, the control file of the multitenant...
Read more >Database Migration from non-CDB to PDB - The Component ...
Create a new CDB with the required options and unplug/plug the now-PDB · Install the missing options into the CDB$ROOT · Remove the...
Read more >Multitenant : Flashback Pluggable Database (PDB) in Oracle ...
A guaranteed restored point prevents the database from removing ... There are several options for creating restore points at the PDB level.
Read more >Oracle 21c Drop Pluggable Database | Oracledbwr
We have two options while dropping pluggable database related to its datafiles. Dropping PDB including datafiles; Dropping PDB keeping datafiles.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
fair, we write XYZ files which do not preserve bond orders. so thats not too crazy
Can this be closed now? #449