From 924c99ada3ece6c52b5a51ac01bd13b256276b09 Mon Sep 17 00:00:00 2001 From: Marcin Wojdyr Date: Wed, 13 Apr 2022 21:46:28 +0200 Subject: [PATCH] mtz2cif: clarify combination of --depo and --spec --- include/gemmi/mtz2cif.hpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/gemmi/mtz2cif.hpp b/include/gemmi/mtz2cif.hpp index b759e738e..d97981864 100644 --- a/include/gemmi/mtz2cif.hpp +++ b/include/gemmi/mtz2cif.hpp @@ -667,7 +667,11 @@ inline void MtzToCif::write_cif(const Mtz& mtz, const Mtz* mtz2, os << "\n\n_entry.id " << entry_id << "\n\n"; - write_special_marker_if_requested(os, merged); + // If we have user-provided spec file, we don't take responsibility + // for the result. (The spec is used for merged data only, so we can + // add the merker in unmerged block). + if (spec_lines.empty() || !merged) + write_special_marker_if_requested(os, merged); std::vector recipe; if (merged) @@ -778,6 +782,9 @@ inline void MtzToCif::write_cif(const Mtz& mtz, const Mtz* mtz2, if (merged) write_main_loop(*merged, recipe, buf, os); if (unmerged) { + // if --depo flag is used, the spec file is for the merged data only + if (write_special_marker_for_pdb) + spec_lines.clear(); prepare_recipe(*unmerged, recipe); write_main_loop(*unmerged, recipe, buf, os); }