v2
authorAnne Menard <menard.annec@gmail.com>
Tue, 10 Jul 2012 14:13:37 +0000 (16:13 +0200)
committerAnne Menard <menard.annec@gmail.com>
Tue, 10 Jul 2012 14:13:37 +0000 (16:13 +0200)
32 files changed:
.classpath
lib/VARNAv3-9-dev.jar
src/MCview/PDBViewer.java
src/MCview/PDBfile.java
src/jalview/appletgui/AlignFrame.java
src/jalview/datamodel/AlignmentAnnotation.java
src/jalview/datamodel/Annotation.java
src/jalview/datamodel/Sequence.java
src/jalview/datamodel/SequenceI.java
src/jalview/gui/AppVarna.java
src/jalview/gui/AppVarnaBinding.java
src/jalview/gui/AssociatePdbFileWithSeq.java
src/jalview/gui/PopupMenu.java
src/jalview/io/AlignFile.java
src/jalview/io/AppletFormatAdapter.java
src/jalview/io/BLCFile.java
src/jalview/io/ClustalFile.java
src/jalview/io/FastaFile.java
src/jalview/io/FeaturesFile.java
src/jalview/io/JPredFile.java
src/jalview/io/MSFfile.java
src/jalview/io/PIRFile.java
src/jalview/io/PfamFile.java
src/jalview/io/PileUpfile.java
src/jalview/io/RnamlFile.java
src/jalview/io/SimpleBlastFile.java
src/jalview/io/StockholmFile.java
src/jalview/io/TCoffeeScoreFile.java
src/jalview/jbgui/GAlignFrame.java
src/jalview/renderer/AnnotationRenderer.java
src/jalview/schemes/ColourSchemeProperty.java
test/jalview/io/TCoffeeScoreFileTest.java

index e73cec3..f76d550 100644 (file)
@@ -47,7 +47,7 @@
        <classpathentry kind="lib" path="lib/spring-web-3.0.5.RELEASE.jar"/>
        <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/plugin.jar"/>
        <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
-       <classpathentry kind="lib" path="lib/VARNAv3-9-dev.jar"/>
+       <classpathentry kind="lib" path="lib/VARNAv3-9-dev.jar" sourcepath="/VARNA3-1"/>
        <classpathentry kind="lib" path="/usr/lib/jvm/java-7-oracle/jre/lib/plugin.jar"/>
        <classpathentry kind="output" path="classes"/>
 </classpath>
index 0540b41..865de94 100644 (file)
Binary files a/lib/VARNAv3-9-dev.jar and b/lib/VARNAv3-9-dev.jar differ
index 1b648fe..c726fde 100755 (executable)
@@ -58,7 +58,7 @@ public class PDBViewer extends JInternalFrame implements Runnable
   String tmpPDBFile;
 
   public PDBViewer(PDBEntry pdbentry, SequenceI[] seq, String[] chains,
-          AlignmentPanel ap, String protocol) throws ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
+          AlignmentPanel ap, String protocol) throws ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException
 
   {
     this.pdbentry = pdbentry;
index bb48174..dede37e 100755 (executable)
@@ -32,6 +32,8 @@ import fr.orsay.lri.varna.exceptions.ExceptionPermissionDenied;
 
 import jalview.datamodel.*;
 import jalview.io.FileParse;
+import jalview.io.RnamlFile;
+import jalview.ws.jws1.Annotate3D;
 
 public class PDBfile extends jalview.io.AlignFile
 {
@@ -44,12 +46,12 @@ public class PDBfile extends jalview.io.AlignFile
    */
   boolean VisibleChainAnnotation = false;
 
-  public PDBfile(String inFile, String inType) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
+  public PDBfile(String inFile, String inType) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException
   {
     super(inFile, inType);
   }
 
-  public PDBfile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
+  public PDBfile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException
   {
     super(source);
   }
@@ -59,7 +61,7 @@ public class PDBfile extends jalview.io.AlignFile
     return null;
   }
 
-  public void parse() throws IOException
+  public void parse() throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException
   {
     // TODO set the filename sensibly - try using data source name.
     id = safeName(getDataName());
@@ -181,6 +183,24 @@ public class PDBfile extends jalview.io.AlignFile
        if(isRNA(chainseq)==true)
        {
           System.out.println("this is a PDB format and RNA sequence");
+          Annotate3D an3d = new Annotate3D(id);
+          System.out.println(id);
+          //BufferedWriter r = an3d.getReader();
+          
+          BufferedReader in = new BufferedReader(new FileReader("temp.rnaml"));
+          
+          String str;
+          while ((str = in.readLine()) != null) {
+                    System.out.println(str);
+                    System.out.println("toto");
+
+                    }
+          String type = "File";
+          RnamlFile rnaml =new RnamlFile("temp.rnaml",type);
+          System.out.println("Create rnamfile object");
+          //rnaml.parse("temp");
+          this.annotations =rnaml.getAnnot();
+          
        }
         
         AlignmentAnnotation[] chainannot = chainseq.getAnnotation();
index 6876984..494e8fe 100644 (file)
@@ -52,6 +52,7 @@ import jalview.schemes.NucleotideColourScheme;
 import jalview.schemes.PIDColourScheme;\r
 import jalview.schemes.PurinePyrimidineColourScheme;\r
 import jalview.schemes.RNAHelicesColourChooser;\r
+import jalview.schemes.RNAInteractionColourScheme;\r
 import jalview.schemes.ResidueProperties;\r
 import jalview.schemes.StrandColourScheme;\r
 import jalview.schemes.TCoffeeColourScheme;\r
@@ -211,6 +212,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
       RNAHelixColour.setEnabled(false);\r
       purinePyrimidineColour.setEnabled(false);\r
     }\r
+    \r
     // Some JVMS send keyevents to Top frame or lowest panel,\r
     // Havent worked out why yet. So add to both this frame and seqCanvas for\r
     // now\r
@@ -1009,6 +1011,10 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
     {\r
       changeColour(new PurinePyrimidineColourScheme());\r
     }\r
+    else if (source == RNAInteractionColour)\r
+    {\r
+      changeColour(new RNAInteractionColourScheme());\r
+    }\r
     else if (source == RNAHelixColour)\r
     {\r
       new RNAHelicesColourChooser(viewport, alignPanel);\r
@@ -2783,6 +2789,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
   MenuItem buriedColour = new MenuItem();\r
 \r
   MenuItem purinePyrimidineColour = new MenuItem();\r
+  MenuItem RNAInteractionColour = new MenuItem();\r
   MenuItem RNAHelixColour = new MenuItem();\r
 \r
   MenuItem userDefinedColour = new MenuItem();\r
@@ -2978,6 +2985,8 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
     buriedColour.addActionListener(this);\r
     purinePyrimidineColour.setLabel("Purine/Pyrimidine");\r
     purinePyrimidineColour.addActionListener(this);\r
+    RNAInteractionColour.setLabel("Purine/Pyrimidine");\r
+    RNAInteractionColour.addActionListener(this);\r
     RNAHelixColour.setLabel("by RNA Helices");\r
     RNAHelixColour.addActionListener(this);\r
     userDefinedColour.setLabel("User Defined...");\r
@@ -3196,6 +3205,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
     colourMenu.add(buriedColour);\r
     colourMenu.add(nucleotideColour);\r
     colourMenu.add(purinePyrimidineColour);\r
+    colourMenu.add(RNAInteractionColour);\r
     colourMenu.add(tcoffeeColour);\r
     colourMenu.add(userDefinedColour);\r
     colourMenu.addSeparator();\r
@@ -3638,8 +3648,9 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,  ItemLis
  * @throws ExceptionFileFormatOrSyntax \r
  * @throws ExceptionLoadingFailed \r
  * @throws ExceptionPermissionDenied \r
+ * @throws InterruptedException \r
    */\r
-  public boolean loadScoreFile( String source ) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed {\r
+  public boolean loadScoreFile( String source ) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException {\r
 \r
     TCoffeeScoreFile file = new TCoffeeScoreFile(source, AppletFormatAdapter.checkProtocol(source));\r
          if( !file.isValid()) {\r
index f5d34a6..1196d05 100755 (executable)
@@ -20,9 +20,12 @@ package jalview.datamodel;
 import jalview.analysis.Rna;
 import jalview.analysis.WUSSParseException;
 
+import java.util.ArrayList;
 import java.util.Enumeration;
 import java.util.Hashtable;
 
+import fr.orsay.lri.varna.models.rna.RNA;
+
 /**
  * DOCUMENT ME!
  * 
@@ -49,6 +52,8 @@ public class AlignmentAnnotation
 
   /** DOCUMENT ME!! */
   public Annotation[] annotations;
+  
+  
 
   /**
    * RNA secondary structure contact positions
@@ -237,7 +242,8 @@ public class AlignmentAnnotation
       else
       // Check for RNA secondary structure
       {
-        if (annotations[i].secondaryStructure == 'S')
+        if (annotations[i].secondaryStructure == 'S'
+                       || annotations[i].secondaryStructure == 'C')
         {
           hasIcons |= true;
           isrna |= true;
@@ -945,7 +951,7 @@ public class AlignmentAnnotation
       {
         if (annotations[i] == null)
           annotations[i] = new Annotation(String.valueOf(gapchar), null,
-                  ' ', 0f);
+                  ' ', 0f,null);
         else if (annotations[i].displayCharacter == null
                 || annotations[i].displayCharacter.equals(" "))
           annotations[i].displayCharacter = String.valueOf(gapchar);
@@ -998,4 +1004,6 @@ public class AlignmentAnnotation
     this.calcId = calcId;
   }
   
+  
 }
index 6b22cad..b371bc3 100755 (executable)
@@ -18,6 +18,9 @@
 package jalview.datamodel;
 
 import java.awt.*;
+import java.util.ArrayList;
+
+import fr.orsay.lri.varna.models.rna.RNA;
 
 /**
  * DOCUMENT ME!
@@ -38,6 +41,8 @@ public class Annotation
 
   /** DOCUMENT ME!! */
   public float value;
+  
+
 
   // add visual cues here
 
@@ -62,6 +67,7 @@ public class Annotation
     description = desc;
     secondaryStructure = ss;
     value = val;
+    
   }
 
   /**
@@ -105,6 +111,7 @@ public class Annotation
     secondaryStructure = that.secondaryStructure;
     value = that.value;
     colour = that.colour;
+
   }
 
   /**
@@ -115,6 +122,10 @@ public class Annotation
    */
   public Annotation(float val)
   {
-    this(null, null, ' ', val);
+    this(null, null, ' ', val,null);
   }
+  
+  
+  
+  
 }
index aa27d25..a416728 100755 (executable)
@@ -22,6 +22,8 @@ import jalview.analysis.AlignSeq;
 import java.util.Enumeration;
 import java.util.Vector;
 
+import fr.orsay.lri.varna.models.rna.RNA;
+
 /**
  * 
  * Implements the SequenceI interface for a char[] based sequence object.
@@ -48,6 +50,8 @@ public class Sequence implements SequenceI
   String vamsasId;
 
   DBRefEntry[] dbrefs;
+  
+  RNA rna;
 
   /**
    * This annotation is displayed below the alignment but the positions are tied
@@ -1193,4 +1197,9 @@ public class Sequence implements SequenceI
    * @param The position for this sequence. This value is zero-based (zero for this first sequence)
    */
   public void setIndex(int value) { index = value; }
+  
+  public void setRNA(RNA r){rna=r;}
+  
+  public RNA getRNA() { return rna; }
+  
 }
index 33045d0..bf3c031 100755 (executable)
  */
 package jalview.datamodel;
 
+
 import java.util.Vector;
 
+import fr.orsay.lri.varna.models.rna.RNA;
+
 /**
  * DOCUMENT ME!
  * 
@@ -358,5 +361,17 @@ public interface SequenceI
    * @return The index of the sequence in the alignment
    */
   public int getIndex();
+  
+  /**
+   * @return The RNA of the sequence in the alignment
+   */
+  
+  public RNA getRNA();
+  /**
+   * @param rna The RNA.
+   */
+  public void setRNA(RNA rna);
+  
 
 }
index 00670aa..dd970f6 100644 (file)
@@ -73,35 +73,32 @@ public class AppVarna extends JInternalFrame implements
 
   AlignmentPanel ap;
 
-  public AppVarna(String sname, SequenceI seq, String strucseq, String struc,
+  public AppVarna(String sname, SequenceI seq, String strucseq, RNA struc,
           String name, AlignmentPanel ap)
   {
-         System.out.println("je suis là (AppVarna!!");
-         System.out.println("1:"+sname);
-         System.out.println("2:"+seq);
-         System.out.println("3:"+strucseq);
-         System.out.println("4:"+struc);
-         System.out.println("5:"+name);
-         System.out.println("6:"+ap);
+        
+
     this.ap = ap;
     ArrayList<RNA> rnaList = new ArrayList<RNA>();
-    RNA rna1 = new RNA(name);
-    try
+    System.out.println(struc);
+    RNA rna1 = new RNA(struc);
+    rna1.setName(name);
+    rna1.restrictTo(strucseq);
+    /*try
     {
-    System.out.println("ou ici ?");
+      System.err.println(struc + "->" + replaceOddGaps(struc));
       rna1.setRNA(strucseq, replaceOddGaps(struc));
-      System.out.println("La séquence est :"+rna1.getSeq());
-      System.out.println("La séquence est :"+struc);
-      System.out.println("La séquence est :"+replaceOddGaps(struc).toString());
+     
     } catch (ExceptionUnmatchedClosingParentheses e2)
     {
       e2.printStackTrace();
     } catch (ExceptionFileFormatOrSyntax e3)
     {
       e3.printStackTrace();
-    }
+    }*/
     
     RNA trim = trimRNA(rna1, "trimmed "+sname);
+    //TODO: Use RNA.selectTo instead...
     rnaList.add(trim);
     rnaList.add(rna1);
     
@@ -135,7 +132,7 @@ public class AppVarna extends JInternalFrame implements
 
   public void initVarna()
   {
-         System.out.println("initialisation VANRA");
+         
     // vab.setFinishedInit(false);
     varnaPanel = vab.get_varnaPanel();
     setBackground(Color.white);
@@ -150,7 +147,7 @@ public class AppVarna extends JInternalFrame implements
             getBounds().width, getBounds().height);
     this.pack();
     showPanel(true);
-    System.out.println("Sortie initialisation VANRA");
+    
   }
 
   public String replaceOddGaps(String oldStr)
index 87bbae3..32022a3 100644 (file)
@@ -148,19 +148,19 @@ public class AppVarnaBinding extends jalview.ext.varna.JalviewVarnaBinding
   {
     // super("VARNA in Jalview");
     initVarna(seq, struc);
-    System.out.println("here(1)");
+   
   }
 
   public AppVarnaBinding(ArrayList<RNA> rnaList)
   {
-        System.out.println("here(2)");
+;
     // super("VARNA in Jalview");
     initVarnaEdit(rnaList);
   }
 
   private void initVarna(String seq, String str)
   {
-         System.out.println("initialisation VARNA (appvarnabinding");
+         
     DefaultListModel dlm = new DefaultListModel();
 
     DefaultListSelectionModel m = new DefaultListSelectionModel();
@@ -193,7 +193,7 @@ public class AppVarnaBinding extends jalview.ext.varna.JalviewVarnaBinding
 
     try
     {
-    System.out.println("here");
+    
       vp = new VARNAPanel("0", ".");
       _RNA1.setRNA(seq, str);
       _RNA1.drawRNARadiate(vp.getConfig());
@@ -222,7 +222,7 @@ public class AppVarnaBinding extends jalview.ext.varna.JalviewVarnaBinding
 
   private void initVarnaEdit(ArrayList<RNA> rnaInList)
   {
-        System.out.println("initialisation VARNA(2) (appvarnabinding");
+       
     DefaultListModel dlm = new DefaultListModel();
 
     int marginTools = 40;
@@ -246,7 +246,8 @@ public class AppVarnaBinding extends jalview.ext.varna.JalviewVarnaBinding
           FullBackup sel = (FullBackup) _sideList.getSelectedValue();
           Mapping map = Mapping.DefaultOutermostMapping(vp.getRNA()
                   .getSize(), sel.rna.getSize());
-          vp.showRNAInterpolated(sel.rna, sel.config, map);
+          //vp.showRNAInterpolated(sel.rna, sel.config, map);
+          vp.showRNA(sel.rna, sel.config);
           // _seq.setText(sel.rna.getSeq());
           _str.setText(sel.rna.getStructDBN());
         }
@@ -256,12 +257,12 @@ public class AppVarnaBinding extends jalview.ext.varna.JalviewVarnaBinding
 
     try
     {
-       System.out.println("here(plop)");
+       
       vp = new VARNAPanel("0", ".");
       for (int i = 0; i < rnaInList.size(); i++)
       {
         rnaInList.get(i).drawRNARadiate(vp.getConfig());
-        System.out.println(i);
+       
       }
     } catch (ExceptionNonEqualLength e)
     {
@@ -809,7 +810,7 @@ public class AppVarnaBinding extends jalview.ext.varna.JalviewVarnaBinding
 
   public void onUINewStructure(VARNAConfig v, RNA r)
   {
-    _rnaList.add(v, r, "", true);
+    //_rnaList.add(v, r, "", true);
   }
 
   public void onWarningEmitted(String s)
index ddcd310..ade341d 100644 (file)
@@ -49,8 +49,9 @@ public class AssociatePdbFileWithSeq
  * @throws ExceptionFileFormatOrSyntax 
  * @throws ExceptionLoadingFailed 
  * @throws ExceptionPermissionDenied 
+ * @throws InterruptedException 
  */
-  public PDBEntry associatePdbWithSeq(String choice, String protocol, SequenceI sequence, boolean prompt) throws ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
+  public PDBEntry associatePdbWithSeq(String choice, String protocol, SequenceI sequence, boolean prompt) throws ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException
   {
     PDBEntry entry = new PDBEntry();
     try
index 3e589aa..f6c1379 100644 (file)
@@ -78,6 +78,7 @@ public class PopupMenu extends JPopupMenu
   protected JRadioButtonMenuItem BLOSUM62Colour = new JRadioButtonMenuItem();
 
   protected JRadioButtonMenuItem purinePyrimidineColour = new JRadioButtonMenuItem();
+  protected JRadioButtonMenuItem RNAInteractionColour = new JRadioButtonMenuItem();
 
   // protected JRadioButtonMenuItem covariationColour = new
   // JRadioButtonMenuItem();
@@ -196,6 +197,7 @@ public class PopupMenu extends JPopupMenu
     colours.add(PIDColour);
     colours.add(BLOSUM62Colour);
     colours.add(purinePyrimidineColour);
+    colours.add(RNAInteractionColour);
     // colours.add(covariationColour);
 
     for (int i = 0; i < jalview.io.FormatAdapter.WRITEABLE_FORMATS.length; i++)
@@ -281,17 +283,20 @@ public class PopupMenu extends JPopupMenu
             menuItem = new JMenuItem();
             menuItem.setText("2D RNA "+structureLine);
             menuItem.addActionListener(new java.awt.event.ActionListener()
+            
             {
               public void actionPerformed(ActionEvent e)
               {
-                       System.out.println("1:"+structureLine);
-                       System.out.println("2:"+seq);
-                       System.out.println("3:"+seq.getSequenceAsString());
-                       System.out.println("4:"+rnastruc);
-                       System.out.println("5:"+seq.getName());
-                       System.out.println("6:"+ap);
-                new AppVarna(structureLine, seq, seq.getSequenceAsString(), rnastruc, seq
-                        .getName(), ap);
+                       //System.out.println("1:"+structureLine);
+                       System.out.println("1:sname"+seq.getName());
+                       System.out.println("2:seq"+seq);
+                
+                       //System.out.println("3:"+seq.getSequenceAsString());
+                       System.out.println("3:strucseq"+rnastruc);
+                       System.out.println("4:struc"+seq.getRNA());
+                       System.out.println("5:name"+seq.getName());
+                       System.out.println("6:ap"+ap);
+                new AppVarna(seq.getName(),seq,rnastruc,seq.getRNA(), seq.getName(), ap);
                        System.out.println("end");
               }
             });
@@ -319,8 +324,8 @@ public class PopupMenu extends JPopupMenu
                 {
                   // TODO: VARNA does'nt print gaps in the sequence
                 
-                  new AppVarna(seq.getName()+" structure",seq,seq.getSequenceAsString(), rnastruc, seq
-                          .getName(), ap);
+                  new AppVarna(seq.getName()+" structure",seq,rnastruc,seq.getRNA(), 
+                                 seq.getName(), ap);
                 }
               });
               viewStructureMenu.add(menuItem);
@@ -454,6 +459,11 @@ public class PopupMenu extends JPopupMenu
       {
         purinePyrimidineColour.setSelected(true);
       }
+      
+      else if (sg.cs instanceof RNAInteractionColourScheme)
+      {
+        RNAInteractionColour.setSelected(true);
+      }
       /*
        * else if (sg.cs instanceof CovariationColourScheme) {
        * covariationColour.setSelected(true); }
@@ -1036,6 +1046,9 @@ public class PopupMenu extends JPopupMenu
                } catch (ExceptionLoadingFailed e1) {
                        // TODO Auto-generated catch block
                        e1.printStackTrace();
+               } catch (InterruptedException e1) {
+                       // TODO Auto-generated catch block
+                       e1.printStackTrace();
                }
       }
     });
@@ -1113,6 +1126,7 @@ public class PopupMenu extends JPopupMenu
     colourMenu.add(turnColour);
     colourMenu.add(buriedColour);
     colourMenu.add(nucleotideMenuItem);
+    colourMenu.add(RNAInteractionColour);
     if (ap.getAlignment().isNucleotide()) {
        colourMenu.add(purinePyrimidineColour);
     }
@@ -1277,6 +1291,16 @@ public class PopupMenu extends JPopupMenu
                 purinePyrimidineColour_actionPerformed();
               }
             });
+    
+    RNAInteractionColour.setText("RNA Interaction type");
+    RNAInteractionColour
+            .addActionListener(new java.awt.event.ActionListener()
+            {
+              public void actionPerformed(ActionEvent e)
+              {
+                RNAInteractionColour_actionPerformed();
+              }
+            });
     /*
      * covariationColour.addActionListener(new java.awt.event.ActionListener() {
      * public void actionPerformed(ActionEvent e) {
@@ -1427,6 +1451,11 @@ public class PopupMenu extends JPopupMenu
     refresh();
   }
 
+  protected void RNAInteractionColour_actionPerformed()
+  {
+    getGroup().cs = new RNAInteractionColourScheme();
+    refresh();
+  }
   /*
    * protected void covariationColour_actionPerformed() { getGroup().cs = new
    * CovariationColourScheme(sequence.getAnnotation()[0]); refresh(); }
@@ -1879,7 +1908,7 @@ public class PopupMenu extends JPopupMenu
     oal = null;
   }
 
-  public void pdbFromFile_actionPerformed() throws ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
+  public void pdbFromFile_actionPerformed() throws ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException
   {
     jalview.io.JalviewFileChooser chooser = new jalview.io.JalviewFileChooser(
             jalview.bin.Cache.getProperty("LAST_DIRECTORY"));
index c5d44ed..86696d7 100755 (executable)
@@ -89,8 +89,9 @@ public abstract class AlignFile extends FileParse
  * @throws ExceptionFileFormatOrSyntax 
  * @throws ExceptionLoadingFailed 
  * @throws ExceptionPermissionDenied 
+ * @throws InterruptedException 
    */
-  public AlignFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
+  public AlignFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException
   {
     super(inFile, type);
     initData();
@@ -112,8 +113,9 @@ public abstract class AlignFile extends FileParse
  * @throws ExceptionFileFormatOrSyntax 
  * @throws ExceptionLoadingFailed 
  * @throws ExceptionPermissionDenied 
+ * @throws InterruptedException 
    */
-  public AlignFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
+  public AlignFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException
   {
     super(source);
     initData();
@@ -262,8 +264,9 @@ public abstract class AlignFile extends FileParse
  * @throws ParserConfigurationException 
  * @throws ExceptionLoadingFailed 
  * @throws ExceptionPermissionDenied 
+ * @throws InterruptedException 
    */
-  public abstract void parse() throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed;
+  public abstract void parse() throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException;
 
   /**
    * Print out in alignment file format the Sequences in the seqs Vector.
index dad1077..3084027 100755 (executable)
@@ -223,16 +223,7 @@ public class AppletFormatAdapter
       }
       else if (format.equals("PDB"))
       {
-       //if (contient de l'ARN)
-       //  {
-         System.out.println(inFile); //donne le path
-         
-               //new URL = http://paradise-ibmc.u-strasbg.fr/webservices/annotate3d?data=inFile;
-         //afile = new RnamlFile(inFile, type);
-               
-         //}
-        afile = new MCview.PDBfile(inFile, type);
-        
+        afile = new MCview.PDBfile(inFile, type);        
       }
       else if (format.equals("STH"))
       {
index e5bcd32..6b59d02 100755 (executable)
@@ -62,13 +62,14 @@ public class BLCFile extends AlignFile
  * @throws ExceptionFileFormatOrSyntax 
  * @throws ExceptionLoadingFailed 
  * @throws ExceptionPermissionDenied 
+ * @throws InterruptedException 
    */
-  public BLCFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
+  public BLCFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException
   {
     super(inFile, type);
   }
 
-  public BLCFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
+  public BLCFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException
   {
     super(source);
   }
index 29a3daf..3cd7bc1 100755 (executable)
@@ -38,12 +38,12 @@ public class ClustalFile extends AlignFile
   {
   }
 
-  public ClustalFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
+  public ClustalFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException
   {
     super(inFile, type);
   }
 
-  public ClustalFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
+  public ClustalFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException
   {
     super(source);
   }
index d2749db..f3d3e5b 100755 (executable)
@@ -66,13 +66,14 @@ public class FastaFile extends AlignFile
  * @throws ExceptionFileFormatOrSyntax 
  * @throws ExceptionLoadingFailed 
  * @throws ExceptionPermissionDenied 
+ * @throws InterruptedException 
    */
-  public FastaFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
+  public FastaFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException
   {
     super(inFile, type);
   }
 
-  public FastaFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
+  public FastaFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException
   {
     super(source);
   }
index 6958923..d072d3d 100755 (executable)
@@ -72,13 +72,14 @@ public class FeaturesFile extends AlignFile
  * @throws ExceptionFileFormatOrSyntax \r
  * @throws ExceptionLoadingFailed \r
  * @throws ExceptionPermissionDenied \r
+ * @throws InterruptedException \r
    */\r
-  public FeaturesFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed\r
+  public FeaturesFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException\r
   {\r
     super(inFile, type);\r
   }\r
 \r
-  public FeaturesFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed\r
+  public FeaturesFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException\r
   {\r
     super(source);\r
   }\r
index a26ec61..d9836c1 100755 (executable)
@@ -79,13 +79,14 @@ public class JPredFile extends AlignFile
  * @throws ExceptionFileFormatOrSyntax 
  * @throws ExceptionLoadingFailed 
  * @throws ExceptionPermissionDenied 
+ * @throws InterruptedException 
    */
-  public JPredFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
+  public JPredFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException
   {
     super(inFile, type);
   }
 
-  public JPredFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
+  public JPredFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException
   {
     super(source);
   }
@@ -365,8 +366,9 @@ public class JPredFile extends AlignFile
  * @throws ExceptionFileFormatOrSyntax 
  * @throws ExceptionLoadingFailed 
  * @throws ExceptionPermissionDenied 
+ * @throws InterruptedException 
    */
-  public static void main(String[] args) throws ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
+  public static void main(String[] args) throws ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException
   {
     try
     {
index 2d9579c..616c90b 100755 (executable)
@@ -62,13 +62,14 @@ public class MSFfile extends AlignFile
  * @throws ExceptionFileFormatOrSyntax 
  * @throws ExceptionLoadingFailed 
  * @throws ExceptionPermissionDenied 
+ * @throws InterruptedException 
    */
-  public MSFfile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
+  public MSFfile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException
   {
     super(inFile, type);
   }
 
-  public MSFfile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
+  public MSFfile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException
   {
     super(source);
   }
index 5bc7bd5..358bcde 100755 (executable)
@@ -40,12 +40,12 @@ public class PIRFile extends AlignFile
   {
   }
 
-  public PIRFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
+  public PIRFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException
   {
     super(inFile, type);
   }
 
-  public PIRFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
+  public PIRFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException
   {
     super(source);
   }
index a8df460..f9da5de 100755 (executable)
@@ -38,12 +38,12 @@ public class PfamFile extends AlignFile
   {
   }
 
-  public PfamFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
+  public PfamFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException
   {
     super(inFile, type);
   }
 
-  public PfamFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
+  public PfamFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException
   {
     super(source);
   }
index 3d9845d..d120ac3 100755 (executable)
@@ -70,13 +70,14 @@ public class PileUpfile extends MSFfile
  * @throws ExceptionFileFormatOrSyntax 
  * @throws ExceptionLoadingFailed 
  * @throws ExceptionPermissionDenied 
+ * @throws InterruptedException 
    */
-  public PileUpfile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
+  public PileUpfile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException
   {
     super(inFile, type);
   }
 
-  public PileUpfile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
+  public PileUpfile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException
   {
     super(source);
   }
index e614e6b..69786fb 100644 (file)
@@ -10,6 +10,7 @@ import jalview.datamodel.SecondaryStructureAnnotation;
 import jalview.datamodel.Sequence;
 import jalview.datamodel.SequenceFeature;
 import jalview.datamodel.SequenceI;
+import jalview.ws.jws1.Annotate3D;
 
 import java.io.BufferedReader;
 import java.io.FileNotFoundException;
@@ -36,6 +37,7 @@ import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax;
 import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed;
 import fr.orsay.lri.varna.exceptions.ExceptionPermissionDenied;
 import fr.orsay.lri.varna.factories.RNAFactory;
+import fr.orsay.lri.varna.factories.RNAFactory.RNAFileType;
 import fr.orsay.lri.varna.models.rna.RNA;
 import fr.orsay.lri.varna.utils.RNAMLParser;
 
@@ -45,6 +47,7 @@ import fr.orsay.lri.varna.utils.RNAMLParser;
 public class RnamlFile extends AlignFile
 {
         public String id;
+        protected ArrayList<RNA> result;
         
         public RnamlFile()
          {
@@ -52,36 +55,114 @@ public class RnamlFile extends AlignFile
                
          }
         
-        public RnamlFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
+        public RnamlFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException
          {
            super(inFile, type);
            
          }
 
-         public RnamlFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
+         public RnamlFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException
          {
            super(source);
            
          }
          
+//       public RnamlFile(BufferedReader r) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
+//       {
+//                     super();            
+//                 parse(r);
+//                 // sets the index of each sequence in the alignment
+//                 for( int i=0,c=seqs.size(); i<c; i++ ) {  
+//                     seqs.get(i).setIndex(i);  
+//                 }
+//               
+//         
+//       }
          
+       public BufferedReader CreateReader() throws FileNotFoundException
+       {
+                FileReader fr = null;
+                 fr = new FileReader(inFile); 
+                 
+                 BufferedReader r = new BufferedReader (fr);
+                 return r;
+       }
        
        
-         public void parse() throws ExceptionPermissionDenied, ExceptionLoadingFailed, ExceptionFileFormatOrSyntax, FileNotFoundException 
-         {
-                 System.out.println("this is a rnaml file");
-                 
-                 
-                 FileReader fr = null;
+       public void parse() throws FileNotFoundException, ExceptionPermissionDenied, ExceptionLoadingFailed, ExceptionFileFormatOrSyntax
+       {
+                FileReader fr = null;
                  fr = new FileReader(inFile); 
                  
                  BufferedReader r = new BufferedReader (fr);
-                
+                Hashtable seqhash = new Hashtable();
+                 Vector headers = new Vector();
+                 //ArrayList<String> seq =new ArrayList();
+                 //System.out.println(r);
+                  
+                 
+                result = RNAFactory.loadSecStrRNAML(r);
+                 
+                System.out.println("this is the secondary scructure:" +result.toArray());
+                 //System.out.println("this is the secondary scructure:" +result.toString());
+                 //System.out.println("this is the secondary scructure:" +result.size());
+                       for(int i=0;i<result.size();i++)
+                       {
+                 //System.out.println(result.get(0).getSeq());
+                 //System.out.println(result.get(0).getStructBPSEQ());
+                 //System.out.println(result.get(0).getStructDBN(true));
+                 String rna1 =result.get(0).getStructDBN(true);
+                 //System.out.println(result.get(0).getAnnotations());
+                 String seq = result.get(0).getSeq();
+                 System.out.println(type); //the type is "File"
+                 System.out.println(inFile );//inFile is the path
+                 int begin=0;
+                 int end = seq.length()-1;
+                 SequenceI[] seqs = new SequenceI[1];
+                 id = safeName(getDataName());
+                 seqs[0] = new Sequence(id, seq, begin, end);
+                 SequenceFeature feat = new SequenceFeature(type, "",5, 13, 0f, null);
+                 seqs[0].addSequenceFeature(feat);
+                 this.setSeqs(seqs);
+                 
+                 String[] annot=new String[10000] ;
+                 Annotation[] ann = new Annotation[1000];
+                 for(int j=0;j<rna1.length();j++)
+                       {
+                 annot[j] =rna1.substring(j,j+1);
+                 System.out.println(annot[j]);
+                       }
+                 
+                 for(int k=0;k<rna1.length();k++)
+               {
+                         ann[k] = new Annotation(annot[k], "", ' ', 0f);
+                         
+                         ann[k].secondaryStructure = jalview.schemes.ResidueProperties.getRNASecStrucState(annot[k]).charAt(0);
+                         
+               }
+                 AlignmentAnnotation align = new AlignmentAnnotation("Secondary structure","",ann);
+                 seqs[0].addAlignmentAnnotation(align);
+                 seqs[0].setRNA(result.get(begin));
+                 this.annotations.addElement(align);
+                 
+                 
+               }
+               
+               //Annotate3D tintin = new Annotate3D();
+                 
+               //System.out.println(tintin);  
+       }
+         
+       
+         public void parse(BufferedReader r) throws ExceptionPermissionDenied, ExceptionLoadingFailed, ExceptionFileFormatOrSyntax 
+         {
+                  System.out.println("parse with Buffer (RnamlFile");
                  Hashtable seqhash = new Hashtable();
                  Vector headers = new Vector();
                  //ArrayList<String> seq =new ArrayList();
-                 System.out.println(r);
-                 ArrayList<RNA> result = RNAFactory.loadSecStrRNAML(r);
+                 //System.out.println(r);
+                 
+                 result = RNAFactory.loadSecStr(r,RNAFileType.FILE_TYPE_RNAML);
                  
                  System.out.println("this is the secondary scructure:" +result.toArray());
                  System.out.println("this is the secondary scructure:" +result.toString());
@@ -110,7 +191,7 @@ public class RnamlFile extends AlignFile
                  for(int j=0;j<rna1.length();j++)
                        {
                  annot[j] =rna1.substring(j,j+1);
-                 System.out.println(annot[j]);
+                 //System.out.println(annot[j]);
                        }
                  
                  for(int k=0;k<rna1.length();k++)
@@ -124,8 +205,9 @@ public class RnamlFile extends AlignFile
                  seqs[0].addAlignmentAnnotation(align);
                  this.annotations.addElement(align);
                }
+               //Annotate3D tintin = new Annotate3D();
                  
-                 
+               //System.out.println(tintin);  
                  
                  
                  
@@ -268,5 +350,14 @@ public class RnamlFile extends AlignFile
            return dataName;
          }
          
+         public ArrayList getRNA()
+         {
+                 return result;
+         }
+         
+         public Vector getAnnot()
+         {
+                 return annotations;
+         }
 }
 
index 42b593e..8aac8f7 100644 (file)
@@ -54,12 +54,12 @@ public class SimpleBlastFile extends AlignFile
   {
   }
 
-  public SimpleBlastFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
+  public SimpleBlastFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException
   {
     super(inFile, type);
   }
 
-  public SimpleBlastFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
+  public SimpleBlastFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException
   {
     super(source);
   }
index 2827191..be1992e 100644 (file)
@@ -57,12 +57,12 @@ public class StockholmFile extends AlignFile
   {\r
   }\r
 \r
-  public StockholmFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed\r
+  public StockholmFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException\r
   {\r
     super(inFile, type);\r
   }\r
 \r
-  public StockholmFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed\r
+  public StockholmFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException\r
   {\r
     super(source);\r
   }\r
index 1531301..01d0939 100644 (file)
@@ -82,13 +82,13 @@ import fr.orsay.lri.varna.exceptions.ExceptionPermissionDenied;
  */
 public class TCoffeeScoreFile extends AlignFile {
        
-  public TCoffeeScoreFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
+  public TCoffeeScoreFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException
   {
     super(inFile, type);
     
   }
 
-  public TCoffeeScoreFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
+  public TCoffeeScoreFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException
   {
     super(source);
   }
index 6c1c8c6..9b17d81 100755 (executable)
@@ -138,6 +138,8 @@ public class GAlignFrame extends JInternalFrame
   protected JRadioButtonMenuItem nucleotideColour = new JRadioButtonMenuItem();
 
   protected JRadioButtonMenuItem purinePyrimidineColour = new JRadioButtonMenuItem();
+  
+  protected JRadioButtonMenuItem RNAInteractionColour = new JRadioButtonMenuItem();
 
   // protected JRadioButtonMenuItem covariationColour = new
   // JRadioButtonMenuItem();
@@ -454,7 +456,7 @@ public class GAlignFrame extends JInternalFrame
     colours.add(purinePyrimidineColour);
     // colours.add(covariationColour);
     colours.add(tcoffeeColour);
-
+    colours.add(RNAInteractionColour);
     setColourSelected(jalview.bin.Cache
             .getDefault("DEFAULT_COLOUR", "None"));
 
@@ -532,6 +534,11 @@ public class GAlignFrame extends JInternalFrame
         purinePyrimidineColour.setSelected(true);
 
         break;
+        
+      case ColourSchemeProperty.RNAINTERACTION:
+          RNAInteractionColour.setSelected(true);
+
+          break;
       /*
        * case ColourSchemeProperty.COVARIATION:
        * covariationColour.setSelected(true);
@@ -911,14 +918,22 @@ public class GAlignFrame extends JInternalFrame
     });
 
     purinePyrimidineColour.setText("Purine/Pyrimidine");
-    purinePyrimidineColour
-            .addActionListener(new java.awt.event.ActionListener()
+    purinePyrimidineColour.addActionListener(new java.awt.event.ActionListener()
             {
               public void actionPerformed(ActionEvent e)
               {
                 purinePyrimidineColour_actionPerformed(e);
               }
             });
+    
+    RNAInteractionColour.setText("RNA Interaction type");
+    RNAInteractionColour.addActionListener(new java.awt.event.ActionListener()
+            {
+              public void actionPerformed(ActionEvent e)
+              {
+                 RNAInteractionColour_actionPerformed(e);
+              }
+            });
     /*
      * covariationColour.setText("Covariation");
      * covariationColour.addActionListener(new java.awt.event.ActionListener() {
@@ -1871,6 +1886,7 @@ public class GAlignFrame extends JInternalFrame
     colourMenu.add(buriedColour);
     colourMenu.add(nucleotideColour);
     colourMenu.add(purinePyrimidineColour);
+    colourMenu.add(RNAInteractionColour);
     // colourMenu.add(covariationColour);
     colourMenu.add(tcoffeeColour);
     colourMenu.add(userDefinedColour);
@@ -1880,7 +1896,7 @@ public class GAlignFrame extends JInternalFrame
     colourMenu.add(abovePIDThreshold);
     colourMenu.add(modifyPID);
     colourMenu.add(annotationColour);
-    colourMenu.add(rnahelicesColour);
+    colourMenu.add(rnahelicesColour);  
     calculateMenu.add(sort);
     calculateMenu.add(calculateTree);
     calculateMenu.addSeparator();
@@ -2264,6 +2280,11 @@ public class GAlignFrame extends JInternalFrame
   protected void purinePyrimidineColour_actionPerformed(ActionEvent e)
   {
   }
+  
+  protected void RNAInteractionColour_actionPerformed(ActionEvent e)
+  {
+  }
+  
 
   /*
    * protected void covariationColour_actionPerformed(ActionEvent e) { }
index d56ba54..8694ecd 100644 (file)
@@ -502,14 +502,14 @@ public class AnnotationRenderer
         {
           char ss = validRes ? row_annotations[column].secondaryStructure
                   : ' ';
-          //System.out.println(ss);
+          
           if (ss == 'S')
           {
             // distinguish between forward/backward base-pairing
             if (row_annotations[column].displayCharacter.indexOf(')') > -1)
             {
               ss = 's';
-              System.out.println(ss);
+              
             }
           }
            if (ss == 'C')
@@ -517,7 +517,7 @@ public class AnnotationRenderer
             if ((row_annotations[column].displayCharacter.indexOf(']') > -1) || (row_annotations[column].displayCharacter.indexOf('}') > -1))
             {
                 ss = 'c';
-                System.out.println(ss);
+                
             }
           }
           if (!validRes || (ss != lastSS))
index 1e2db76..fc6d536 100755 (executable)
@@ -86,6 +86,7 @@ public class ColourSchemeProperty
 
   public static final int TCOFFEE = 15;
 
+  public static final int RNAINTERACTION = 16;
 
   /**
    * index of first colourscheme (includes 'None')
@@ -167,6 +168,11 @@ public class ColourSchemeProperty
     {
       ret = PURINEPYRIMIDINE;
     }
+    
+    else if (name.equalsIgnoreCase("RNA Interaction type"))
+    {
+      ret = RNAINTERACTION;
+    }
     // else if (name.equalsIgnoreCase("Covariation"))
     // {
     // ret = COVARIATION;
@@ -240,6 +246,12 @@ public class ColourSchemeProperty
     {
       index = TCOFFEE;
     }
+    else if (cs instanceof RNAInteractionColourScheme)
+    {
+      index = RNAINTERACTION;
+    }
+    
+    
     /*
      * else if (cs instanceof CovariationColourScheme) { index = COVARIATION; }
      */
@@ -334,6 +346,11 @@ public class ColourSchemeProperty
       ret = "T-Coffee Scores";
 
       break;
+      
+    case RNAINTERACTION:
+        ret = "RNA Interaction type";
+
+        break;
     /*
      * case COVARIATION: ret = "Covariation";
      *
@@ -480,6 +497,12 @@ public class ColourSchemeProperty
 
     case TCOFFEE:
       cs = new TCoffeeColourScheme(coll);
+      break;
+      
+    case RNAINTERACTION:
+        cs = new RNAInteractionColourScheme();
+        break;
+      
     // case COVARIATION:
     // cs = new CovariationColourScheme(annotation);
 
index 493e9cd..77ea1fb 100644 (file)
@@ -27,7 +27,7 @@ public class TCoffeeScoreFileTest {
         final static File ALIGN_FILE = new File("test/jalview/io/tcoffee.fasta_aln");
        
        @Test
-       public void testReadHeader() throws IOException, FileNotFoundException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed {
+       public void testReadHeader() throws IOException, FileNotFoundException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException {
 
                TCoffeeScoreFile scoreFile = new TCoffeeScoreFile(SCORE_FILE.getPath(),AppletFormatAdapter.FILE);
                assertTrue(scoreFile.getWarningMessage(),scoreFile.isValid());
@@ -48,7 +48,7 @@ public class TCoffeeScoreFileTest {
        
        
        @Test
-       public void testWrongFile() throws ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed {
+       public void testWrongFile() throws ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException {
            try {
                TCoffeeScoreFile result = new TCoffeeScoreFile(ALIGN_FILE.getPath(), FormatAdapter.FILE);
                assertFalse(result.isValid());
@@ -59,7 +59,7 @@ public class TCoffeeScoreFileTest {
        } 
 
        @Test
-       public void testHeightAndWidth() throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed {
+       public void testHeightAndWidth() throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException {
                TCoffeeScoreFile result = new TCoffeeScoreFile(SCORE_FILE.getPath(), FormatAdapter.FILE);
                assertTrue(result.isValid());
                assertEquals( 8, result.getHeight() );
@@ -99,7 +99,7 @@ public class TCoffeeScoreFileTest {
        }
 
        @Test
-       public void testParse() throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed {
+       public void testParse() throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException {
 
                TCoffeeScoreFile parser = new TCoffeeScoreFile(SCORE_FILE.getPath(), FormatAdapter.FILE);
 
@@ -116,7 +116,7 @@ public class TCoffeeScoreFileTest {
 
        
        @Test
-       public void testGetAsList() throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed {
+       public void testGetAsList() throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException {
                
           TCoffeeScoreFile parser = new TCoffeeScoreFile(SCORE_FILE.getPath(),FormatAdapter.FILE);
           assertTrue(parser.getWarningMessage(),parser.isValid());
@@ -135,7 +135,7 @@ public class TCoffeeScoreFileTest {
        
        
        @Test
-       public void testGetAsArray() throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed {
+       public void testGetAsArray() throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException {
                
           TCoffeeScoreFile parser = new TCoffeeScoreFile(SCORE_FILE.getPath(),FormatAdapter.FILE);
           assertTrue(parser.getWarningMessage(),parser.isValid());