private void pdb_REMARK_Handler ( String line ) { if ( line == null || line . length ( ) < 11 ) return ; if ( line . startsWith ( "REMARK 800" ) ) { pdb_REMARK_800_Handler ( line ) ; } else if ( line . startsWith ( "REMARK 350" ) ) { if ( params . isParseBioAssembly ( ) ) { if ( bioAssemblyParser == null ) { bioAssemblyParser = new PDBBioAssemblyParser ( ) ; } bioAssemblyParser . pdb_REMARK_350_Handler ( line ) ; } // REMARK 3 (for R free) // note: if more than 1 value present (occurring in hybrid experimental technique entries, e.g. 3ins, 4n9m) // then last one encountered will be taken } else if ( line . startsWith ( "REMARK 3 FREE R VALUE" ) ) { // Rfree annotation is not very consistent in PDB format, it varies depending on the software // Here we follow this strategy: // a) take the '(NO CUTOFF)' value if the only one available (shelx software, e.g. 1x7q) // b) don't take it if also a line without '(NO CUTOFF)' is present (CNX software, e.g. 3lak) Pattern pR = Pattern . compile ( "^REMARK 3 FREE R VALUE\\s+(?:\\(NO CUTOFF\\))?\\s+:\\s+(\\d?\\.\\d+).*" ) ; Matcher mR = pR . matcher ( line ) ; if ( mR . matches ( ) ) { try { rfreeNoCutoffLine = Float . parseFloat ( mR . group ( 1 ) ) ; } catch ( NumberFormatException e ) { logger . info ( "Rfree value " + mR . group ( 1 ) + " does not look like a number, will ignore it" ) ; } } pR = Pattern . compile ( "^REMARK 3 FREE R VALUE\\s+:\\s+(\\d?\\.\\d+).*" ) ; mR = pR . matcher ( line ) ; if ( mR . matches ( ) ) { try { rfreeStandardLine = Float . parseFloat ( mR . group ( 1 ) ) ; } catch ( NumberFormatException e ) { logger . info ( "Rfree value '{}' does not look like a number, will ignore it" , mR . group ( 1 ) ) ; } } // REMARK 3 RESOLUTION (contains more info than REMARK 2, for instance multiple resolutions in hybrid experimental technique entries) // note: if more than 1 value present (occurring in hybrid experimental technique entries, e.g. 3ins, 4n9m) // then last one encountered will be taken } else if ( line . startsWith ( "REMARK 3 RESOLUTION RANGE HIGH" ) ) { Pattern pR = Pattern . compile ( "^REMARK 3 RESOLUTION RANGE HIGH \\(ANGSTROMS\\) :\\s+(\\d+\\.\\d+).*" ) ; Matcher mR = pR . matcher ( line ) ; if ( mR . matches ( ) ) { try { float res = Float . parseFloat ( mR . group ( 1 ) ) ; if ( pdbHeader . getResolution ( ) != PDBHeader . DEFAULT_RESOLUTION ) { logger . warn ( "More than 1 resolution value present, will use last one {} and discard previous {} " , mR . group ( 1 ) , String . format ( "%4.2f" , pdbHeader . getResolution ( ) ) ) ; } pdbHeader . setResolution ( res ) ; } catch ( NumberFormatException e ) { logger . info ( "Could not parse resolution '{}', ignoring it" , mR . group ( 1 ) ) ; } } } }
Handler for REMARK lines