23 Commits

Author SHA1 Message Date
Jarrett Johnson
7b40e3e5fe PYMOL-5361: export BCIF implementation 2025-11-25 14:56:27 -05:00
Jarrett Johnson
fc8e47d4a2 Fix bcif datablock generation
Fixes #371
2024-06-10 20:28:52 -04:00
Jarrett Johnson
b91a720a6b Include algorithm header for CifFile module
Fixes #368
2024-06-06 15:36:13 -04:00
Jarrett Johnson
6731589c9b BinaryCIF Import Implementation (#353) 2024-06-05 00:01:49 -04:00
Jarrett Johnson
fbfda4a257 Replace NULL with nullptr 2024-05-20 09:07:33 -04:00
Dan N
91c8bcab9c Crash reading some .cif files with Windows line endings
See https://jira.schrodinger.com/browse/SHARED-7269 in Schrödinger bug tracking.

When a .cif file had windows line endings, we weren't treating
long cif data values correctly. Basically, we were
including the carriage return character in the data value!

A .cif long value looks like this:

    _pdbx_struct_assembly_gen.asym_id_list
    ;A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,AA,BA,CA,DA,EA,FA,GA,HA,IA,JA,KA,LA,MA,NA,OA,PA,QA,RA,SA,TA,UA,VA,WA,XA,YA,ZA,AB,BB,CB,DB,EB,FB,GB,HB,IB
    ;

where the key is "_pdbx_struct_assembly_gen.asym_id_list" and
the value is everything between the semicolons, excluding the
final line break. Before this commit, we removed a single
linebreak character before the `;`. After this commit, we
remove one or two line break characters.

This wouldn't show up in typical workflows, because the
.cif and .cif.gz files on RCSB use Linux line endings. We
only saw this because we unzip the .cif.gz files
line by line in one of our tests.
2020-10-18 21:55:28 -07:00
Thomas Holder
857bfa9394 Fix crash loading corrupt CIF (PYMOL-3501)
Don't leave `m_datablocks` in an incomplete state when returning early
from `cif_file::parse`.
2020-08-04 14:02:34 +02:00
Thomas Holder
f2f3dbb746 refactor CIF parser
- put in "pymol" namespace
- modernize memory management (C++11)
- make cif_array API more STL like (get_nrow() -> size(),
  row -> pos, etc.)
- as<> and to_vector<> with default
- cif_file::datablocks() preserves order (map -> vector)
2019-06-07 16:23:55 +02:00
Thomas Holder
97d166a858 clang-tidy modernize-use-nullptr
... and modernize-use-bool-literals for some "newer" files.
2019-01-18 10:04:10 +01:00
Thomas Holder
0dcfcc8344 clang-tidy modernize-loop-convert 2019-01-18 10:03:28 +01:00
Thomas Holder
e2df29a2ee polymer.protein polymer.nucleic multifilesave ...
* new selection keywords: polymer.protein polymer.nucleic
* new command: multifilesave
* MMTF export (requires simplemmtf python module)
* select: present, state -1 -> current object state
* create: source_state = -1 -> current
  (was: source_state = -1/0 -> all)
* cif: support quoted '?' and '.' as values
  cif_get_array -> None instead of empty string for ? and .
* fix copy discrete object w/o coords
* fix loading pdbqr AutoDock 4 atom types
* fix get_model('none') and get_str('mol', 'none')
* h_add refactored: 5x faster, support discrete objects
2018-02-07 15:44:17 +00:00
Thomas Holder
5acb6c4637 py37, align alt, flag 6+7
* Python 3.7 support (https://sf.net/p/pymol/bugs/197/)
* enable align with alt-codes
  - allow matching of non-alt-code to alt-code atoms in alignments
  - swap sorting priority of 'name' and 'alt' identifiers
  - sort empty 'alt' before non-empty 'alt'
* flags 6 and 7 for protein and nucleic acid
* mmCIF: read _atom_site.pdbx_formal_charge
* improve coordinate loading from mmcif chem_comp files
  - ignore columns with all ? (missing) values
  - select columns with "chem_comp_cartn_use" setting
* fix h_add: skip missing coordinates
2017-12-21 12:50:47 +00:00
Thomas Holder
27252080d6 fix mutagenesis wizard, FreeBSD support
- fix mutagenesis wizard "No Mutation" (update and rms commands)
- experimental FreeBSD support
2016-05-26 22:18:53 +00:00
Thomas Holder
7452ac469b 1.7.7.2
* cif_keepinmemory, pymol.querying.cif_get_array (experimental)
* ramp_update (new command)
* ramp objects now have "A > Range > ..." and "C > ..." menus
* mmCIF _chem_comp_atom: skip atoms with missing coordinates, prefer ideal over model coordinates
* cmd.set_key() decorator support
2015-08-12 16:45:05 +00:00
Thomas Holder
59d84a385b assembly fix, ref count fix, ...
* fix assemblies for cases like 4f3r which have multiple entries in the _pdbx_struct_assembly_gen table
* fix ref counts in iterate/alter subscripts
* improve side_chain_helper and nucleic_adic_mode situation
* eliminate all "try/catch" blocks for std::map lookups
* clean up some MemoryDebug stuff and remove unused jenarix wrapper
2015-06-23 14:07:26 +00:00
Thomas Holder
82c677e8c9 1.7.7.1 (unstable/experimental)
* change default (!) of "ignore_case" setting to off. Case insensitve
  identifier matching is not practical anymore with large structures
  which use upper and lower case chain identifiers.

* new setting "assembly" to load assemblies from mmCIF as multi-state
  objects with all_states=1

* new setting "cif_use_auth" controls whether mmCIF "auth" identifiers
  are used or not (on by default)

* mmCIF "CA/P ATOMS ONLY" chains: set atom-level cartoon_trace_atoms
  and ribbon_trace_atoms

* CIF discrete and irregular multi-model loading support

* support "pdb_honor_model_number" setting for CIF

* load multiple objects ("data_" blocks) from one CIF file (multiplex=-1)

* don't store AtmToIdx, DiscreteAtmToIdx or DiscreteCSet to PSE
  (unless pse_export_version <= 1.76)
2015-05-20 18:26:53 +00:00
Thomas Holder
e2883b2975 cif, SCALE, ...
- fix crash when loading malformed CIF file
- cif export fix for natoms = 0
- ignore SCALE matrices with negative determinant
2015-05-04 14:36:29 +00:00
Thomas Holder
dad194ad0f Restore scenes "disable" recall behavior...
- scenes: Restore the old behavior that when recalling a scene, all objects
  which were not present when storing the scene are disabled.
- fix auto-complete for filenames with spaces
- fix an object menu panel group ordering problem

Refactoring:
- remove unused variables (Partly applies https://sourceforge.net/p/pymol/bugs/166/)
- lots of: char* -> const char*
- remove inline Parse functions, simplify ParseFloat3List
- make functions static
2015-04-09 21:35:38 +00:00
Thomas Holder
9bb5c2d971 1.7.5.0 (unstable/experimental)
* mmCIF _atom_sites.fract_transf support (SCALEn equivalent)
* Complete port of scenes to C++
* warn user if setting a setting on the wrong level
* cmd.extendaa: shortcut for cmd.extend with argument auto-completion
* reduced memory footprint of AtomInfoType
* expose "reps" to iterate/alter
* expose "protons" to iterate/alter
* adaptive cartoon quality and sampling, depending on number of atoms
* fix ring center color with cartoon_ring_color=default
* make SelectorGetTmp strictly molecular, fixes for example "dss" with group names
* fix "copy" can cause crash
* fix "custom" selection operator
* consider spec_count in shaders
* don't invalidate shaders for lighting settings
* don't disable shaders for all Intel chips
* don't touch sphere_mode when disabling shaders
* map_new buffer == -1 -> gaussian_resolution
* fix all_states picking
* remove cylinder_shader_ff_workaround and cylinders_shader_filter_faces
* remove unused gl_ambient setting
* fix Tcl/Tk menu settings logging
* fix: grid mode scales down label size incorrectly
* fix: no animate argument for cmd.origin
* fix side_chain_helper for hetatm polymer atoms
* fix .mmd export
* refactor many function to take "const" pointer arguments
2015-03-12 17:44:19 +00:00
Thomas Holder
425cf86a0b elimination of more compiler warnings
Includes https://sourceforge.net/p/pymol/patches/8/
2014-12-12 20:02:42 +00:00
Thomas Holder
d46608f6bc COMPONENTS_CIF
* use COMPONENTS_CIF environment variable to look for components.cif
* update fetchHosts and hostPaths URLs
* 1.7.3.6 (unstable/experimental)
2014-12-02 22:44:15 +00:00
Thomas Holder
7c4b4dd38b cif fixes, deprecate full_screen setting, 1.7.3.4
* cif: read first_model_num
* fixed _foo?bar lookup could fail in mmCIF parsing
* deprecated full_screen setting (use full_screen command)
2014-11-20 19:38:53 +00:00
Thomas Holder
e274a46085 fast CIF loading, 1.7.3.1 (unstable/experimental)
* fast PDBx/mmCIF and core CIF loading in C++
* new connect_mode=4 does bonding with components.cif dictionary
  (mmCIF only, components.cif needs to be present in current
  directory)
* gray out residues in the sequence viewer that are missing from the
  current state; Read missing residues from mmCIF files
  (_pdbx_unobs_or_zero_occ_residues records) so that they show up in
  the sequence viewer
* add spider map reading support
* load "map" as ccp4 instead of throwing "ambiguous" error
* xyz write support
* Improve right-button zoom: use origin instead of clipping slab
  center as depth indicator, fixes zoom speed when far clipping plane
  is very far away
* don't use dynamic_width for nonbonded rep
2014-10-16 20:14:27 +00:00