Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
libcifpp
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
libcifpp
Commits
24aa7a70
Unverified
Commit
24aa7a70
authored
Feb 07, 2023
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix writing pdbx_ens_id
parent
5ade3d6c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
4 deletions
+27
-4
src/pdb/cif2pdb.cpp
+27
-4
No files found.
src/pdb/cif2pdb.cpp
View file @
24aa7a70
...
@@ -672,6 +672,7 @@ class Fi : public FBase
...
@@ -672,6 +672,7 @@ class Fi : public FBase
virtual
void
out
(
std
::
ostream
&
os
)
virtual
void
out
(
std
::
ostream
&
os
)
{
{
std
::
string
s
{
text
()
};
std
::
string
s
{
text
()
};
if
(
s
.
empty
())
if
(
s
.
empty
())
{
{
os
<<
"NULL"
;
os
<<
"NULL"
;
...
@@ -679,7 +680,18 @@ class Fi : public FBase
...
@@ -679,7 +680,18 @@ class Fi : public FBase
os
<<
std
::
string
(
os
.
width
()
-
4
,
' '
);
os
<<
std
::
string
(
os
.
width
()
-
4
,
' '
);
}
}
else
else
os
<<
std
::
stol
(
s
);
{
long
l
=
0
;
auto
r
=
std
::
from_chars
(
s
.
data
(),
s
.
data
()
+
s
.
length
(),
l
);
if
(
r
.
ec
!=
std
::
errc
())
{
if
(
VERBOSE
>
0
)
std
::
cerr
<<
"Failed to write '"
<<
s
<<
"' as a long from field "
<<
mField
<<
", this indicates an error in the code for writing PDB files"
<<
std
::
endl
;
os
<<
s
;
}
else
os
<<
l
;
}
}
}
};
};
...
@@ -712,7 +724,7 @@ class Ff : public FBase
...
@@ -712,7 +724,7 @@ class Ff : public FBase
if
(
r
.
ec
!=
std
::
errc
())
if
(
r
.
ec
!=
std
::
errc
())
{
{
if
(
VERBOSE
>
0
)
if
(
VERBOSE
>
0
)
std
::
cerr
<<
"Failed to write '"
<<
s
<<
"' as a double, this indicates an error in the code for writing PDB files"
<<
std
::
endl
;
std
::
cerr
<<
"Failed to write '"
<<
s
<<
"' as a double
from field "
<<
mField
<<
"
, this indicates an error in the code for writing PDB files"
<<
std
::
endl
;
os
<<
s
;
os
<<
s
;
}
}
else
else
...
@@ -1384,7 +1396,7 @@ void WriteRemark3Refmac(std::ostream &pdbFile, const datablock &db)
...
@@ -1384,7 +1396,7 @@ void WriteRemark3Refmac(std::ostream &pdbFile, const datablock &db)
unit
=
" : "
;
unit
=
" : "
;
pdbFile
<<
RM3
(
" "
,
18
)
<<
type
pdbFile
<<
RM3
(
" "
,
18
)
<<
type
<<
SEP
(
""
,
-
2
)
<<
F
i
(
l
,
"pdbx_ens_id"
)
<<
SEP
(
""
,
-
2
)
<<
F
s
(
l
,
"pdbx_ens_id"
)
<<
SEP
(
" "
,
1
)
<<
Fs
(
l
,
"pdbx_auth_asym_id"
)
<<
SEP
(
" "
,
1
)
<<
Fs
(
l
,
"pdbx_auth_asym_id"
)
<<
SEP
(
unit
.
c_str
(),
-
6
)
<<
Fi
(
l
,
"pdbx_number"
)
<<
SEP
(
unit
.
c_str
(),
-
6
)
<<
Fi
(
l
,
"pdbx_number"
)
<<
SEP
(
" ;"
,
-
6
,
3
)
<<
Ff
(
l
,
"rms_dev_position"
)
<<
SEP
(
" ;"
,
-
6
,
3
)
<<
Ff
(
l
,
"rms_dev_position"
)
...
@@ -3365,11 +3377,22 @@ std::tuple<int, int> WriteCoordinatesForModel(std::ostream &pdbFile, const datab
...
@@ -3365,11 +3377,22 @@ std::tuple<int, int> WriteCoordinatesForModel(std::ostream &pdbFile, const datab
cif
::
tie
(
nextResName
,
nextChainID
,
nextICode
,
nextResSeq
,
modelNum
)
=
cif
::
tie
(
nextResName
,
nextChainID
,
nextICode
,
nextResSeq
,
modelNum
)
=
(
*
ri
).
get
(
"label_comp_id"
,
"auth_asym_id"
,
"pdbx_PDB_ins_code"
,
"auth_seq_id"
,
"pdbx_PDB_model_num"
);
(
*
ri
).
get
(
"label_comp_id"
,
"auth_asym_id"
,
"pdbx_PDB_ins_code"
,
"auth_seq_id"
,
"pdbx_PDB_model_num"
);
if
(
modelNum
.
empty
()
==
false
and
stol
(
modelNum
)
!=
model_nr
)
if
(
modelNum
.
empty
()
==
false
)
{
int
nr
=
0
;
auto
r
=
std
::
from_chars
(
modelNum
.
data
(),
modelNum
.
data
()
+
modelNum
.
length
(),
nr
);
if
(
r
.
ec
!=
std
::
errc
())
{
if
(
VERBOSE
>
0
)
std
::
cerr
<<
"Model number '"
<<
modelNum
<<
"' is not a valid integer"
<<
std
::
endl
;
}
if
(
nr
!=
model_nr
)
{
{
++
ri
;
++
ri
;
continue
;
continue
;
}
}
}
if
(
chainID
.
empty
()
==
false
and
terminatedChains
.
count
(
chainID
)
==
0
)
if
(
chainID
.
empty
()
==
false
and
terminatedChains
.
count
(
chainID
)
==
0
)
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment