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 numbers
It 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
This message was issued to members of www.jiscmail.ac.uk/CCP4BB, a mailing list
hosted by www.jiscmail.ac.uk, terms & conditions are available at
https://www.jiscmail.ac.uk/policyandsecurity/