project-gemmi / gemmi

macromolecular crystallography library and utilities
https://project-gemmi.github.io/
Mozilla Public License 2.0
205 stars 42 forks source link

-f <file> seems not to work as I expect #321

Closed KayDiederichs closed 1 week ago

KayDiederichs commented 2 weeks ago

[dikay@turn29 gemmi]$ gemmi grep -f year2023.txt _refine.pdbx_refine_id Error: Cannot open /big_disk_bcachefs/data/kay/mmcif_files/4fpq.cif:4FPQ:2023-03-01: No such file or directory [dikay@turn29 gemmi]$ head year2023.txt /big_disk_bcachefs/data/kay/mmcif_files/4fpq.cif:4FPQ:2023-03-01 /big_disk_bcachefs/data/kay/mmcif_files/5sbg.cif:5SBG:2023-02-15 /big_disk_bcachefs/data/kay/mmcif_files/5sbi.cif:5SBI:2023-02-15 /big_disk_bcachefs/data/kay/mmcif_files/5sbj.cif:5SBJ:2023-02-15 /big_disk_bcachefs/data/kay/mmcif_files/5smj.cif:5SMJ:2023-03-01 /big_disk_bcachefs/data/kay/mmcif_files/5sml.cif:5SML:2023-04-26 /big_disk_bcachefs/data/kay/mmcif_files/5smm.cif:5SMM:2023-04-26 /big_disk_bcachefs/data/kay/mmcif_files/5smn.cif:5SMN:2023-04-26 /big_disk_bcachefs/data/kay/mmcif_files/5sn5.cif:5SN5:2023-12-20 /big_disk_bcachefs/data/kay/mmcif_files/5sn6.cif:5SN6:2023-12-20 [dikay@turn29 gemmi]$ gemmi --version gemmi 0.6.2 [dikay@turn29 gemmi]$ which gemmi /usr/local/ccp4-8.0/ccp4-8.0/bin/gemmi

Hi, first-time gemmi user here. I'm trying to "gemmi grep" the CIF files in year2023.txt (file created by gemmi) but I get the error message shown above. What am I doing wrong? Do the CIF files have to be compressed? I'm asking because after awk -F ':' '{print $1}' year2023.txt >2023.txt the command gemmi grep -f 2023.txt _refine.pdbx_refine_id works as expected. So gemmi does not seem to recognize the end of the filename. Thanks, Kay

wojdyr commented 2 weeks ago

Hi Kay, indeed, it doesn't try to recognize the end of the filename, just takes the whole line. I don't remember why it's documented otherwise. I'll need to check the history.

wojdyr commented 1 week ago

This was a mistake in documentation introduced when I was editing it long time ago. Fixed now.

Recognizing the end of a filename would be tricky, the path can contain spaces and punctation; it's safer not to try.