Open anton083 opened 3 months ago
If it's any use here, you can use AtomRecord
to write from BioStructures without having to construct the whole object:
julia> pdbline(AtomRecord(false, 669, "CA", ' ', "ILE", "A", 90, ' ', [31.743, 33.11, 31.221], 1.00, 25.76, "C", ""))
"ATOM 669 CA ILE A 90 31.743 33.110 31.221 1.00 25.76 C "
See more at https://biojulia.dev/BioStructures.jl/stable/documentation/#Writing-PDB-files.
I'd like to fix any usability issues you have with BioStructures though so let me know if that isn't sufficient.
The package has turned out quite clean with nice abstractions. The ideas from earlier versions have been distilled to an elegant set of types and functions, with some new additions. The elephant in the room however is the Protein submodule, with plenty of arbitrary design decisions having been made. Having support for proteins in the package natively is convenient, but PDB IO basically requires us to have 2 dependencies: BioStructures for robust PDB reading, and PDBTools for easy writing. BioStructures writing is a pain in the ass, as we'd basically need to construct an entire Structure with models, chains, residues from scratch using a Backbone and some extra vectors like amino acids and residue numbers. Nevertheless, we could technically support proteins with a BioStructures extension, for example by defining a Backbone(chain::BioStructures.Chain, residue_selectors...) constructor or something, keeping the core package clean. Alternatively, there could be a whole other package for protein stuff.