Skip to content

Commit 96def7e

Browse files
committed
Parsing REMARK 2 and REMARK 3 (new format)
Apparently it affects only cryo-EM entries.
1 parent 6c5761c commit 96def7e

1 file changed

Lines changed: 25 additions & 13 deletions

File tree

biojava-structure/src/main/java/org/biojava/nbio/structure/io/PDBFileParser.java

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1351,7 +1351,7 @@ private void pdb_REMARK_Handler(String line) {
13511351
if (line.startsWith("REMARK 800")) {
13521352
pdb_REMARK_800_Handler(line);
13531353

1354-
} else if ( line.startsWith("REMARK 350")){
1354+
} else if ( line.startsWith("REMARK 350")){
13551355

13561356
if ( params.isParseBioAssembly()) {
13571357

@@ -1361,6 +1361,10 @@ private void pdb_REMARK_Handler(String line) {
13611361

13621362
bioAssemblyParser.pdb_REMARK_350_Handler(line);
13631363
}
1364+
} else if (line.startsWith("REMARK 2")) {
1365+
//REMARK 2 RESOLUTION.
1366+
Pattern pR = Pattern.compile("^REMARK 2 RESOLUTION.\\s+(\\d+\\.\\d+)\\s+ANGSTROMS\\..*");
1367+
handleResolutionLine(line, pR);
13641368

13651369
// REMARK 3 (for R free)
13661370
// note: if more than 1 value present (occurring in hybrid experimental technique entries, e.g. 3ins, 4n9m)
@@ -1396,21 +1400,29 @@ private void pdb_REMARK_Handler(String line) {
13961400
// then last one encountered will be taken
13971401
} else if (line.startsWith("REMARK 3 RESOLUTION RANGE HIGH")){
13981402
Pattern pR = Pattern.compile("^REMARK 3 RESOLUTION RANGE HIGH \\(ANGSTROMS\\) :\\s+(\\d+\\.\\d+).*");
1399-
Matcher mR = pR.matcher(line);
1400-
if (mR.matches()) {
1401-
try {
1402-
float res = Float.parseFloat(mR.group(1));
1403-
if (pdbHeader.getResolution()!=PDBHeader.DEFAULT_RESOLUTION) {
1404-
logger.warn("More than 1 resolution value present, will use last one {} and discard previous {} "
1405-
,mR.group(1), String.format("%4.2f",pdbHeader.getResolution()));
1406-
}
1407-
pdbHeader.setResolution(res);
1408-
} catch (NumberFormatException e) {
1409-
logger.info("Could not parse resolution '{}', ignoring it",mR.group(1));
1403+
handleResolutionLine(line, pR);
1404+
} else if (line.startsWith("REMARK 3 EFFECTIVE RESOLUTION")){
1405+
Pattern pR = Pattern.compile("^REMARK 3 EFFECTIVE RESOLUTION \\(ANGSTROMS\\)\\s+:\\s+(\\d+\\.\\d+).*");
1406+
handleResolutionLine(line, pR);
1407+
}
1408+
}
1409+
1410+
public void handleResolutionLine(String line, Pattern pR) {
1411+
Matcher mR = pR.matcher(line);
1412+
if (mR.matches()) {
1413+
final String resString = mR.group(1);
1414+
try {
1415+
float res = Float.parseFloat(resString);
1416+
final float resInHeader = pdbHeader.getResolution();
1417+
if (resInHeader!=PDBHeader.DEFAULT_RESOLUTION && resInHeader != res) {
1418+
logger.warn("More than 1 resolution value present, will use last one {} and discard previous {} "
1419+
,resString, String.format("%4.2f",resInHeader));
14101420
}
1421+
pdbHeader.setResolution(res);
1422+
} catch (NumberFormatException e) {
1423+
logger.info("Could not parse resolution '{}', ignoring it",resString);
14111424
}
14121425
}
1413-
14141426
}
14151427

14161428

0 commit comments

Comments
 (0)