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
9454fdc2
Unverified
Commit
9454fdc2
authored
Jul 21, 2022
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for parsing empty quoted strings.
parent
22543d8f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
+9
-4
src/Cif2PDB.cpp
+6
-3
src/CifParser.cpp
+3
-1
No files found.
src/Cif2PDB.cpp
View file @
9454fdc2
...
@@ -3522,7 +3522,7 @@ int WriteCoordinateTransformation(std::ostream& pdbFile, const Datablock& db)
...
@@ -3522,7 +3522,7 @@ int WriteCoordinateTransformation(std::ostream& pdbFile, const Datablock& db)
std
::
tuple
<
int
,
int
>
WriteCoordinatesForModel
(
std
::
ostream
&
pdbFile
,
const
Datablock
&
db
,
std
::
tuple
<
int
,
int
>
WriteCoordinatesForModel
(
std
::
ostream
&
pdbFile
,
const
Datablock
&
db
,
const
std
::
map
<
std
::
string
,
std
::
tuple
<
std
::
string
,
int
,
std
::
string
>>&
last_resseq_for_chain_map
,
const
std
::
map
<
std
::
string
,
std
::
tuple
<
std
::
string
,
int
,
std
::
string
>>&
last_resseq_for_chain_map
,
std
::
set
<
std
::
string
>&
TER
minatedChains
,
int
model_nr
)
std
::
set
<
std
::
string
>&
ter
minatedChains
,
int
model_nr
)
{
{
int
numCoord
=
0
,
numTer
=
0
;
int
numCoord
=
0
,
numTer
=
0
;
...
@@ -3554,7 +3554,7 @@ std::tuple<int,int> WriteCoordinatesForModel(std::ostream& pdbFile, const Databl
...
@@ -3554,7 +3554,7 @@ std::tuple<int,int> WriteCoordinatesForModel(std::ostream& pdbFile, const Databl
continue
;
continue
;
}
}
if
(
chainID
.
empty
()
==
false
and
TER
minatedChains
.
count
(
chainID
)
==
0
)
if
(
chainID
.
empty
()
==
false
and
ter
minatedChains
.
count
(
chainID
)
==
0
)
{
{
bool
terminate
=
nextChainID
!=
chainID
;
bool
terminate
=
nextChainID
!=
chainID
;
...
@@ -3573,7 +3573,7 @@ std::tuple<int,int> WriteCoordinatesForModel(std::ostream& pdbFile, const Databl
...
@@ -3573,7 +3573,7 @@ std::tuple<int,int> WriteCoordinatesForModel(std::ostream& pdbFile, const Databl
%
iCode
)
<<
std
::
endl
;
%
iCode
)
<<
std
::
endl
;
++
serial
;
++
serial
;
TER
minatedChains
.
insert
(
chainID
);
ter
minatedChains
.
insert
(
chainID
);
++
numTer
;
++
numTer
;
}
}
...
@@ -3597,6 +3597,9 @@ std::tuple<int,int> WriteCoordinatesForModel(std::ostream& pdbFile, const Databl
...
@@ -3597,6 +3597,9 @@ std::tuple<int,int> WriteCoordinatesForModel(std::ostream& pdbFile, const Databl
r
.
get
(
"id"
,
"group_PDB"
,
"label_atom_id"
,
"label_alt_id"
,
"auth_comp_id"
,
"auth_asym_id"
,
"auth_seq_id"
,
r
.
get
(
"id"
,
"group_PDB"
,
"label_atom_id"
,
"label_alt_id"
,
"auth_comp_id"
,
"auth_asym_id"
,
"auth_seq_id"
,
"pdbx_PDB_ins_code"
,
"Cartn_x"
,
"Cartn_y"
,
"Cartn_z"
,
"occupancy"
,
"B_iso_or_equiv"
,
"type_symbol"
,
"pdbx_formal_charge"
);
"pdbx_PDB_ins_code"
,
"Cartn_x"
,
"Cartn_y"
,
"Cartn_z"
,
"occupancy"
,
"B_iso_or_equiv"
,
"type_symbol"
,
"pdbx_formal_charge"
);
if
(
chainID
.
length
()
>
1
)
throw
std
::
runtime_error
(
"Chain ID "
+
chainID
+
" won't fit into a PDB file"
);
if
(
name
.
length
()
<
4
and
(
element
.
length
()
==
1
or
std
::
toupper
(
name
[
0
])
!=
std
::
toupper
(
element
[
0
])
or
std
::
toupper
(
name
[
1
])
!=
std
::
toupper
(
element
[
1
])))
if
(
name
.
length
()
<
4
and
(
element
.
length
()
==
1
or
std
::
toupper
(
name
[
0
])
!=
std
::
toupper
(
element
[
0
])
or
std
::
toupper
(
name
[
1
])
!=
std
::
toupper
(
element
[
1
])))
name
.
insert
(
name
.
begin
(),
' '
);
name
.
insert
(
name
.
begin
(),
' '
);
...
...
src/CifParser.cpp
View file @
9454fdc2
...
@@ -325,7 +325,9 @@ SacParser::CIFToken SacParser::getNextToken()
...
@@ -325,7 +325,9 @@ SacParser::CIFToken SacParser::getNextToken()
result
=
eCIFTokenValue
;
result
=
eCIFTokenValue
;
mTokenType
=
eCIFValueString
;
mTokenType
=
eCIFValueString
;
assert
(
mTokenValue
.
length
()
>=
3
);
if
(
mTokenValue
.
length
()
<
2
)
error
(
"Invalid quoted string token"
);
mTokenValue
=
mTokenValue
.
substr
(
1
,
mTokenValue
.
length
()
-
2
);
mTokenValue
=
mTokenValue
.
substr
(
1
,
mTokenValue
.
length
()
-
2
);
}
}
else
if
(
ch
==
quoteChar
)
else
if
(
ch
==
quoteChar
)
...
...
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