1111import java .io .IOException ;
1212import java .util .*;
1313
14+ import org .slf4j .Logger ;
15+ import org .slf4j .LoggerFactory ;
16+
1417import static java .lang .Math .*;
1518
1619/**
2225 */
2326public class BasePairParameters {
2427
28+ private static Logger log = LoggerFactory .getLogger (BasePairParameters .class );
29+
2530 private static String [] standardBases = new String [] {
2631 "SEQRES 1 A 1 A\n " +
2732 "ATOM 2 N9 A A 1 -1.291 4.498 0.000\n " +
@@ -119,7 +124,7 @@ public BasePairParameters(String name) {
119124 }
120125; }
121126 } catch (IOException |StructureException e ) {
122- System . out . println ("Error reading file from local drive or internet" );
127+ log . info ("Error reading file from local drive or internet" );
123128 structure = null ;
124129 }
125130 }
@@ -166,7 +171,7 @@ public List<Group[]> findPairs(List<Chain> chains) {
166171 for (int j = i +1 ; j < chains .size (); j ++) {
167172 String complement = complement (chains .get (j ).getSeqResSequence (), false );
168173 String match = longestCommonSubstring (c .getSeqResSequence (), complement );
169- //System.out.println (c.getSeqResSequence() + " " + chains.get(j).getSeqResSequence() + " " + match);
174+ //log.info (c.getSeqResSequence() + " " + chains.get(j).getSeqResSequence() + " " + match);
170175 int index1 = c .getSeqResSequence ().indexOf (match );
171176 int index2 = complement .length () - complement .indexOf (match ) - 1 ;
172177 for (int k = 0 ; k < match .length (); k ++) {
@@ -182,12 +187,12 @@ public List<Group[]> findPairs(List<Chain> chains) {
182187 Atom a2 = g2 .getAtom (ringMap .get (type2 ).get (0 ));
183188
184189 if (a1 == null ) {
185- System . out . println ("Error processing " + g1 .getPDBName () + " in " + pdbId );
190+ log . info ("Error processing " + g1 .getPDBName () + " in " + pdbId );
186191 if (pairSequence .length () != 0 && pairSequence .charAt (pairSequence .length ()-1 ) != ' ' ) pairSequence += ' ' ;
187192 continue ;
188193 }
189194 if (a2 == null ) {
190- System . out . println ("Error processing " + g2 .getPDBName () + " in " + pdbId );
195+ log . info ("Error processing " + g2 .getPDBName () + " in " + pdbId );
191196 if (pairSequence .length () != 0 && pairSequence .charAt (pairSequence .length ()-1 ) != ' ' ) pairSequence += ' ' ;
192197 continue ;
193198 }
@@ -196,7 +201,7 @@ public List<Group[]> findPairs(List<Chain> chains) {
196201 double dy = a1 .getY ()-a2 .getY ();
197202 double dz = a1 .getZ ()-a2 .getZ ();
198203 double distance = Math .sqrt (dx *dx +dy *dy +dz *dz );
199- //System.out.println ("C8-C6 Distance (Å): " + distance);
204+ //log.info ("C8-C6 Distance (Å): " + distance);
200205 // could be a base pair
201206 if (Math .abs (distance -10.0 ) < 2.0 ) {
202207 boolean valid = true ;
@@ -220,9 +225,9 @@ public List<Group[]> findPairs(List<Chain> chains) {
220225 }
221226 if (pairSequence .length () != 0 && pairSequence .charAt (pairSequence .length ()-1 ) != ' ' ) pairSequence += ' ' ;
222227 }
223- //System.out.println ();
228+ //log.info ();
224229 }
225- System . out . println ("Matched: " + pairSequence );
230+ log . info ("Matched: " + pairSequence );
226231 return result ;
227232 }
228233
@@ -270,11 +275,11 @@ public Matrix4d basePairReferenceFrame(Group[] pair) {
270275 }
271276 assert count == std2 .getAtoms ().size ();
272277
273- // System.out.println (ref1);
278+ // log.info (ref1);
274279 Matrix4d temp = (Matrix4d )ref1 .clone ();
275280 Matrix4d temp2 = (Matrix4d )temp .clone ();
276281 Matrix4d ref2 = sp .superposeAndTransform (pointact , pointref );
277- // System.out.println (ref2);
282+ // log.info (ref2);
278283 double [][] v = new double [3 ][4 ];
279284 double [] y3 = new double [4 ];
280285 double [] z3 = new double [4 ];
0 commit comments