From 1af953b3f29ffe11b7bf298ef3fce773012c49e9 Mon Sep 17 00:00:00 2001 From: jprocter Date: Sat, 17 Nov 2012 21:10:59 +0000 Subject: [PATCH] call annotate3d service and parse rnaml to alignment --- src/jalview/ws/jws1/Annotate3D.java | 38 +++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/src/jalview/ws/jws1/Annotate3D.java b/src/jalview/ws/jws1/Annotate3D.java index 9f5ad19..a30a9a1 100644 --- a/src/jalview/ws/jws1/Annotate3D.java +++ b/src/jalview/ws/jws1/Annotate3D.java @@ -59,6 +59,44 @@ public class Annotate3D // } catch (IOException e) { // } } + + public AlignmentI getRNAMLFor(final FileParse source) throws IOException + { + try + { + StringBuffer sb = new StringBuffer(); + + Reader fpr = source.getReader(); + int p = 0; + char[] cbuff = new char[2048]; + while ((p = fpr.read(cbuff)) > 0) + { + for (int i = 0; i < p; i++) + { + sb.append(cbuff[i]); + } + } + + FileParse fp = new InputStreamParser( + jalview.ext.paradise.Annotate3D.getRNAMLForPDBFileAsString(sb + .toString()), source.getDataName()); + AlignmentI nal = new FormatAdapter().readFromFile(fp, "RNAML"); + return nal; + } catch (Throwable x) + { + if (x instanceof IOException) + { + throw ((IOException) x); + } + else + { + throw new IOException( + "Unexpected exception when handling RNAML translation of PDB data", + x); + } + } + } + public Annotate3D(String path) throws InterruptedException { System.out.println("Annotate3D"); -- 1.7.10.2