Hello, Just thought I would add one actionable suggestion to Robbie’s good advice.
At least one program is well equipped to do this type of operations without doing PDB file surgery: ChimeraX. See relevant documentation: - the setattr command can set named "attributes" to atom selections, and can read these attributes from a file: https://www.cgl.ucsf.edu/chimerax/docs/user/commands/setattr.html - attribute assignment file: https://www.cgl.ucsf.edu/chimerax/docs/user/formats/defattr.html - GUI tool to render or select by attribute: https://www.cgl.ucsf.edu/chimerax/docs/user/tools/render.html (corresponding command-line equivalents are listed in this page) I have not used this functionality yet, so I am not sure it can be saved as mmCIF. It works with ChimeraX’s internal representation of atomic models, which is the same regardless of whether the model was loaded from a PDB or mmCIF file. But it is at least a good way to do this kind of work within this program. I hope this helps, Guillaume On 15 Jan 2025, at 10:06, Robbie Joosten <robbie_joos...@hotmail.com<mailto:robbie_joos...@hotmail.com>> wrote: 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<mailto: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 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 ________________________________ To unsubscribe from the CCP4BB list, click the following link: https://www.jiscmail.ac.uk/cgi-bin/WA-JISC.exe?SUBED1=CCP4BB&A=1 VARNING: Klicka inte på länkar och öppna inte bilagor om du inte känner igen avsändaren och vet att innehållet är säkert. CAUTION: Do not click on links or open attachments unless you recognise the sender and know the content is safe. När du har kontakt med oss på Uppsala universitet med e-post så innebär det att vi behandlar dina personuppgifter. För att läsa mer om hur vi gör det kan du läsa här: http://www.uu.se/om-uu/dataskydd-personuppgifter/ E-mailing Uppsala University means that we will process your personal data. For more information on how this is performed, please read here: http://www.uu.se/en/about-uu/data-protection-policy ######################################################################## 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/