Skip to content
Snippets Groups Projects
Commit a2a884d0 authored by Marco Biasini's avatar Marco Biasini
Browse files

don't try to write b-factor values that are larger than 999.99

parent 248b9727
No related branches found
No related tags found
No related merge requests found
...@@ -63,6 +63,7 @@ void write_atom(std::ostream& ostr, FormattedLine& line, ...@@ -63,6 +63,7 @@ void write_atom(std::ostream& ostr, FormattedLine& line,
const mol::AtomHandle& atom, int atomnum, const mol::AtomHandle& atom, int atomnum,
bool is_pqr, bool charmm_style) bool is_pqr, bool charmm_style)
{ {
std::cout << atom << std::endl;
mol::ResidueHandle res=atom.GetResidue(); mol::ResidueHandle res=atom.GetResidue();
char ins_code=res.GetNumber().GetInsCode(); char ins_code=res.GetNumber().GetInsCode();
StringRef record_name(atom.IsHetAtom() ? "HETATM" : "ATOM ", 6); StringRef record_name(atom.IsHetAtom() ? "HETATM" : "ATOM ", 6);
...@@ -126,7 +127,12 @@ void write_atom(std::ostream& ostr, FormattedLine& line, ...@@ -126,7 +127,12 @@ void write_atom(std::ostream& ostr, FormattedLine& line,
line(60, 6)=fmt::LPaddedFloat(atom.GetRadius(), 2); line(60, 6)=fmt::LPaddedFloat(atom.GetRadius(), 2);
} else { } else {
line(54, 6)=fmt::LPaddedFloat(atom.GetOccupancy(), 2); line(54, 6)=fmt::LPaddedFloat(atom.GetOccupancy(), 2);
line(60, 6)=fmt::LPaddedFloat(atom.GetBFactor(), 2); Real bfac=atom.GetBFactor();
if (bfac>999.99) {
line(60, 6)=fmt::LPaddedFloat(999.99, 2);
} else {
line(60, 6)=fmt::LPaddedFloat(bfac, 2);
}
} }
if (charmm_style) { if (charmm_style) {
line(72, 4)=fmt::RPadded(chain_name); line(72, 4)=fmt::RPadded(chain_name);
...@@ -154,7 +160,12 @@ void write_atom(std::ostream& ostr, FormattedLine& line, ...@@ -154,7 +160,12 @@ void write_atom(std::ostream& ostr, FormattedLine& line,
line(60, 6)=fmt::LPaddedFloat(atom.GetRadius(), 2); line(60, 6)=fmt::LPaddedFloat(atom.GetRadius(), 2);
} else { } else {
line(54, 6)=fmt::LPaddedFloat(atom.GetOccupancy(), 2); line(54, 6)=fmt::LPaddedFloat(atom.GetOccupancy(), 2);
line(60, 6)=fmt::LPaddedFloat(atom.GetBFactor(), 2); Real bfac=atom.GetBFactor();
if (bfac>999.99) {
line(60, 6)=fmt::LPaddedFloat(999.99, 2);
} else {
line(60, 6)=fmt::LPaddedFloat(bfac, 2);
}
} }
if (charmm_style) { if (charmm_style) {
line(72, 4)=fmt::RPadded(chain_name); line(72, 4)=fmt::RPadded(chain_name);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment