mirror of
https://github.com/PDB-REDO/libcifpp.git
synced 2026-06-04 13:54:25 +08:00
Fix cif2pdb, somewhat...
This commit is contained in:
@@ -1811,13 +1811,10 @@ void WriteRemark3Phenix(std::ostream &pdbFile, const datablock &db)
|
||||
void WriteRemark3XPlor(std::ostream &pdbFile, const datablock &db)
|
||||
{
|
||||
auto refine = db["refine"].front();
|
||||
auto ls_shell = db["refine_ls_shell"].front();
|
||||
auto hist = db["refine_hist"].front();
|
||||
auto reflns = db["reflns"].front();
|
||||
auto analyze = db["refine_analyze"].front();
|
||||
auto &ls_restr = db["refine_ls_restr"];
|
||||
auto ls_restr_ncs = db["refine_ls_restr_ncs"].front();
|
||||
auto pdbx_xplor_file = db["pdbx_xplor_file"].front();
|
||||
|
||||
pdbFile << RM3("") << '\n'
|
||||
<< RM3(" DATA USED IN REFINEMENT.") << '\n'
|
||||
@@ -1837,7 +1834,11 @@ void WriteRemark3XPlor(std::ostream &pdbFile, const datablock &db)
|
||||
<< RM3(" FREE R VALUE : ", 7, 3) << Ff(refine, "ls_R_factor_R_free") << '\n'
|
||||
<< RM3(" FREE R VALUE TEST SET SIZE (%) : ", 7, 3) << Ff(refine, "ls_percent_reflns_R_free") << '\n'
|
||||
<< RM3(" FREE R VALUE TEST SET COUNT : ", 12, 6) << Fi(refine, "ls_number_reflns_R_free") << '\n'
|
||||
<< RM3(" ESTIMATED ERROR OF FREE R VALUE : ", 7, 3) << Ff(refine, "ls_R_factor_R_free_error") << '\n'
|
||||
<< RM3(" ESTIMATED ERROR OF FREE R VALUE : ", 7, 3) << Ff(refine, "ls_R_factor_R_free_error") << '\n';
|
||||
if (not db["refine_ls_shell"].empty())
|
||||
{
|
||||
auto ls_shell = db["refine_ls_shell"].front();
|
||||
pdbFile
|
||||
|
||||
<< RM3("") << '\n'
|
||||
<< RM3(" FIT IN THE HIGHEST RESOLUTION BIN.") << '\n'
|
||||
@@ -1850,8 +1851,10 @@ void WriteRemark3XPlor(std::ostream &pdbFile, const datablock &db)
|
||||
<< RM3(" BIN FREE R VALUE : ", 7, 3) << Ff(ls_shell, "R_factor_R_free") << '\n'
|
||||
<< RM3(" BIN FREE R VALUE TEST SET SIZE (%) : ", 5, 1) << Ff(ls_shell, "percent_reflns_R_free") << '\n'
|
||||
<< RM3(" BIN FREE R VALUE TEST SET COUNT : ", 12, 6) << Fi(ls_shell, "number_reflns_R_free") << '\n'
|
||||
<< RM3(" ESTIMATED ERROR OF BIN FREE R VALUE : ", 7, 3) << Ff(ls_shell, "R_factor_R_free_error") << '\n'
|
||||
<< RM3(" ESTIMATED ERROR OF BIN FREE R VALUE : ", 7, 3) << Ff(ls_shell, "R_factor_R_free_error") << '\n';
|
||||
}
|
||||
|
||||
pdbFile
|
||||
<< RM3("") << '\n'
|
||||
<< RM3(" NUMBER OF NON-HYDROGEN ATOMS USED IN REFINEMENT.") << '\n'
|
||||
<< RM3(" PROTEIN ATOMS : ", 12, 6) << Fi(hist, "pdbx_number_atoms_protein") << '\n'
|
||||
@@ -1903,7 +1906,13 @@ void WriteRemark3XPlor(std::ostream &pdbFile, const datablock &db)
|
||||
<< Ff(ls_restr, key("type") == "x_scbond_it", "dev_ideal_target") << '\n'
|
||||
<< RM3(" SIDE-CHAIN ANGLE (A**2) : ", 6, 2) << Ff(ls_restr, key("type") == "x_scangle_it", "dev_ideal") << SEP("; ", 6, 2)
|
||||
<< Ff(ls_restr, key("type") == "x_scangle_it", "dev_ideal_target") << '\n'
|
||||
<< RM3("") << '\n'
|
||||
<< RM3("") << '\n';
|
||||
|
||||
if (not db["refine_ls_restr_ncs"].empty())
|
||||
{
|
||||
auto ls_restr_ncs = db["refine_ls_restr_ncs"].front();
|
||||
|
||||
pdbFile
|
||||
<< RM3(" NCS MODEL : ") << Fs(ls_restr_ncs, "ncs_model_details") << '\n'
|
||||
|
||||
<< RM3("") << '\n'
|
||||
@@ -1913,7 +1922,14 @@ void WriteRemark3XPlor(std::ostream &pdbFile, const datablock &db)
|
||||
<< RM3(" GROUP 1 POSITIONAL (A) : ", 4, 2) << Ff(ls_restr_ncs, "rms_dev_position") << SEP("; ", 6, 2)
|
||||
<< Ff(ls_restr_ncs, "weight_position") << SEP("; ", 6, 2) << '\n'
|
||||
<< RM3(" GROUP 1 B-FACTOR (A**2) : ", 4, 2) << Ff(ls_restr_ncs, "rms_dev_B_iso") << SEP("; ", 6, 2)
|
||||
<< Ff(ls_restr_ncs, "weight_B_iso") << SEP("; ", 6, 2) << '\n'
|
||||
<< Ff(ls_restr_ncs, "weight_B_iso") << SEP("; ", 6, 2) << '\n';
|
||||
}
|
||||
|
||||
if (not db["pdbx_xplor_file"].empty())
|
||||
{
|
||||
auto pdbx_xplor_file = db["pdbx_xplor_file"].front();
|
||||
|
||||
pdbFile
|
||||
|
||||
// TODO: using only files from serial_no 1 here
|
||||
<< RM3("") << '\n'
|
||||
@@ -1921,6 +1937,7 @@ void WriteRemark3XPlor(std::ostream &pdbFile, const datablock &db)
|
||||
<< RM3(" TOPOLOGY FILE 1 : ") << Fs(pdbx_xplor_file, "topol_file") << '\n'
|
||||
|
||||
<< RM3("") << '\n';
|
||||
}
|
||||
}
|
||||
|
||||
void WriteRemark3NuclSQ(std::ostream &pdbFile, const datablock &db)
|
||||
@@ -2258,8 +2275,10 @@ void WriteRemark200(std::ostream &pdbFile, const datablock &db)
|
||||
std::string iis = cifSoftware(db, eDataReduction);
|
||||
std::string dss = cifSoftware(db, eDataScaling);
|
||||
|
||||
auto source = diffrn_source["source"].get<std::string>();
|
||||
std::string synchrotron, type;
|
||||
std::string source, synchrotron, type;
|
||||
if (not diffrn_source.empty())
|
||||
{
|
||||
source = diffrn_source["source"].get<std::string>();
|
||||
|
||||
if (source.empty())
|
||||
synchrotron = "NULL";
|
||||
@@ -2278,6 +2297,7 @@ void WriteRemark200(std::ostream &pdbFile, const datablock &db)
|
||||
if (type.empty())
|
||||
type = "NULL";
|
||||
}
|
||||
}
|
||||
|
||||
if (source.empty())
|
||||
source = "NULL";
|
||||
@@ -2343,7 +2363,7 @@ void WriteRemark200(std::ostream &pdbFile, const datablock &db)
|
||||
|
||||
for (auto &t : kTail)
|
||||
{
|
||||
auto s = t.r[t.field].get<std::string>();
|
||||
auto s = t.r.empty() ? "" : t.r[t.field].get<std::string>();
|
||||
|
||||
if (s.empty())
|
||||
{
|
||||
@@ -2384,6 +2404,9 @@ void WriteRemark280(std::ostream &pdbFile, const datablock &db)
|
||||
<< RM("MATTHEWS COEFFICIENT, VM (ANGSTROMS**3/DA): ", 6, 2) << Ff(exptl_crystal, "density_Matthews") << '\n'
|
||||
<< RM("") << '\n';
|
||||
|
||||
if (exptl_crystal_grow.empty())
|
||||
continue;
|
||||
|
||||
std::vector<std::string> conditions;
|
||||
auto add = [&conditions](const std::string c)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user