@@ -74,14 +74,23 @@ public class BasePairParameters {
7474 "ATOM 6 C4 C A 1 0.837 2.868 0.000\n " +
7575 "ATOM 8 C5 C A 1 1.056 4.275 0.000\n " +
7676 "ATOM 9 C6 C A 1 -0.023 5.068 0.000\n " +
77- "END"
77+ "END" ,
78+ "SEQRES 1 A 1 U\n " +
79+ "ATOM 2 N1 U A 1 -1.284 4.500 0.000\n " +
80+ "ATOM 3 C2 U A 1 -1.462 3.131 0.000\n " +
81+ "ATOM 5 N3 U A 1 -0.302 2.397 0.000\n " +
82+ "ATOM 6 C4 U A 1 0.989 2.884 0.000\n " +
83+ "ATOM 8 C5 U A 1 1.089 4.311 0.000\n " +
84+ "ATOM 9 C6 U A 1 -0.024 5.053 0.000\n "
7885 };
7986
8087 // this is also hard-coded data about standard WC base pairs for both DNA and RNA
81- //private static String[] baseListDNA = {"A", "G", "T", "C"};
82- //private static String[] baseListRNA = {"A", "G", "U", "C"};
83- private static Map <String , Integer > map ;
84- private static Map <Integer , List <String >> ringMap ;
88+ protected static String [] baseListDNA = {"A" , "G" , "T" , "C" };
89+ protected static String [] baseListRNA = {"A" , "G" , "U" , "C" };
90+ protected static Map <String , Integer > map ;
91+ // private static List<String> RNAspecific = Arrays.asList("U", "URA"),
92+ // DNAspecific = Arrays.asList("DC", "C", "CYT");
93+ protected static Map <Integer , List <String >> ringMap ;
8594 static {
8695 map = new HashMap <>();
8796 map .put ("DA" , 0 ); map .put ("ADE" , 0 ); map .put ("A" , 0 );
@@ -100,14 +109,15 @@ public class BasePairParameters {
100109 ringMap .put (3 , Arrays .asList ("C6" , "C2" , "N3" , "C4" , "C5" , "N1" ));
101110 }
102111
103- private Structure structure ;
104- private boolean useRNA = false ;
105- private double [] pairParameters ;
112+ protected Structure structure ;
113+ protected boolean useRNA = false ;
114+ protected double [] pairParameters ;
106115
107116 // this is the main data that you want to get back out from the procedure.
108- private String pairSequence = "" ;
109- private double [][] pairingParameters ;
110- private double [][] stepParameters ;
117+ protected String pairSequence = "" ;
118+ protected double [][] pairingParameters ;
119+ protected double [][] stepParameters ;
120+ protected List <String > pairingNames = new ArrayList <>();
111121
112122
113123 /**
@@ -185,6 +195,15 @@ public String getPairSequence() {
185195 return pairSequence ;
186196 }
187197
198+ /**
199+ * This returns the names of the pairs in terms of A, G, T/U, and C for each base pair group in the
200+ * list. The first character is the leading strand base and the second character is the complementary base
201+ * @return
202+ */
203+ public List <String > getPairingNames () {
204+ return pairingNames ;
205+ }
206+
188207 /**
189208 * This reports all the nucleic acid chains and has an option to remove duplicates if you
190209 * are considering an analyze of only unique DNA or RNA helices in the Structure.
@@ -258,7 +277,7 @@ public List<Group[]> findPairs(List<Chain> chains) {
258277 double distance = Math .sqrt (dx *dx +dy *dy +dz *dz );
259278 //log.info("C8-C6 Distance (Å): " + distance);
260279 // could be a base pair
261- if (Math .abs (distance -10.0 ) < 2.5 ) {
280+ if (Math .abs (distance -10.0 ) < 5.0 ) {
262281 boolean valid = true ;
263282 for (String atomname : ringMap .get (type1 )) {
264283 Atom a = g1 .getAtom (atomname );
@@ -269,11 +288,8 @@ public List<Group[]> findPairs(List<Chain> chains) {
269288 if (a == null ) valid = false ;
270289 }
271290 if (valid ) {
272- Group g3 = null ;
273- Group g4 = null ;
274- if (k + 1 < match .length ()) g3 = c .getSeqResGroup (index1 + k + 1 );
275- if (k != 0 ) g4 = c .getSeqResGroup (index1 + k - 1 );
276- result .add (new Group []{g1 , g2 , g3 , g4 });
291+ result .add (new Group []{g1 , g2 });
292+ pairingNames .add ((useRNA ? baseListRNA [type1 ]+baseListRNA [type2 ] : baseListDNA [type1 ]+baseListDNA [type2 ]));
277293 pairSequence += c .getSeqResSequence ().charAt (index1 + k );
278294 } else if (pairSequence .length () != 0 && pairSequence .charAt (pairSequence .length ()-1 ) != ' ' ) pairSequence += ' ' ;
279295 } else if (pairSequence .length () != 0 && pairSequence .charAt (pairSequence .length ()-1 ) != ' ' ) pairSequence += ' ' ;
@@ -424,8 +440,8 @@ public static double[] calculatetp(Matrix4d input) {
424440 public static char complementBase (char base , boolean RNA ) {
425441 if (base == 'A' && RNA ) return 'U' ;
426442 if (base == 'A' ) return 'T' ;
427- if (base == 'T' ) return 'A' ;
428- if (base == 'U' ) return 'A' ;
443+ if (base == 'T' && ! RNA ) return 'A' ;
444+ if (base == 'U' && RNA ) return 'A' ;
429445 if (base == 'C' ) return 'G' ;
430446 if (base == 'G' ) return 'C' ;
431447 return ' ' ;
0 commit comments