kliment-olechnovic / voronota

Voronota is a software tool for analyzing three-dimensional structures of biological macromolecules using the Voronoi diagram of atomic balls.
https://kliment-olechnovic.github.io/voronota/
MIT License
27 stars 3 forks source link

[Question] How to calculate the contacts for each of the models in a PDB file #2

Closed NatureGeorge closed 1 year ago

NatureGeorge commented 1 year ago

Hi! Thanks for providing such a useful tool for analyzing biomolecules in detail. I am wondering about how to calculate the contacts for each of the models in a PDB file. I tried

cat some.pdb | voronota get-balls-from-atoms-file ... --multimodel-chains > balls.txt
cat balls.txt | voronota calculate-contacts --annotated > contacts.txt
cat contacts.txt | voronota  expand-descriptors > expanded_contacts.txt

However, the contacts (i.e. graph) in expanded_contacts.txt shows that the calculation does not distinguish each of the models into a separate system but treats them as a single system.

So I am curious whether there is a way to calculate the graph separately. Let's say there are ten models in a PDB file, how to get these ten groups of contacts via adjustment of the arguments passed to voronota? (Technically I can split the input file into multiple files each of them containing a single model.)

kliment-olechnovic commented 1 year ago

Hello,

The '--multimodel-chains' option means that the pdb file is treated as a biological assembly - that is, all the MODEL blocks are joined into a single structure.

If you want to treat every MODEL block separately, you can split the big file into per-model files.

For example, running

cat 1nkl.pdb | voronota x-split-atoms-file --prefix split_1nkl_ --postfix .pdb > list_of_files.txt

will create multiple PDB files and write their names in the "list_of_files.txt" file.

Then you can process the files separately:

cat list_of_files.txt | while read -r FILEPATH
do
    cat "$FILEPATH" | voronota get-balls-from-atoms-file ... # and so on
done

The 'x-split-atoms-file' is 'hidden' and not visible in documentation, but I will consider making it more visible.

Cheers, Kliment

NatureGeorge commented 1 year ago

Appreciate your quick reply and solution. Thank you.