Can we please start thinking a bit more in mmCIF please? Instead of hacking columns in PDB formatted files, perhaps we should look at molecular graphics programs' capabilities of colouring atoms or residues by a some column with label _somecategory.someitem. That way we are not hacking together corrupt files where a column shows other data than what it is defined to show.
Sorry for the rant,
Robbie
On 13 Jan 2025 22:49, Paul Emsley <pems...@mrc-lmb.cam.ac.uk> wrote:
On 13/01/2025 16:43, Marcin Wojdyr wrote:Dear Yahui,I am looking for a PDB editing tool to replace the B-factors numbers with another column of numbersIt depends where you get that new column of numbers from.Yes, this is most of the problem.
Presuming, as did Clemens, that your input is space separated fields for chain-id res-no and prop:
A 1 7.5 A 2 5.4 B 1 11.9 B 2 0.4 Here is a script for Coot 0.9.8.x(use-modules (ice-9 popen)
(ice-9 rdelim))
(let ((imol (read-pdb "test.pdb"))
(fn "A-b-props.tab"))
(call-with-input-file fn
(lambda (port)
(let loop ((line (read-line port))
(new-b-factors (list)))
(cond
((eof-object? line)
(set-b-factor-residues-scm 0 new-b-factors))
(else
(let ((fields (string-split line #\space)))
(let ((chain-id (car fields))
(res-no (cadr fields))
(prop (string->number (caddr fields))))
(let ((res-spec (list chain-id res-no "")))
(let ((item (list res-spec prop)))
(loop (read-line port)
(cons item new-b-factors))))))))))))
save it as prop-to-b-factor.scm and use Calculate -> Run Script
> then color the structure by pseudo-B-factors in ChimeraX
try Moorhen?
Paul.
To unsubscribe from the CCP4BB list, click the following link:
https://www.jiscmail.ac.uk/cgi-bin/WA-JISC.exe?SUBED1=CCP4BB&A=1
To unsubscribe from the CCP4BB list, click the following link:
https://www.jiscmail.ac.uk/cgi-bin/WA-JISC.exe?SUBED1=CCP4BB&A=1