fprintf(out, "REMARK THIS IS A SIMULATION BOX\n");
if (pbcType != PbcType::Screw)
{
- fprintf(out, "CRYST1%9.3f%9.3f%9.3f%7.2f%7.2f%7.2f %-11s%4d\n", 10 * norm(box[XX]),
- 10 * norm(box[YY]), 10 * norm(box[ZZ]), alpha, beta, gamma, "P 1", 1);
+ fprintf(out,
+ "CRYST1%9.3f%9.3f%9.3f%7.2f%7.2f%7.2f %-11s%4d\n",
+ 10 * norm(box[XX]),
+ 10 * norm(box[YY]),
+ 10 * norm(box[ZZ]),
+ alpha,
+ beta,
+ gamma,
+ "P 1",
+ 1);
}
else
{
/* Double the a-vector length and write the correct space group */
- fprintf(out, "CRYST1%9.3f%9.3f%9.3f%7.2f%7.2f%7.2f %-11s%4d\n", 20 * norm(box[XX]),
- 10 * norm(box[YY]), 10 * norm(box[ZZ]), alpha, beta, gamma, "P 21 1 1", 1);
+ fprintf(out,
+ "CRYST1%9.3f%9.3f%9.3f%7.2f%7.2f%7.2f %-11s%4d\n",
+ 20 * norm(box[XX]),
+ 10 * norm(box[YY]),
+ 10 * norm(box[ZZ]),
+ alpha,
+ beta,
+ gamma,
+ "P 21 1 1",
+ 1);
}
}
atom_seq_number = atom_seq_number % 100000;
res_seq_number = res_seq_number % 10000;
- int n = fprintf(fp, "%-6s%5d %-4.4s%4.4s%c%4d %8.3f %8.3f %8.3f %6.2f %6.2f\n", pdbtp[record],
- atom_seq_number, atom_name, res_name, chain_id, res_seq_number, x, y, z,
- occupancy, b_factor);
+ int n = fprintf(fp,
+ "%-6s%5d %-4.4s%4.4s%c%4d %8.3f %8.3f %8.3f %6.2f %6.2f\n",
+ pdbtp[record],
+ atom_seq_number,
+ atom_name,
+ res_name,
+ chain_id,
+ res_seq_number,
+ x,
+ y,
+ z,
+ occupancy,
+ b_factor);
return n;
}
bfac = pdbinfo.bfac;
if (!usePqrFormat)
{
- gmx_fprintf_pdb_atomline(out, type, i + 1, nm.c_str(), altloc, resnm.c_str(), ch, resnr,
- resic, 10 * x[i][XX], 10 * x[i][YY], 10 * x[i][ZZ], occup,
- bfac, atoms->atom[i].elem);
+ gmx_fprintf_pdb_atomline(out,
+ type,
+ i + 1,
+ nm.c_str(),
+ altloc,
+ resnm.c_str(),
+ ch,
+ resnr,
+ resic,
+ 10 * x[i][XX],
+ 10 * x[i][YY],
+ 10 * x[i][ZZ],
+ occup,
+ bfac,
+ atoms->atom[i].elem);
if (atoms->pdbinfo && atoms->pdbinfo[i].bAnisotropic)
{
- fprintf(out, "ANISOU%5d %-4.4s%4.4s%c%4d%c %7d%7d%7d%7d%7d%7d\n", (i + 1) % 100000,
- nm.c_str(), resnm.c_str(), ch, resnr, (resic == '\0') ? ' ' : resic,
- atoms->pdbinfo[i].uij[0], atoms->pdbinfo[i].uij[1], atoms->pdbinfo[i].uij[2],
- atoms->pdbinfo[i].uij[3], atoms->pdbinfo[i].uij[4], atoms->pdbinfo[i].uij[5]);
+ fprintf(out,
+ "ANISOU%5d %-4.4s%4.4s%c%4d%c %7d%7d%7d%7d%7d%7d\n",
+ (i + 1) % 100000,
+ nm.c_str(),
+ resnm.c_str(),
+ ch,
+ resnr,
+ (resic == '\0') ? ' ' : resic,
+ atoms->pdbinfo[i].uij[0],
+ atoms->pdbinfo[i].uij[1],
+ atoms->pdbinfo[i].uij[2],
+ atoms->pdbinfo[i].uij[3],
+ atoms->pdbinfo[i].uij[4],
+ atoms->pdbinfo[i].uij[5]);
}
}
else
{
- gmx_fprintf_pqr_atomline(out, type, i + 1, nm.c_str(), resnm.c_str(), ch, resnr,
- 10 * x[i][XX], 10 * x[i][YY], 10 * x[i][ZZ], occup, bfac);
+ gmx_fprintf_pqr_atomline(out,
+ type,
+ i + 1,
+ nm.c_str(),
+ resnm.c_str(),
+ ch,
+ resnr,
+ 10 * x[i][XX],
+ 10 * x[i][YY],
+ 10 * x[i][ZZ],
+ occup,
+ bfac);
}
}
{
index[i] = i;
}
- write_pdbfile_indexed(out, title, atoms, x, pbcType, box, chainid, model_nr, atoms->nr, index,
- conect, false);
+ write_pdbfile_indexed(
+ out, title, atoms, x, pbcType, box, chainid, model_nr, atoms->nr, index, conect, false);
sfree(index);
}
}
else
{
- if (sscanf(line + 29, "%d%d%d%d%d%d", &atoms->pdbinfo[i].uij[U11], &atoms->pdbinfo[i].uij[U22],
- &atoms->pdbinfo[i].uij[U33], &atoms->pdbinfo[i].uij[U12],
- &atoms->pdbinfo[i].uij[U13], &atoms->pdbinfo[i].uij[U23])
+ if (sscanf(line + 29,
+ "%d%d%d%d%d%d",
+ &atoms->pdbinfo[i].uij[U11],
+ &atoms->pdbinfo[i].uij[U22],
+ &atoms->pdbinfo[i].uij[U33],
+ &atoms->pdbinfo[i].uij[U12],
+ &atoms->pdbinfo[i].uij[U13],
+ &atoms->pdbinfo[i].uij[U23])
== 6)
{
atoms->pdbinfo[i].bAnisotropic = TRUE;
atom_seq_number = atom_seq_number % 100000;
res_seq_number = res_seq_number % 10000;
- n = fprintf(fp, "%-6s%5d %-4.4s%c%4.4s%c%4d%c %8.3f%8.3f%8.3f%6.2f%6.2f %2s\n",
- pdbtp[record], atom_seq_number, tmp_atomname, alternate_location, tmp_resname,
- chain_id, res_seq_number, res_insertion_code, x, y, z, occupancy, b_factor,
+ n = fprintf(fp,
+ "%-6s%5d %-4.4s%c%4.4s%c%4d%c %8.3f%8.3f%8.3f%6.2f%6.2f %2s\n",
+ pdbtp[record],
+ atom_seq_number,
+ tmp_atomname,
+ alternate_location,
+ tmp_resname,
+ chain_id,
+ res_seq_number,
+ res_insertion_code,
+ x,
+ y,
+ z,
+ occupancy,
+ b_factor,
(element != nullptr) ? element : "");
return n;