<classpathentry kind="lib" path="lib/spring-core-3.0.5.RELEASE.jar"/>
<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="lib" path="/Users/jimp/git/jalview_clean/lib/VARNAv3-9-dev.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
+ <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>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType">
+<booleanAttribute key="editedByExternalToolsMainTab" value="true"/>
+<booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="true"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/Jalview Release 2.7/build.xml"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/>
+<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
+<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/java-6-openjdk-i386" path="1" type="4"/> "/>
+<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/Jalview Release 2.7/lib" path="3" type="2"/> "/>
+<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/Jalview Release 2.7/utils" path="3" type="2"/> "/>
+<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry id="org.eclipse.ant.ui.classpathentry.antHome"> <memento default="true"/> </runtimeClasspathEntry> "/>
+<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry id="org.eclipse.ant.ui.classpathentry.extraClasspathEntries"> <memento/> </runtimeClasspathEntry> "/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
+<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
+<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/java-6-openjdk-i386"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.ant.internal.launching.remote.InternalAntRunner"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="Jalview Release 2.7"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_ANT_TARGETS" value="buildindices,"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LAUNCH_CONFIGURATION_BUILD_SCOPE" value="${none}"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/Jalview Release 2.7/build.xml}"/>
+<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
+<stringAttribute key="process_factory_id" value="org.eclipse.ant.ui.remoteAntProcessFactory"/>
+</launchConfiguration>
</projects>
<buildSpec>
<buildCommand>
- <name>org.eclipse.wst.common.project.facet.core.builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
- <name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
- <triggers>full,incremental,</triggers>
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
- <dictionary>
- <key>LaunchConfigHandle</key>
- <value><project>/.externalToolBuilders/Jalview Release indices [Builder].launch</value>
- </dictionary>
</arguments>
</buildCommand>
<buildCommand>
<arguments>
<dictionary>
<key>LaunchConfigHandle</key>
- <value><project>/.externalToolBuilders/buildapplet [Builder].launch</value>
+ <value><project>/.externalToolBuilders/Jalview Release indices [Builder].launch</value>
</dictionary>
</arguments>
</buildCommand>
import java.awt.event.*;
import javax.swing.*;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.xml.sax.SAXException;
+
+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.exceptions.ExceptionUnmatchedClosingParentheses;
import jalview.datamodel.*;
import jalview.gui.*;
String tmpPDBFile;
public PDBViewer(PDBEntry pdbentry, SequenceI[] seq, String[] chains,
- AlignmentPanel ap, String protocol)
+ AlignmentPanel ap, String protocol) throws ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses
{
this.pdbentry = pdbentry;
import java.awt.*;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.xml.sax.SAXException;
+
+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.exceptions.ExceptionUnmatchedClosingParentheses;
+
import jalview.datamodel.*;
import jalview.io.FileParse;
+import jalview.io.RnamlFile;
+import jalview.ws.jws1.Annotate3D;
public class PDBfile extends jalview.io.AlignFile
{
*/
boolean VisibleChainAnnotation = false;
- public PDBfile(String inFile, String inType) throws IOException
+ public PDBfile(String inFile, String inType) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses
{
super(inFile, inType);
}
- public PDBfile(FileParse source) throws IOException
+ public PDBfile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses
{
super(source);
}
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());
-
+
chains = new Vector();
PDBChain tmpchain;
// maintain reference to
// dataset
seqs.addElement(chainseq);
+ if(isRNA(chainseq)==true)
+ {
+ String path =inFile.getPath();
+ System.out.println("this is a PDB format and RNA sequence");
+ Annotate3D an3d = new Annotate3D(path);
+ 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();
+
if (chainannot != null)
{
for (int ai = 0; ai < chainannot.length; ai++)
{
+
chainannot[ai].visible = VisibleChainAnnotation;
annotations.addElement(chainannot[ai]);
}
1.0f / (float) i, .4f, 1.0f));
}
}
+ public boolean isRNA(SequenceI seqs)
+ {
+ for (int i=0;i<seqs.getLength();i++){
+ if((seqs.getCharAt(i)!='A') &&(seqs.getCharAt(i)!='C')&&(seqs.getCharAt(i)!='G')&&(seqs.getCharAt(i)!='U'))
+ {
+ return false;
+ }
+ }
+
+ return true;
+
+
+ }
}
{
char base = line.charAt(i);
- if ((base == '<') || (base == '(') || (base == '{') || (base == '['))
+ if ((base == '<') || (base == '(') || (base == '{') || (base == '[')|| (base == 'A')|| (base == 'B')|| (base == 'C')|| (base == 'D')|| (base == '1')|| (base == 'F')|| (base == 'G')|| (base == '2')|| (base == 'I')|| (base == 'J')|| (base == 'K')|| (base == 'L')|| (base == 'M')|| (base == 'N')|| (base == 'O')|| (base == 'P')|| (base == 'Q')|| (base == 'R')|| (base == 'S')|| (base == 'T')|| (base == 'U')|| (base == 'V')|| (base == 'W')|| (base == 'X')|| (base == 'Y')|| (base == 'Z'))
{
stack.push(i);
}
- else if ((base == '>') || (base == ')') || (base == '}')
- || (base == ']'))
+ else if ((base == '>') || (base == ')') || (base == '}')|| (base == ']')|| (base == 'a')|| (base == 'b')|| (base == 'c')|| (base == 'd')|| (base == 'e')|| (base == 'f')|| (base == 'g')|| (base == 'h')|| (base == 'i')|| (base == 'j')|| (base == 'k')|| (base == 'l')|| (base == 'm')|| (base == 'n')|| (base == 'o')|| (base == 'p')|| (base == 'q')|| (base == 'r')|| (base == 's')|| (base == 't')|| (base == 'u')|| (base == 'v')|| (base == 'w')|| (base == 'x')|| (base == 'y')|| (base == 'z'))
+
{
if (stack.isEmpty())
}
Object temp = stack.pop();
pairs.addElement(temp);
- pairs.addElement(i);
+ pairs.addElement(i);
+ //System.out.println(pairs);
}
i++;
*/
public static int findPair(SequenceFeature[] pairs, int indice)
{
+ System.out.print("indice"+indice+" ");
for (int i = 0; i < pairs.length; i++)
{
if (pairs[i].getBegin() == indice)
+
{
+ System.out.println(pairs[i].getEnd());
return pairs[i].getEnd();
+
}
}
return -1;
int end, Hashtable[] result, boolean profile,
AlignmentAnnotation rnaStruc)
{
+// System.out.println("longueur="+sequences.length);
+// for(int l=0;l<=(sequences.length-1);l++){
+// System.out.println("sequences "+l+":"+sequences[l].getSequenceAsString());
+// }
+// System.out.println("start="+start);
+ System.out.println("end="+end);
+// System.out.println("result="+result.length);
+//
+// System.out.println("profile="+profile);
+// System.out.println("rnaStruc="+rnaStruc);
Hashtable residueHash;
String maxResidue;
- char[] seq, struc = rnaStruc.getRNAStruc().toCharArray();
+ char[] struc = rnaStruc.getRNAStruc().toCharArray();
SequenceFeature[] rna = rnaStruc._rnasecstr;
char c, s, cEnd;
- int count, nonGap = 0, i, bpEnd = -1, j, jSize = sequences.length;
+ int count = 0, nonGap = 0, i, bpEnd = -1, j, jSize = sequences.length;
int[] values;
int[][] pairs;
float percentage;
+ boolean wooble = true;
for (i = start; i < end; i++) // foreach column
{
values = new int[255];
pairs = new int[255][255];
bpEnd = -1;
+ //System.out.println("s="+struc[i]);
if (i < struc.length)
{
s = struc[i];
+
}
else
{
s = '-';
}
- if (s != '(')
+ if (s != '(' && s != '[')
{
if (s == '-')
{
}
else
{
+
+
bpEnd = findPair(rna, i);
+
if (bpEnd>-1)
{
for (j = 0; j < jSize; j++) // foreach row
continue;
}
c = sequences[j].getCharAt(i);
- {
+ //System.out.println("c="+c);
+
// standard representation for gaps in sequence and structure
if (c == '.' || c == ' ')
continue;
}
cEnd = sequences[j].getCharAt(bpEnd);
- if (checkBpType(c, cEnd))
+
+
+ System.out.println("pairs ="+c+","+cEnd);
+ if (checkBpType(c, cEnd)==true)
{
values['(']++; // H means it's a helix (structured)
+ maxResidue = "(";
+ wooble=true;
+ System.out.println("It's a pair wc");
+
}
- pairs[c][cEnd]++;
-
- maxResidue = "(";
- }
- }
+ if (checkBpType(c, cEnd)==false)
+ {
+ wooble =false;
+ values['[']++; // H means it's a helix (structured)
+ maxResidue = "[";
+ System.out.println("It's an pair non canonic");
+ System.out.println(sequences[j].getRNA());
+ System.out.println(rnaStruc.getRNAStruc().charAt(i));
+ }
+ pairs[c][cEnd]++;
+
+
+ }
}
// nonGap++;
}
residueHash.put(PAIRPROFILE, pairs);
}
-
+ if (wooble==true)
+ {
count = values['('];
-
+ }
+ if (wooble==false)
+ {
+ count = values['['];
+ }
residueHash.put(MAXCOUNT, new Integer(count));
residueHash.put(MAXRESIDUE, maxResidue);
}
if (bpEnd > 0)
{
- values[')'] = values['('];
+ values[')'] = values['('];
+ values[']'] = values['['];
values['('] = 0;
-
+ values['['] = 0;
residueHash = new Hashtable();
- maxResidue = ")";
-
+ if (wooble==true){
+ System.out.println(maxResidue+","+wooble);
+ maxResidue = ")";
+ }
+ if(wooble==false){
+ System.out.println(maxResidue+","+wooble);
+ maxResidue = "]";
+ }
if (profile)
{
residueHash.put(PROFILE, new int[][]
residueHash.put(PID_GAPS, new Float(percentage));
result[bpEnd] = residueHash;
+
}
}
}
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
import java.util.StringTokenizer;\r
import java.util.Vector;\r
\r
+import javax.xml.parsers.ParserConfigurationException;\r
+\r
+import org.xml.sax.SAXException;\r
+\r
+import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax;\r
+import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed;\r
+import fr.orsay.lri.varna.exceptions.ExceptionPermissionDenied;\r
+import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses;\r
+\r
public class AlignFrame extends EmbmenuFrame implements ActionListener, ItemListener, KeyListener\r
{\r
public AlignmentPanel alignPanel;\r
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
{\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
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
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
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
* @param source File/URL/T-COFFEE score file contents\r
* @throws IOException\r
* @return true if alignment was annotated with data from source\r
+ * @throws SAXException \r
+ * @throws ParserConfigurationException \r
+ * @throws ExceptionFileFormatOrSyntax \r
+ * @throws ExceptionLoadingFailed \r
+ * @throws ExceptionPermissionDenied \r
+ * @throws InterruptedException \r
+ * @throws ExceptionUnmatchedClosingParentheses \r
*/\r
- public boolean loadScoreFile( String source ) throws IOException {\r
+ public boolean loadScoreFile( String source ) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses {\r
\r
TCoffeeScoreFile file = new TCoffeeScoreFile(source, AppletFormatAdapter.checkProtocol(source));\r
if( !file.isValid()) {\r
*/
package jalview.bin;
+import java.awt.FlowLayout;
+import java.awt.Frame;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
}
});
}
+ protected static boolean proteine;
/**
* main class for Jalview application
// We'll only open the default file if the desktop is visible.
// And the user
// ////////////////////
+
+ JFrame Typechooser =new JFrame("choose molecule type");
+ FlowLayout fl = new FlowLayout();
+ Typechooser.setLayout(fl);
+ Typechooser.setSize(400,400);
+ Typechooser.setDefaultCloseOperation(Typechooser.DISPOSE_ON_CLOSE);
+ JLabel label = new JLabel("What would you open ? ");
+ JButton rnabutton = new JButton("RNA molecule");
+ JButton pbutton = new JButton("Proteine molecule");
+
+ pbutton.addActionListener(new pbuttonlistener());
+ rnabutton.addActionListener(new rnabuttonlistener());
+ Typechooser.getContentPane().add(label);
+ Typechooser.getContentPane().add(rnabutton);
+ Typechooser.getContentPane().add(pbutton);
+ Typechooser.setVisible(true);
+
+
+
+
if (!headless && file == null && vamsasImport == null
- && jalview.bin.Cache.getDefault("SHOW_STARTUP_FILE", true))
+ && jalview.bin.Cache.getDefault("SHOW_STARTUP_FILE", true) && proteine == true)
{
file = jalview.bin.Cache.getDefault("STARTUP_FILE",
jalview.bin.Cache.getDefault("www.jalview.org", "http://www.jalview.org")+"/examples/exampleFile_2_7.jar");
desktop.setInBatchMode(false);
}
}
-
+
+
private static void startUsageStats(final Desktop desktop)
{
/**
* @author Andrew Waterhouse and JBP documented.
*
*/
+
+class rnabuttonlistener implements ActionListener{
+ public void actionPerformed(ActionEvent arg0) {
+ System.out.println("Good idea ! ");
+
+ }
+}
+
+class pbuttonlistener implements ActionListener{
+ public void actionPerformed(ActionEvent arg0) {
+
+
+ }
+}
+
class ArgsParser
{
Vector vargs = null;
{
return queued == 0 && running == 0;
}
+
+
+
};
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!
*
/** DOCUMENT ME!! */
public Annotation[] annotations;
+
+
/**
* RNA secondary structure contact positions
else
// Check for RNA secondary structure
{
- if (annotations[i].secondaryStructure == 'S')
+ //System.out.println(annotations[i].secondaryStructure);
+ if (annotations[i].secondaryStructure == '('
+ || annotations[i].secondaryStructure == '['
+ || annotations[i].secondaryStructure == '<'
+ || annotations[i].secondaryStructure == '{'
+ || annotations[i].secondaryStructure == 'A'
+ || annotations[i].secondaryStructure == 'B'
+ || annotations[i].secondaryStructure == 'C'
+ || annotations[i].secondaryStructure == 'D'
+ || annotations[i].secondaryStructure == '1'
+ || annotations[i].secondaryStructure == 'F'
+ || annotations[i].secondaryStructure == 'G'
+ || annotations[i].secondaryStructure == '2'
+ || annotations[i].secondaryStructure == 'I'
+ || annotations[i].secondaryStructure == 'J'
+ || annotations[i].secondaryStructure == 'K'
+ || annotations[i].secondaryStructure == 'L'
+ || annotations[i].secondaryStructure == 'M'
+ || annotations[i].secondaryStructure == 'N'
+ || annotations[i].secondaryStructure == 'O'
+ || annotations[i].secondaryStructure == 'P'
+ || annotations[i].secondaryStructure == 'Q'
+ || annotations[i].secondaryStructure == 'R'
+ || annotations[i].secondaryStructure == 'S'
+ || annotations[i].secondaryStructure == 'T'
+ || annotations[i].secondaryStructure == 'U'
+ || annotations[i].secondaryStructure == 'V'
+ || annotations[i].secondaryStructure == 'W'
+ || annotations[i].secondaryStructure == 'X'
+ || annotations[i].secondaryStructure == 'Y'
+ || annotations[i].secondaryStructure == 'Z')
{
hasIcons |= true;
isrna |= true;
firstChar != ' '
&& firstChar != 'H'
&& firstChar != 'E'
+ && firstChar != '('
+ && firstChar != '['
+ && firstChar != '>'
+ && firstChar != '{'
+ && firstChar != 'A'
+ && firstChar != 'B'
+ && firstChar != 'C'
+ && firstChar != 'D'
+ && firstChar != '1'
+ && firstChar != 'F'
+ && firstChar != 'G'
+ && firstChar != '2'
+ && firstChar != 'I'
+ && firstChar != 'J'
+ && firstChar != 'K'
+ && firstChar != 'L'
+ && firstChar != 'M'
+ && firstChar != 'N'
+ && firstChar != 'O'
+ && firstChar != 'P'
+ && firstChar != 'Q'
+ && firstChar != 'R'
&& firstChar != 'S'
+ && firstChar != 'T'
+ && firstChar != 'U'
+ && firstChar != 'V'
+ && firstChar != 'W'
+ && firstChar != 'X'
+ && firstChar != 'Y'
+ && firstChar != 'Z'
&& firstChar != '-'
&& firstChar < jalview.schemes.ResidueProperties.aaIndex.length)
{
{
if (annotations[i] != null)
{
- annotations[i].displayCharacter = "";
+ annotations[i].displayCharacter = "X";
}
}
}
{
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);
this.calcId = calcId;
}
+
+
}
package jalview.datamodel;
import java.awt.*;
+import java.util.ArrayList;
+
+import fr.orsay.lri.varna.models.rna.RNA;
/**
* DOCUMENT ME!
/** DOCUMENT ME!! */
public float value;
+
+
// add visual cues here
description = desc;
secondaryStructure = ss;
value = val;
+
}
/**
secondaryStructure = that.secondaryStructure;
value = that.value;
colour = that.colour;
+
}
/**
*/
public Annotation(float val)
{
- this(null, null, ' ', val);
+ this(null, null, ' ', val,null);
}
+
+
+
+
}
--- /dev/null
+package jalview.datamodel;
+
+import fr.orsay.lri.varna.models.rna.RNA;
+
+public class SecondaryStructureAnnotation extends AlignmentAnnotation
+{
+
+
+ private static RNA _rna = null;
+ public SecondaryStructureAnnotation (RNA rna)
+ {
+ super("Secondary Structure", "Un truc trop cool",getAnnotation(rna));
+
+
+ _rna = rna;
+ }
+
+ public RNA getRNA()
+ {
+ return _rna;
+ }
+ public static Annotation[] getAnnotation(RNA rna)
+ {
+ Annotation[] ann = new Annotation[rna.getSize()];
+ for(int i=0;i<ann.length;i++)
+ {
+ ann[i] = new Annotation(_rna.getStructDBN(true), "", ' ', 0f);;
+ }
+ return ann;
+ }
+}
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.
String vamsasId;
DBRefEntry[] dbrefs;
+
+ RNA rna;
/**
* This annotation is displayed below the alignment but the positions are tied
*/
int index = -1;
- /** array of seuqence features - may not be null for a valid sequence object */
+ /** array of sequence features - may not be null for a valid sequence object */
public SequenceFeature[] sequenceFeatures;
/**
* @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; }
+
}
*/
package jalview.datamodel;
+
import java.util.Vector;
+import fr.orsay.lri.varna.models.rna.RNA;
+
/**
* DOCUMENT ME!
*
* @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);
+
}
*/\r
public static String[] getColourBySequenceCommand(StructureSelectionManager ssm, String[] files, SequenceI[][] sequence, SequenceRenderer sr, FeatureRenderer fr, AlignmentI alignment)\r
{\r
+ \r
ArrayList<String> str = new ArrayList<String>();\r
StringBuffer command = new StringBuffer();\r
\r
public AppVarna(String sname, SequenceI seq, String strucseq, String 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("ou ici ?");
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();
{
e3.printStackTrace();
}
+
RNA trim = trimRNA(rna1, "trimmed "+sname);
rnaList.add(trim);
rnaList.add(rna1);
+
rnas.put(seq, rna1);
rnas.put(seq, trim);
+
rna1.setName(sname+" (with gaps)");
{
seqs.put(trim, seq);
seqs.put(rna1, seq);
-
+
/**
* if (false || seq.getStart()!=1) { for (RNA rshift:rnaList) { ShiftList
* shift=offsets.get(rshift); if (shift==null) { offsets.put(rshift,
// System.out.println("Hallo: "+name);
this.name = sname+" trimmed to "+name;
initVarna();
+
ssm = ap.getStructureSelectionManager();
+ System.out.println(ssm.toString());
ssm.addStructureViewerListener(this);
ssm.addSelectionListener(this);
}
public void initVarna()
{
+ System.out.println("initialisation VANRA");
// vab.setFinishedInit(false);
varnaPanel = vab.get_varnaPanel();
setBackground(Color.white);
getBounds().width, getBounds().height);
this.pack();
showPanel(true);
+ System.out.println("Sortie initialisation VANRA");
}
public String replaceOddGaps(String oldStr)
public RNA trimRNA(RNA rna, String name)
{
ShiftList offset = new ShiftList();
+
RNA rnaTrim = new RNA(name);
try
{
{
// super("VARNA in Jalview");
initVarna(seq, struc);
+
}
public AppVarnaBinding(ArrayList<RNA> rnaList)
{
+
// super("VARNA in Jalview");
initVarnaEdit(rnaList);
}
private void initVarna(String seq, String str)
{
+
DefaultListModel dlm = new DefaultListModel();
DefaultListSelectionModel m = new DefaultListSelectionModel();
try
{
+
vp = new VARNAPanel("0", ".");
_RNA1.setRNA(seq, str);
_RNA1.drawRNARadiate(vp.getConfig());
private void initVarnaEdit(ArrayList<RNA> rnaInList)
{
+
DefaultListModel dlm = new DefaultListModel();
int marginTools = 40;
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());
}
try
{
+
vp = new VARNAPanel("0", ".");
for (int i = 0; i < rnaInList.size(); i++)
{
rnaInList.get(i).drawRNARadiate(vp.getConfig());
+
}
} catch (ExceptionNonEqualLength e)
{
package jalview.gui;
import javax.swing.JOptionPane;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.xml.sax.SAXException;
+
+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.exceptions.ExceptionUnmatchedClosingParentheses;
import jalview.datamodel.PDBEntry;
import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceI;
+import jalview.io.FileParse;
+import jalview.io.IdentifyFile;
/**
* GUI related routines for associating PDB files with sequences
* assocate the given PDB file with
* @param choice
* @param sequence
+ * @throws SAXException
+ * @throws ParserConfigurationException
+ * @throws ExceptionFileFormatOrSyntax
+ * @throws ExceptionLoadingFailed
+ * @throws ExceptionPermissionDenied
+ * @throws InterruptedException
+ * @throws ExceptionUnmatchedClosingParentheses
*/
- public PDBEntry associatePdbWithSeq(String choice, String protocol, SequenceI sequence, boolean prompt)
+ public PDBEntry associatePdbWithSeq(String choice, String protocol, SequenceI sequence, boolean prompt) throws ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses
{
PDBEntry entry = new PDBEntry();
try
{
+
+ System.out.println("This is a annotation PDB");
+
+
MCview.PDBfile pdbfile = new MCview.PDBfile(choice,
protocol);
{
entry.setId(pdbfile.id);
}
+
} catch (java.io.IOException ex)
{
ex.printStackTrace();
entry.setFile(choice);
sequence.getDatasetSequence().addPDBId(entry);
return entry;
+
}
}
import java.awt.event.*;
import javax.swing.*;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.xml.sax.SAXException;
+
+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.exceptions.ExceptionUnmatchedClosingParentheses;
import MCview.*;
import jalview.analysis.*;
protected JRadioButtonMenuItem BLOSUM62Colour = new JRadioButtonMenuItem();
protected JRadioButtonMenuItem purinePyrimidineColour = new JRadioButtonMenuItem();
+ protected JRadioButtonMenuItem RNAInteractionColour = new JRadioButtonMenuItem();
// protected JRadioButtonMenuItem covariationColour = new
// JRadioButtonMenuItem();
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++)
menuItem = new JMenuItem();
menuItem.setText("2D RNA "+structureLine);
menuItem.addActionListener(new java.awt.event.ActionListener()
+
{
public void actionPerformed(ActionEvent e)
{
- 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(structureLine, seq, seq.getSequenceAsString(), rnastruc, seq
+ .getName(), ap);
+ //new AppVarna(seq.getName(),seq,rnastruc,seq.getRNA(), seq.getName(), ap);
+ System.out.println("end");
}
});
viewStructureMenu.add(menuItem);
public void actionPerformed(ActionEvent e)
{
// TODO: VARNA does'nt print gaps in the sequence
+
+ //new AppVarna(seq.getName()+" structure",seq,rnastruc,seq.getRNA(), seq.getName(), ap);
new AppVarna(seq.getName()+" structure",seq,seq.getSequenceAsString(), rnastruc, seq
.getName(), ap);
}
{
purinePyrimidineColour.setSelected(true);
}
+
+ else if (sg.cs instanceof RNAInteractionColourScheme)
+ {
+ RNAInteractionColour.setSelected(true);
+ }
/*
* else if (sg.cs instanceof CovariationColourScheme) {
* covariationColour.setSelected(true); }
{
public void actionPerformed(ActionEvent e)
{
- pdbFromFile_actionPerformed();
+ try {
+ pdbFromFile_actionPerformed();
+ } catch (ExceptionFileFormatOrSyntax e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ } catch (ParserConfigurationException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ } catch (SAXException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ } catch (ExceptionPermissionDenied e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ } catch (ExceptionLoadingFailed e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ } catch (InterruptedException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ } catch (ExceptionUnmatchedClosingParentheses e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
}
});
enterPDB.setText("Enter PDB Id");
colourMenu.add(turnColour);
colourMenu.add(buriedColour);
colourMenu.add(nucleotideMenuItem);
+ colourMenu.add(RNAInteractionColour);
if (ap.getAlignment().isNucleotide()) {
colourMenu.add(purinePyrimidineColour);
}
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) {
refresh();
}
+ protected void RNAInteractionColour_actionPerformed()
+ {
+ getGroup().cs = new RNAInteractionColourScheme();
+ refresh();
+ }
/*
* protected void covariationColour_actionPerformed() { getGroup().cs = new
* CovariationColourScheme(sequence.getAnnotation()[0]); refresh(); }
oal = null;
}
- public void pdbFromFile_actionPerformed()
+ public void pdbFromFile_actionPerformed() throws ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses
{
jalview.io.JalviewFileChooser chooser = new jalview.io.JalviewFileChooser(
jalview.bin.Cache.getProperty("LAST_DIRECTORY"));
import java.util.Hashtable;
import java.util.Vector;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.xml.sax.SAXException;
+
+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.exceptions.ExceptionUnmatchedClosingParentheses;
+
/**
* DOCUMENT ME!
*
*/
public AlignFile()
{
+ // Shouldn't we init data structures
+ initData();
}
/**
* Filename to read from.
* @param type
* What type of file to read from (File, URL)
+ * @throws SAXException
+ * @throws ParserConfigurationException
+ * @throws ExceptionFileFormatOrSyntax
+ * @throws ExceptionLoadingFailed
+ * @throws ExceptionPermissionDenied
+ * @throws InterruptedException
+ * @throws ExceptionUnmatchedClosingParentheses
*/
- public AlignFile(String inFile, String type) throws IOException
+ public AlignFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses
{
super(inFile, type);
initData();
*
* @param source
* @throws IOException
+ * @throws SAXException
+ * @throws ParserConfigurationException
+ * @throws ExceptionFileFormatOrSyntax
+ * @throws ExceptionLoadingFailed
+ * @throws ExceptionPermissionDenied
+ * @throws InterruptedException
+ * @throws ExceptionUnmatchedClosingParentheses
*/
- public AlignFile(FileParse source) throws IOException
+ public AlignFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses
{
super(source);
initData();
/**
* This method must be implemented to parse the contents of the file.
+ * @throws ExceptionFileFormatOrSyntax
+ * @throws SAXException
+ * @throws ParserConfigurationException
+ * @throws ExceptionLoadingFailed
+ * @throws ExceptionPermissionDenied
+ * @throws InterruptedException
+ * @throws ExceptionUnmatchedClosingParentheses
*/
- public abstract void parse() throws IOException;
+ public abstract void parse() throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses;
/**
* Print out in alignment file format the Sequences in the seqs Vector.
*/
public static final String[] READABLE_FORMATS = new String[]
{ "BLC", "CLUSTAL", "FASTA", "MSF", "PileUp", "PIR", "PFAM", "STH",
- "PDB", "JnetFile" }; // , "SimpleBLAST" };
+ "PDB", "JnetFile" , "RNAML"}; // , "SimpleBLAST" };
/**
* List of valid format strings for use by callers of the formatSequences
* that are writable by the application.
*/
public static final String[] WRITABLE_EXTENSIONS = new String[]
- { "fa, fasta, fastq", "aln", "pfam", "msf", "pir", "blc", "amsa", "jar" };
+ { "fa,faa,fasta,fastq", "aln", "pfam", "msf", "pir", "blc", "amsa", "jar" };
/**
* List of writable formats by the application. Order must correspond with the
* corresponding to READABLE_FNAMES
*/
public static final String[] READABLE_EXTENSIONS = new String[]
- { "fa, fasta, fastq", "aln", "pfam", "msf", "pir", "blc", "amsa", "jar",
- "sto,stk" }; // ,
+ { "fa,faa,fasta,fastq", "aln", "pfam", "msf", "pir", "blc", "amsa", "jar",
+ "sto,stk","xml" }; // ,
// ".blast"
// };
*/
public static final String[] READABLE_FNAMES = new String[]
{ "Fasta", "Clustal", "PFAM", "MSF", "PIR", "BLC", "AMSA", "Jalview",
- "Stockholm" };// ,
+ "Stockholm","RNAML" };// ,
// "SimpleBLAST"
// };
}
else if (format.equals("PDB"))
{
- afile = new MCview.PDBfile(inFile, type);
+ afile = new MCview.PDBfile(inFile, type);
}
else if (format.equals("STH"))
{
{
afile = new SimpleBlastFile(inFile, type);
}
-
+ else if (format.equals("RNAML"))
+ {
+ afile = new RnamlFile(inFile, type);
+ }
+
Alignment al = new Alignment(afile.getSeqsAsArray());
afile.addAnnotations(al);
{
afile = new StockholmFile(source);
}
+ else if (format.equals("RNAML"))
+ {
+ afile = new RnamlFile(source);
+ }
else if (format.equals("SimpleBLAST"))
{
afile = new SimpleBlastFile(source);
{
afile = new AMSAFile(alignment);
}
+ else if (format.equalsIgnoreCase("RNAML"))
+ {
+ afile = new RnamlFile();
+ }
+
else
{
throw new Exception(
import java.io.*;
import java.util.*;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.xml.sax.SAXException;
+
+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.exceptions.ExceptionUnmatchedClosingParentheses;
+
import jalview.datamodel.*;
/**
*
* @throws IOException
* DOCUMENT ME!
+ * @throws SAXException
+ * @throws ParserConfigurationException
+ * @throws ExceptionFileFormatOrSyntax
+ * @throws ExceptionLoadingFailed
+ * @throws ExceptionPermissionDenied
+ * @throws InterruptedException
+ * @throws ExceptionUnmatchedClosingParentheses
*/
- public BLCFile(String inFile, String type) throws IOException
+ public BLCFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses
{
super(inFile, type);
}
- public BLCFile(FileParse source) throws IOException
+ public BLCFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses
{
super(source);
}
import java.io.*;
import java.util.*;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.xml.sax.SAXException;
+
+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.exceptions.ExceptionUnmatchedClosingParentheses;
+
import jalview.datamodel.*;
import jalview.util.*;
{
}
- public ClustalFile(String inFile, String type) throws IOException
+ public ClustalFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses
{
super(inFile, type);
}
- public ClustalFile(FileParse source) throws IOException
+ public ClustalFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses
{
super(source);
}
import java.io.*;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.xml.sax.SAXException;
+
+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.exceptions.ExceptionUnmatchedClosingParentheses;
+
import jalview.datamodel.*;
/**
*
* @throws IOException
* DOCUMENT ME!
+ * @throws SAXException
+ * @throws ParserConfigurationException
+ * @throws ExceptionFileFormatOrSyntax
+ * @throws ExceptionLoadingFailed
+ * @throws ExceptionPermissionDenied
+ * @throws InterruptedException
+ * @throws ExceptionUnmatchedClosingParentheses
*/
- public FastaFile(String inFile, String type) throws IOException
+ public FastaFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses
{
super(inFile, type);
}
- public FastaFile(FileParse source) throws IOException
+ public FastaFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses
{
super(source);
}
import java.io.*;\r
import java.util.*;\r
\r
+import javax.xml.parsers.ParserConfigurationException;\r
+\r
+import org.xml.sax.SAXException;\r
+\r
+import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax;\r
+import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed;\r
+import fr.orsay.lri.varna.exceptions.ExceptionPermissionDenied;\r
+import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses;\r
+\r
import jalview.analysis.SequenceIdMatcher;\r
import jalview.datamodel.*;\r
import jalview.schemes.*;\r
* \r
* @throws IOException\r
* DOCUMENT ME!\r
+ * @throws SAXException \r
+ * @throws ParserConfigurationException \r
+ * @throws ExceptionFileFormatOrSyntax \r
+ * @throws ExceptionLoadingFailed \r
+ * @throws ExceptionPermissionDenied \r
+ * @throws InterruptedException \r
+ * @throws ExceptionUnmatchedClosingParentheses \r
*/\r
- public FeaturesFile(String inFile, String type) throws IOException\r
+ public FeaturesFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses\r
{\r
super(inFile, type);\r
}\r
\r
- public FeaturesFile(FileParse source) throws IOException\r
+ public FeaturesFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses\r
{\r
super(source);\r
}\r
break;
}
+
+ if ((data.indexOf("<") > -1))
+ {
+ reply = "RNAML";
+
+ break;
+ }
if ((data.length() < 1) || (data.indexOf("#") == 0))
{
break;
}
+
+
else if (data.indexOf(">") > -1)
{
// FASTA, PIR file or BLC file
public static void main(String[] args)
{
+
for (int i = 0; args != null && i < args.length; i++)
{
IdentifyFile ider = new IdentifyFile();
import java.io.*;
import java.util.*;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.xml.sax.SAXException;
+
+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.exceptions.ExceptionUnmatchedClosingParentheses;
+
import jalview.datamodel.*;
/**
*
* @throws IOException
* DOCUMENT ME!
+ * @throws SAXException
+ * @throws ParserConfigurationException
+ * @throws ExceptionFileFormatOrSyntax
+ * @throws ExceptionLoadingFailed
+ * @throws ExceptionPermissionDenied
+ * @throws InterruptedException
+ * @throws ExceptionUnmatchedClosingParentheses
*/
- public JPredFile(String inFile, String type) throws IOException
+ public JPredFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses
{
super(inFile, type);
}
- public JPredFile(FileParse source) throws IOException
+ public JPredFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses
{
super(source);
}
*
* @param args
* DOCUMENT ME!
+ * @throws SAXException
+ * @throws ParserConfigurationException
+ * @throws ExceptionFileFormatOrSyntax
+ * @throws ExceptionLoadingFailed
+ * @throws ExceptionPermissionDenied
+ * @throws InterruptedException
+ * @throws ExceptionUnmatchedClosingParentheses
*/
- public static void main(String[] args)
+ public static void main(String[] args) throws ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses
{
try
{
{
format = "PFAM";
}
-
+
return format;
}
import java.io.*;
import java.util.*;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.xml.sax.SAXException;
+
+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.exceptions.ExceptionUnmatchedClosingParentheses;
+
import jalview.datamodel.*;
import jalview.util.*;
*
* @throws IOException
* DOCUMENT ME!
+ * @throws SAXException
+ * @throws ParserConfigurationException
+ * @throws ExceptionFileFormatOrSyntax
+ * @throws ExceptionLoadingFailed
+ * @throws ExceptionPermissionDenied
+ * @throws InterruptedException
+ * @throws ExceptionUnmatchedClosingParentheses
*/
- public MSFfile(String inFile, String type) throws IOException
+ public MSFfile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses
{
super(inFile, type);
}
- public MSFfile(FileParse source) throws IOException
+ public MSFfile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses
{
super(source);
}
import java.io.*;
import java.util.*;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.xml.sax.SAXException;
+
+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.exceptions.ExceptionUnmatchedClosingParentheses;
+
import jalview.datamodel.*;
public class PIRFile extends AlignFile
{
}
- public PIRFile(String inFile, String type) throws IOException
+ public PIRFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses
{
super(inFile, type);
}
- public PIRFile(FileParse source) throws IOException
+ public PIRFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses
{
super(source);
}
import java.io.*;
import java.util.*;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.xml.sax.SAXException;
+
+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.exceptions.ExceptionUnmatchedClosingParentheses;
+
import jalview.datamodel.*;
import jalview.util.*;
{
}
- public PfamFile(String inFile, String type) throws IOException
+ public PfamFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses
{
super(inFile, type);
}
- public PfamFile(FileParse source) throws IOException
+ public PfamFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses
{
super(source);
}
*/
import java.io.*;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.xml.sax.SAXException;
+
+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.exceptions.ExceptionUnmatchedClosingParentheses;
+
import jalview.datamodel.*;
import jalview.util.*;
*
* @throws IOException
* DOCUMENT ME!
+ * @throws SAXException
+ * @throws ParserConfigurationException
+ * @throws ExceptionFileFormatOrSyntax
+ * @throws ExceptionLoadingFailed
+ * @throws ExceptionPermissionDenied
+ * @throws InterruptedException
+ * @throws ExceptionUnmatchedClosingParentheses
*/
- public PileUpfile(String inFile, String type) throws IOException
+ public PileUpfile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses
{
super(inFile, type);
}
- public PileUpfile(FileParse source) throws IOException
+ public PileUpfile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses
{
super(source);
}
--- /dev/null
+package jalview.io;
+
+
+
+
+
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.Annotation;
+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;
+import java.io.IOException;
+import java.io.Reader;
+import java.io.FileReader;
+import java.lang.reflect.Array;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Vector;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+import com.stevesoft.pat.Regex;
+
+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.exceptions.ExceptionUnmatchedClosingParentheses;
+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;
+
+
+
+
+public class RnamlFile extends AlignFile
+{
+ public String id;
+ protected ArrayList<RNA> result;
+
+ public RnamlFile()
+ {
+ super();
+
+ }
+
+ public RnamlFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses
+ {
+ super(inFile, type);
+
+ }
+
+ public RnamlFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses
+ {
+ 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;
+ }
+
+
+ @SuppressWarnings("unchecked")
+ public void parse() throws FileNotFoundException, ExceptionPermissionDenied, ExceptionLoadingFailed, ExceptionFileFormatOrSyntax
+ {
+ FileReader fr = null;
+ fr = new FileReader(inFile);
+
+ BufferedReader r = new BufferedReader (fr);
+
+ //ArrayList<String> seq =new ArrayList();
+ //System.out.println(r);
+
+
+ result = RNAFactory.loadSecStrRNAML(r);
+
+ System.out.println("this is the secondary scructure:" +result.size());
+ //System.out.println("this is the secondary scructure:" +result.toString());
+ //System.out.println("this is the secondary scructure:" +result.size());
+ SequenceI[] seqs = new SequenceI[result.size()];
+ System.out.println(type); //the type is "File"
+ System.out.println(inFile );//inFile is the path
+
+ for(int i=0;i<result.size();i++)
+ {
+ RNA current = result.get(i);
+ System.out.println(current.getSeq());
+ //System.out.println(result.get(i).getStructBPSEQ());
+ System.out.println(result.get(i).getStructDBN(true));
+ System.out.println(i);
+ String rna =current.getStructDBN(true);
+ //System.out.println(result.get(0).getAnnotations());
+ String seq = current.getSeq();
+
+ int begin=0;
+ int end = seq.length()-1;
+
+ id = safeName(getDataName());
+ seqs[i] = new Sequence(id, seq, begin, end);
+ //System.out.println(seq);
+ System.out.println("Rna is still "+rna);
+ //SequenceFeature feat = new SequenceFeature(type, "",5, 13, 0f, null);
+ //seqs[i].addSequenceFeature(feat);
+
+ String[] annot=new String[rna.length()] ;
+ Annotation[] ann = new Annotation[rna.length()];
+
+ for(int j=0;j<rna.length();j++)
+ {
+ annot[j] =rna.substring(j,j+1);
+
+ }
+
+ for(int k=0;k<rna.length();k++)
+ {
+ ann[k] = new Annotation(annot[k], "", jalview.schemes.ResidueProperties.getRNASecStrucState(annot[k]).charAt(0), 0f);
+
+ }
+ AlignmentAnnotation align = new AlignmentAnnotation("Sec. str.",current.getID(),ann);
+
+ seqs[i].addAlignmentAnnotation(align);
+ seqs[i].setRNA(result.get(i));
+ this.annotations.addElement(align);
+ }
+ this.setSeqs(seqs);
+
+
+
+
+ }
+
+
+ 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);
+
+ 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());
+ 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);
+ this.annotations.addElement(align);
+ }
+ //Annotate3D tintin = new Annotate3D();
+
+ //System.out.println(tintin);
+
+
+
+
+
+
+
+
+// for(RNAMLParser.RNATmp rnaTmp : RNAMLData.getMolecules())
+// {
+// // Retrieving parsed data
+// seq = rnaTmp.getSequence(); //contient la séquence sous forme de liste
+// System.out.println(seq);
+// String seqAsStr = "";
+// for(String s:seq)
+// {
+// // Only consider last character, e.g. in case of modified nucleotide
+// seqAsStr += s.charAt(s.length()-1);
+// }
+// int begin=0;
+// int end = seqAsStr.length()-1;
+// SequenceI[] seqs = new SequenceI[1];
+// id = safeName(getDataName());
+// seqs[0] = new Sequence(id, seqAsStr, begin, end);
+// SequenceFeature feat = new SequenceFeature(type, "",5, 13, 0f, null);
+//
+// seqs[0].addSequenceFeature(feat);
+// this.setSeqs(seqs);
+
+ //String pos = annot.substring(1, 2);
+ //System.out.println(annot);
+ //System.out.println(pos);
+
+ // ann[1] = new Annotation(pos, "", ' ', 0f);
+ // ann[1].secondaryStructure = 'A';
+ //System.out.println(ann[1]);
+
+ // toto.annotations=ann;
+
+
+
+//// Annotation[] els = new Annotation[seq.size()];
+//
+// //System.err.println(""+seq.size());
+// Vector<RNAMLParser.BPTemp> allbpsTmp = rnaTmp.getStructure();
+// String[] annot = new String[10000];
+//
+// //Annotation[] ann = new Annotation[allbpsTmp.size()];
+// for (int i = 0; i < allbpsTmp.size(); i++) {
+// RNAMLParser.BPTemp bp = allbpsTmp.get(i);
+// //System.err.println("toto ="+bp);
+// int bp5 = bp.pos5;
+// annot[bp5]= "(";
+// //annot[bp5]= '(';
+// System.out.println(annot[bp5]);
+// //System.out.println("bp5 ="+bp5);
+// int bp3 = bp.pos3;
+//
+// annot[bp3]= ")";
+// System.out.println(annot[bp3]);
+// //System.out.println(annot.get(bp3));
+//
+// //String pos1 = annot.substring(bp5, bp5+1);
+// //String pos2 = annot.substring(bp3, bp3+1);
+// //ann[i] = new Annotation(pos1, "", ' ', 0f);
+// //ann[i+1] = new Annotation(pos2, "", ' ', 0f);
+// //System.out.println(pos1);
+//
+// //System.out.println("bp3 ="+bp3);
+// //ModeleBP newStyle = bp.createBPStyle(mb, part);
+// }
+// Annotation[] ann = new Annotation[annot.length+1];
+// for(int i=0;i<annot.length;i++)
+// {
+// if(annot[i]==null)
+// {
+// annot[i]=".";
+// }
+//
+// ann[i] = new Annotation(annot[i], "", ' ', 0f);
+// //System.out.print(annot[i]);
+// }
+//
+// AlignmentAnnotation toto = new AlignmentAnnotation("Secondary structure","",ann);
+// this.annotations.addElement(toto);
+
+ // Creating empty structure of suitable size
+// int[] str = new int[seq.size()];
+// for (int i=0;i<str.length;i++)
+// { str[i] = -1; }
+// Vector<RNAMLParser.BPTemp> allbpsTmp = rnaTmp.getStructure();
+// for (int i = 0; i < allbpsTmp.size(); i++) {
+// RNAMLParser.BPTemp bp = allbpsTmp.get(i);
+// //System.err.println("toto ="+bp);
+// int bp5 = bp.pos5;
+// //System.out.println("bp5 ="+bp5);
+// int bp3 = bp.pos3;
+ //System.out.println("bp3 ="+bp3);
+ //ModeleBP newStyle = bp.createBPStyle(mb, part);
+// }
+ //Annotation ann;
+ //ann = new Annotation(bp5, "", ' ', 0f);
+
+ //}
+
+
+
+// return result;
+
+}
+
+
+ public static String print(SequenceI[] s)
+ {
+ return "not yet implemented";
+ }
+
+ public String print()
+ {
+ System.out.print("affiche :");
+ return print(getSeqsAsArray());
+ }
+
+ /**
+ * make a friendly ID string.
+ *
+ * @param dataName
+ * @return truncated dataName to after last '/'
+ */
+ private String safeName(String dataName)
+ {
+ int b = 0;
+ while ((b = dataName.indexOf("/")) > -1 && b < dataName.length() )
+ {
+ dataName = dataName.substring(b + 1).trim();
+
+ }
+ int e = (dataName.length() - dataName.indexOf("."))+1;
+ dataName = dataName.substring(1,e).trim();
+ return dataName;
+ }
+
+ public ArrayList getRNA()
+ {
+ return result;
+ }
+
+ public Vector getAnnot()
+ {
+ return annotations;
+ }
+}
import java.io.*;
import java.util.*;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.xml.sax.SAXException;
+
+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.exceptions.ExceptionUnmatchedClosingParentheses;
+
import jalview.datamodel.*;
import jalview.util.*;
{
}
- public SimpleBlastFile(String inFile, String type) throws IOException
+ public SimpleBlastFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses
{
super(inFile, type);
}
- public SimpleBlastFile(FileParse source) throws IOException
+ public SimpleBlastFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses
{
super(source);
}
import java.io.*;\r
import java.util.*;\r
\r
+import javax.xml.parsers.ParserConfigurationException;\r
+\r
+import org.xml.sax.SAXException;\r
+\r
import com.stevesoft.pat.*;\r
+\r
+import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax;\r
+import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed;\r
+import fr.orsay.lri.varna.exceptions.ExceptionPermissionDenied;\r
+import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses;\r
+import fr.orsay.lri.varna.factories.RNAFactory;\r
+import fr.orsay.lri.varna.models.rna.RNA;\r
import jalview.datamodel.*;\r
import jalview.analysis.Rna;\r
\r
public class StockholmFile extends AlignFile\r
{\r
// static Logger logger = Logger.getLogger("jalview.io.StockholmFile");\r
-\r
+ protected ArrayList<RNA> result;\r
+ public String id;\r
+ \r
public StockholmFile()\r
{\r
}\r
\r
- public StockholmFile(String inFile, String type) throws IOException\r
+ public StockholmFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses\r
{\r
super(inFile, type);\r
}\r
\r
- public StockholmFile(FileParse source) throws IOException\r
+ public StockholmFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses\r
{\r
super(source);\r
}\r
* \r
* @throws IOException\r
* If there is an error with the input file\r
+ * @throws ExceptionUnmatchedClosingParentheses \r
*/\r
- public void parse() throws IOException\r
+ public void parse() throws IOException, ExceptionUnmatchedClosingParentheses\r
{\r
- StringBuffer treeString = new StringBuffer();\r
- String treeName = null;\r
- // --------------- Variable Definitions -------------------\r
- String line;\r
- String version;\r
- // String id;\r
- Hashtable seqAnn = new Hashtable(); // Sequence related annotations\r
- Hashtable seqs = new Hashtable();\r
- Regex p, r, rend, s, x;\r
-\r
- // Temporary line for processing RNA annotation\r
- // String RNAannot = "";\r
-\r
- // ------------------ Parsing File ----------------------\r
- // First, we have to check that this file has STOCKHOLM format, i.e. the\r
- // first line must match\r
- r = new Regex("# STOCKHOLM ([\\d\\.]+)");\r
- if (!r.search(nextLine()))\r
- {\r
- throw new IOException(\r
- "This file is not in valid STOCKHOLM format: First line does not contain '# STOCKHOLM'");\r
- }\r
- else\r
- {\r
- version = r.stringMatched(1);\r
- // logger.debug("Stockholm version: " + version);\r
- }\r
-\r
- // We define some Regexes here that will be used regularily later\r
- rend = new Regex("^\\s*\\/\\/"); // Find the end of an alignment\r
- p = new Regex("(\\S+)\\/(\\d+)\\-(\\d+)"); // split sequence id in\r
- // id/from/to\r
- s = new Regex("(\\S+)\\s+(\\S*)\\s+(.*)"); // Parses annotation subtype\r
- r = new Regex("#=(G[FSRC]?)\\s+(.*)"); // Finds any annotation line\r
- x = new Regex("(\\S+)\\s+(\\S+)"); // split id from sequence\r
-\r
- // Convert all bracket types to parentheses (necessary for passing to VARNA)\r
- Regex openparen = new Regex("(<|\\[)", "(");\r
- Regex closeparen = new Regex("(>|\\])", ")");\r
-\r
- // Detect if file is RNA by looking for bracket types\r
- Regex detectbrackets = new Regex("(<|>|\\[|\\]|\\(|\\))");\r
-\r
- rend.optimize();\r
- p.optimize();\r
- s.optimize();\r
- r.optimize();\r
- x.optimize();\r
- openparen.optimize();\r
- closeparen.optimize();\r
-\r
- while ((line = nextLine()) != null)\r
- {\r
- if (line.length() == 0)\r
- {\r
- continue;\r
- }\r
- if (rend.search(line))\r
- {\r
- // End of the alignment, pass stuff back\r
-\r
- this.noSeqs = seqs.size();\r
- // logger.debug("Number of sequences: " + this.noSeqs);\r
- Enumeration accs = seqs.keys();\r
- while (accs.hasMoreElements())\r
- {\r
- String acc = (String) accs.nextElement();\r
- // logger.debug("Processing sequence " + acc);\r
- String seq = (String) seqs.remove(acc);\r
- if (maxLength < seq.length())\r
- {\r
- maxLength = seq.length();\r
- }\r
- int start = 1;\r
- int end = -1;\r
- String sid = acc;\r
- /*\r
- * Retrieve hash of annotations for this accession\r
- * Associate Annotation with accession\r
- */\r
- Hashtable accAnnotations = null;\r
-\r
- if (seqAnn != null && seqAnn.containsKey(acc))\r
- {\r
- accAnnotations = (Hashtable) seqAnn.remove(acc);\r
- //TODO: add structures to sequence\r
- }\r
-\r
- // Split accession in id and from/to\r
- if (p.search(acc))\r
- {\r
- sid = p.stringMatched(1);\r
- start = Integer.parseInt(p.stringMatched(2));\r
- end = Integer.parseInt(p.stringMatched(3));\r
- }\r
- // logger.debug(sid + ", " + start + ", " + end);\r
-\r
- Sequence seqO = new Sequence(sid, seq, start, end);\r
- // Add Description (if any)\r
- if (accAnnotations != null && accAnnotations.containsKey("DE"))\r
- {\r
- String desc = (String) accAnnotations.get("DE");\r
- seqO.setDescription((desc == null) ? "" : desc);\r
- }\r
- // Add DB References (if any)\r
- if (accAnnotations != null && accAnnotations.containsKey("DR"))\r
- {\r
- String dbr = (String) accAnnotations.get("DR");\r
- if (dbr != null && dbr.indexOf(";") > -1)\r
- {\r
- String src = dbr.substring(0, dbr.indexOf(";"));\r
- String acn = dbr.substring(dbr.indexOf(";") + 1);\r
- jalview.util.DBRefUtils.parseToDbRef(seqO, src, "0", acn);\r
- // seqO.addDBRef(dbref);\r
- }\r
- } \r
- if (accAnnotations != null && accAnnotations.containsKey("SS"))\r
- {\r
- Vector v = (Vector) accAnnotations.get("SS");\r
- \r
- for (int i = 0; i < v.size(); i++)\r
- {\r
- AlignmentAnnotation an = (AlignmentAnnotation) v.elementAt(i);\r
- seqO.addAlignmentAnnotation(an);\r
- //annotations.add(an);\r
- }\r
- }\r
- \r
- Hashtable features = null;\r
- // We need to adjust the positions of all features to account for gaps\r
- try\r
- {\r
- features = (Hashtable) accAnnotations.remove("features");\r
- } catch (java.lang.NullPointerException e)\r
- {\r
- // loggerwarn("Getting Features for " + acc + ": " +\r
- // e.getMessage());\r
- // continue;\r
- }\r
- // if we have features\r
- if (features != null)\r
- {\r
- int posmap[] = seqO.findPositionMap();\r
- Enumeration i = features.keys();\r
- while (i.hasMoreElements())\r
- {\r
- // TODO: parse out secondary structure annotation as annotation\r
- // row\r
- // TODO: parse out scores as annotation row\r
- // TODO: map coding region to core jalview feature types\r
- String type = i.nextElement().toString();\r
- Hashtable content = (Hashtable) features.remove(type);\r
- Enumeration j = content.keys();\r
- while (j.hasMoreElements())\r
- {\r
- String desc = j.nextElement().toString();\r
- String ns = content.get(desc).toString();\r
- char[] byChar = ns.toCharArray();\r
- for (int k = 0; k < byChar.length; k++)\r
- {\r
- char c = byChar[k];\r
- if (!(c == ' ' || c == '_' || c == '-' || c == '.')) // PFAM\r
- // uses\r
- // '.'\r
- // for\r
- // feature\r
- // background\r
- {\r
- int new_pos = posmap[k]; // look up nearest seqeunce\r
- // position to this column\r
- SequenceFeature feat = new SequenceFeature(type, desc,\r
- new_pos, new_pos, 0f, null);\r
-\r
- seqO.addSequenceFeature(feat);\r
- }\r
- }\r
- }\r
-\r
- }\r
-\r
- }\r
- // garbage collect\r
-\r
- // logger.debug("Adding seq " + acc + " from " + start + " to " + end\r
- // + ": " + seq);\r
- this.seqs.addElement(seqO);\r
- }\r
- return; // finished parsing this segment of source\r
- }\r
- else if (!r.search(line))\r
- {\r
- // System.err.println("Found sequence line: " + line);\r
-\r
- // Split sequence in sequence and accession parts\r
- if (!x.search(line))\r
- {\r
- // logger.error("Could not parse sequence line: " + line);\r
- throw new IOException("Could not parse sequence line: " + line);\r
- }\r
- String ns = (String) seqs.get(x.stringMatched(1));\r
- if (ns == null)\r
- {\r
- ns = "";\r
- }\r
- ns += x.stringMatched(2);\r
-\r
- seqs.put(x.stringMatched(1), ns);\r
- }\r
- else\r
- {\r
- String annType = r.stringMatched(1);\r
- String annContent = r.stringMatched(2);\r
-\r
- // System.err.println("type:" + annType + " content: " + annContent);\r
-\r
- if (annType.equals("GF"))\r
- {\r
- /*\r
- * Generic per-File annotation, free text Magic features: #=GF NH\r
- * <tree in New Hampshire eXtended format> #=GF TN <Unique identifier\r
- * for the next tree> Pfam descriptions: 7. DESCRIPTION OF FIELDS\r
- * \r
- * Compulsory fields: ------------------\r
- * \r
- * AC Accession number: Accession number in form PFxxxxx.version or\r
- * PBxxxxxx. ID Identification: One word name for family. DE\r
- * Definition: Short description of family. AU Author: Authors of the\r
- * entry. SE Source of seed: The source suggesting the seed members\r
- * belong to one family. GA Gathering method: Search threshold to\r
- * build the full alignment. TC Trusted Cutoff: Lowest sequence score\r
- * and domain score of match in the full alignment. NC Noise Cutoff:\r
- * Highest sequence score and domain score of match not in full\r
- * alignment. TP Type: Type of family -- presently Family, Domain,\r
- * Motif or Repeat. SQ Sequence: Number of sequences in alignment. AM\r
- * Alignment Method The order ls and fs hits are aligned to the model\r
- * to build the full align. // End of alignment.\r
- * \r
- * Optional fields: ----------------\r
- * \r
- * DC Database Comment: Comment about database reference. DR Database\r
- * Reference: Reference to external database. RC Reference Comment:\r
- * Comment about literature reference. RN Reference Number: Reference\r
- * Number. RM Reference Medline: Eight digit medline UI number. RT\r
- * Reference Title: Reference Title. RA Reference Author: Reference\r
- * Author RL Reference Location: Journal location. PI Previous\r
- * identifier: Record of all previous ID lines. KW Keywords: Keywords.\r
- * CC Comment: Comments. NE Pfam accession: Indicates a nested domain.\r
- * NL Location: Location of nested domains - sequence ID, start and\r
- * end of insert.\r
- * \r
- * Obsolete fields: ----------- AL Alignment method of seed: The\r
- * method used to align the seed members.\r
- */\r
- // Let's save the annotations, maybe we'll be able to do something\r
- // with them later...\r
- Regex an = new Regex("(\\w+)\\s*(.*)");\r
- if (an.search(annContent))\r
- {\r
- if (an.stringMatched(1).equals("NH"))\r
- {\r
- treeString.append(an.stringMatched(2));\r
- }\r
- else if (an.stringMatched(1).equals("TN"))\r
- {\r
- if (treeString.length() > 0)\r
- {\r
- if (treeName == null)\r
- {\r
- treeName = "Tree " + (getTreeCount() + 1);\r
- }\r
- addNewickTree(treeName, treeString.toString());\r
- }\r
- treeName = an.stringMatched(2);\r
- treeString = new StringBuffer();\r
- }\r
- setAlignmentProperty(an.stringMatched(1), an.stringMatched(2));\r
- }\r
- }\r
- else if (annType.equals("GS"))\r
- {\r
- // Generic per-Sequence annotation, free text\r
- /*\r
- * Pfam uses these features: Feature Description ---------------------\r
- * ----------- AC <accession> ACcession number DE <freetext>\r
- * DEscription DR <db>; <accession>; Database Reference OS <organism>\r
- * OrganiSm (species) OC <clade> Organism Classification (clade, etc.)\r
- * LO <look> Look (Color, etc.)\r
- */\r
- if (s.search(annContent))\r
- {\r
- String acc = s.stringMatched(1);\r
- String type = s.stringMatched(2);\r
- String content = s.stringMatched(3);\r
- // TODO: store DR in a vector.\r
- // TODO: store AC according to generic file db annotation.\r
- Hashtable ann;\r
- if (seqAnn.containsKey(acc))\r
- {\r
- ann = (Hashtable) seqAnn.get(acc);\r
- }\r
- else\r
- {\r
- ann = new Hashtable();\r
- }\r
- ann.put(type, content);\r
- seqAnn.put(acc, ann);\r
- }\r
- else\r
- {\r
- throw new IOException("Error parsing " + line);\r
- }\r
- }\r
- else if (annType.equals("GC"))\r
- {\r
- // Generic per-Column annotation, exactly 1 char per column\r
- // always need a label.\r
- if (x.search(annContent))\r
- {\r
- // parse out and create alignment annotation directly.\r
- parseAnnotationRow(annotations, x.stringMatched(1),\r
- x.stringMatched(2));\r
- }\r
- }\r
- else if (annType.equals("GR"))\r
- {\r
- // Generic per-Sequence AND per-Column markup, exactly 1 char per\r
- // column\r
- /*\r
- * Feature Description Markup letters ------- -----------\r
- * -------------- SS Secondary Structure [HGIEBTSCX] SA Surface\r
- * Accessibility [0-9X] (0=0%-10%; ...; 9=90%-100%) TM TransMembrane\r
- * [Mio] PP Posterior Probability [0-9*] (0=0.00-0.05; 1=0.05-0.15;\r
- * *=0.95-1.00) LI LIgand binding [*] AS Active Site [*] IN INtron (in\r
- * or after) [0-2]\r
- */\r
- if (s.search(annContent))\r
- {\r
- String acc = s.stringMatched(1);\r
- String type = s.stringMatched(2);\r
- String seq = new String(s.stringMatched(3));\r
- String description = null;\r
- // Check for additional information about the current annotation\r
- // We use a simple string tokenizer here for speed\r
- StringTokenizer sep = new StringTokenizer(seq, " \t");\r
- description = sep.nextToken();\r
- if (sep.hasMoreTokens())\r
- {\r
- seq = sep.nextToken();\r
- }\r
- else\r
- {\r
- seq = description;\r
- description = new String();\r
- }\r
- // sequence id with from-to fields\r
-\r
- Hashtable ann;\r
- // Get an object with all the annotations for this sequence\r
- if (seqAnn.containsKey(acc))\r
- {\r
- // logger.debug("Found annotations for " + acc);\r
- ann = (Hashtable) seqAnn.get(acc);\r
- }\r
- else\r
- {\r
- // logger.debug("Creating new annotations holder for " + acc);\r
- ann = new Hashtable();\r
- seqAnn.put(acc, ann);\r
- }\r
- //TODO test structure, call parseAnnotationRow with vector from hashtable for specific sequence\r
- Hashtable features;\r
- // Get an object with all the content for an annotation\r
- if (ann.containsKey("features"))\r
- {\r
- // logger.debug("Found features for " + acc);\r
- features = (Hashtable) ann.get("features");\r
- }\r
- else\r
- {\r
- // logger.debug("Creating new features holder for " + acc);\r
- features = new Hashtable();\r
- ann.put("features", features);\r
- }\r
-\r
- Hashtable content;\r
- if (features.containsKey(this.id2type(type)))\r
- {\r
- // logger.debug("Found content for " + this.id2type(type));\r
- content = (Hashtable) features.get(this.id2type(type));\r
- }\r
- else\r
- {\r
- // logger.debug("Creating new content holder for " +\r
- // this.id2type(type));\r
- content = new Hashtable();\r
- features.put(this.id2type(type), content);\r
- }\r
- String ns = (String) content.get(description);\r
- if (ns == null)\r
- {\r
- ns = "";\r
- }\r
- ns += seq;\r
- content.put(description, ns);\r
-
- if(type.equals("SS")){\r
- Hashtable strucAnn;\r
- if (seqAnn.containsKey(acc))\r
- {\r
- strucAnn = (Hashtable) seqAnn.get(acc);\r
- }\r
- else\r
- {\r
- strucAnn = new Hashtable();\r
- }\r
- \r
- Vector newStruc=new Vector();\r
- parseAnnotationRow(newStruc, type,ns);\r
- \r
- strucAnn.put(type, newStruc);\r
- seqAnn.put(acc, strucAnn);\r
- }\r
- }\r
- else\r
- {\r
- System.err\r
- .println("Warning - couldn't parse sequence annotation row line:\n"\r
- + line);\r
- // throw new IOException("Error parsing " + line);\r
- }\r
- }\r
- else\r
- {\r
- throw new IOException("Unknown annotation detected: " + annType\r
- + " " + annContent);\r
- }\r
- }\r
- }\r
- if (treeString.length() > 0)\r
- {\r
- if (treeName == null)\r
- {\r
- treeName = "Tree " + (1 + getTreeCount());\r
- }\r
- addNewickTree(treeName, treeString.toString());\r
- }\r
+ FileReader fr = null;\r
+ fr = new FileReader(inFile); \r
+\r
+ BufferedReader r = new BufferedReader (fr);\r
+ result = RNAFactory.loadSecStrStockholm(r);\r
+ System.out.println("this is the secondary scructure:" +result.size());\r
+ SequenceI[] seqs = new SequenceI[result.size()];\r
+ System.out.println(type); //the type is "File"\r
+ System.out.println(inFile );//inFile is the path\r
+ for(int i=0;i<result.size();i++)\r
+ {\r
+ RNA current = result.get(i);\r
+ \r
+ System.out.println(current.getSeq());\r
+ //System.out.println(result.get(i).getStructBPSEQ());\r
+ System.out.println(result.get(i).getStructDBN(true));\r
+ System.out.println(i);\r
+ String rna =current.getStructDBN(true);\r
+ String seq = current.getSeq();\r
+ int begin=0;\r
+ int end = seq.length()-1;\r
+ id = safeName(getDataName());\r
+ seqs[i] = new Sequence(id, seq, begin, end);\r
+ String[] annot=new String[rna.length()] ;\r
+ Annotation[] ann = new Annotation[rna.length()];\r
+ for(int j=0;j<rna.length();j++)\r
+ {\r
+ annot[j] =rna.substring(j,j+1);\r
+ \r
+ }\r
+ \r
+ for(int k=0;k<rna.length();k++)\r
+ {\r
+ ann[k] = new Annotation(annot[k], "", jalview.schemes.ResidueProperties.getRNASecStrucState(annot[k]).charAt(0), 0f);\r
+ \r
+ }\r
+ AlignmentAnnotation align = new AlignmentAnnotation("Sec. str.",current.getID(),ann);\r
+ \r
+ seqs[i].addAlignmentAnnotation(align);\r
+ seqs[i].setRNA(result.get(i));\r
+ this.annotations.addElement(align);\r
+ }\r
+ this.setSeqs(seqs);\r
+ \r
}\r
-\r
+// r = new Regex("# STOCKHOLM ([\\d\\.]+)");\r
+ // if (!r.search(nextLine()))\r
+// {\r
+// throw new IOException(\r
+// "This file is not in valid STOCKHOLM format: First line does not contain '# STOCKHOLM'");\r
+// }\r
+// else\r
+// {\r
+// version = r.stringMatched(1);\r
+// // logger.debug("Stockholm version: " + version);\r
+// }\r
+//\r
+// // We define some Regexes here that will be used regularily later\r
+// rend = new Regex("^\\s*\\/\\/"); // Find the end of an alignment\r
+// p = new Regex("(\\S+)\\/(\\d+)\\-(\\d+)"); // split sequence id in\r
+// // id/from/to\r
+// s = new Regex("(\\S+)\\s+(\\S*)\\s+(.*)"); // Parses annotation subtype\r
+// r = new Regex("#=(G[FSRC]?)\\s+(.*)"); // Finds any annotation line\r
+// x = new Regex("(\\S+)\\s+(\\S+)"); // split id from sequence\r
+//\r
+// // Convert all bracket types to parentheses (necessary for passing to VARNA)\r
+// Regex openparen = new Regex("(<|\\[)", "(");\r
+// Regex closeparen = new Regex("(>|\\])", ")");\r
+//\r
+// // Detect if file is RNA by looking for bracket types\r
+// Regex detectbrackets = new Regex("(<|>|\\[|\\]|\\(|\\))");\r
+//\r
+// rend.optimize();\r
+// p.optimize();\r
+// s.optimize();\r
+// r.optimize();\r
+// x.optimize();\r
+// openparen.optimize();\r
+// closeparen.optimize();\r
+//\r
+// while ((line = nextLine()) != null)\r
+// {\r
+// if (line.length() == 0)\r
+// {\r
+// continue;\r
+// }\r
+// if (rend.search(line))\r
+// {\r
+// // End of the alignment, pass stuff back\r
+//\r
+// this.noSeqs = seqs.size();\r
+// // logger.debug("Number of sequences: " + this.noSeqs);\r
+// Enumeration accs = seqs.keys();\r
+// while (accs.hasMoreElements())\r
+// {\r
+// String acc = (String) accs.nextElement();\r
+// // logger.debug("Processing sequence " + acc);\r
+// String seq = (String) seqs.remove(acc);\r
+// if (maxLength < seq.length())\r
+// {\r
+// maxLength = seq.length();\r
+// }\r
+// int start = 1;\r
+// int end = -1;\r
+// String sid = acc;\r
+// /*\r
+// * Retrieve hash of annotations for this accession\r
+// * Associate Annotation with accession\r
+// */\r
+// Hashtable accAnnotations = null;\r
+//\r
+// if (seqAnn != null && seqAnn.containsKey(acc))\r
+// {\r
+// accAnnotations = (Hashtable) seqAnn.remove(acc);\r
+// //TODO: add structures to sequence\r
+// }\r
+//\r
+// // Split accession in id and from/to\r
+// if (p.search(acc))\r
+// {\r
+// sid = p.stringMatched(1);\r
+// start = Integer.parseInt(p.stringMatched(2));\r
+// end = Integer.parseInt(p.stringMatched(3));\r
+// }\r
+// // logger.debug(sid + ", " + start + ", " + end);\r
+//\r
+// Sequence seqO = new Sequence(sid, seq, start, end);\r
+// // Add Description (if any)\r
+// if (accAnnotations != null && accAnnotations.containsKey("DE"))\r
+// {\r
+// String desc = (String) accAnnotations.get("DE");\r
+// seqO.setDescription((desc == null) ? "" : desc);\r
+// }\r
+// // Add DB References (if any)\r
+// if (accAnnotations != null && accAnnotations.containsKey("DR"))\r
+// {\r
+// String dbr = (String) accAnnotations.get("DR");\r
+// if (dbr != null && dbr.indexOf(";") > -1)\r
+// {\r
+// String src = dbr.substring(0, dbr.indexOf(";"));\r
+// String acn = dbr.substring(dbr.indexOf(";") + 1);\r
+// jalview.util.DBRefUtils.parseToDbRef(seqO, src, "0", acn);\r
+// // seqO.addDBRef(dbref);\r
+// }\r
+// } \r
+// if (accAnnotations != null && accAnnotations.containsKey("SS"))\r
+// {\r
+// Vector v = (Vector) accAnnotations.get("SS");\r
+// \r
+// for (int i = 0; i < v.size(); i++)\r
+// {\r
+// AlignmentAnnotation an = (AlignmentAnnotation) v.elementAt(i);\r
+// seqO.addAlignmentAnnotation(an);\r
+// //annotations.add(an);\r
+// }\r
+// }\r
+// \r
+// Hashtable features = null;\r
+// // We need to adjust the positions of all features to account for gaps\r
+// try\r
+// {\r
+// features = (Hashtable) accAnnotations.remove("features");\r
+// } catch (java.lang.NullPointerException e)\r
+// {\r
+// // loggerwarn("Getting Features for " + acc + ": " +\r
+// // e.getMessage());\r
+// // continue;\r
+// }\r
+// // if we have features\r
+// if (features != null)\r
+// {\r
+// int posmap[] = seqO.findPositionMap();\r
+// Enumeration i = features.keys();\r
+// while (i.hasMoreElements())\r
+// {\r
+// // TODO: parse out secondary structure annotation as annotation\r
+// // row\r
+// // TODO: parse out scores as annotation row\r
+// // TODO: map coding region to core jalview feature types\r
+// String type = i.nextElement().toString();\r
+// Hashtable content = (Hashtable) features.remove(type);\r
+// Enumeration j = content.keys();\r
+// while (j.hasMoreElements())\r
+// {\r
+// String desc = j.nextElement().toString();\r
+// String ns = content.get(desc).toString();\r
+// char[] byChar = ns.toCharArray();\r
+// for (int k = 0; k < byChar.length; k++)\r
+// {\r
+// char c = byChar[k];\r
+// if (!(c == ' ' || c == '_' || c == '-' || c == '.')) // PFAM\r
+// // uses\r
+// // '.'\r
+// // for\r
+// // feature\r
+// // background\r
+// {\r
+// int new_pos = posmap[k]; // look up nearest seqeunce\r
+// // position to this column\r
+// SequenceFeature feat = new SequenceFeature(type, desc,\r
+// new_pos, new_pos, 0f, null);\r
+//\r
+// seqO.addSequenceFeature(feat);\r
+// }\r
+// }\r
+// }\r
+//\r
+// }\r
+//\r
+// }\r
+// // garbage collect\r
+//\r
+// // logger.debug("Adding seq " + acc + " from " + start + " to " + end\r
+// // + ": " + seq);\r
+// this.seqs.addElement(seqO);\r
+// }\r
+// return; // finished parsing this segment of source\r
+// }\r
+// else if (!r.search(line))\r
+// {\r
+// // System.err.println("Found sequence line: " + line);\r
+//\r
+// // Split sequence in sequence and accession parts\r
+// if (!x.search(line))\r
+// {\r
+// // logger.error("Could not parse sequence line: " + line);\r
+// throw new IOException("Could not parse sequence line: " + line);\r
+// }\r
+// String ns = (String) seqs.get(x.stringMatched(1));\r
+// if (ns == null)\r
+// {\r
+// ns = "";\r
+// }\r
+// ns += x.stringMatched(2);\r
+//\r
+// seqs.put(x.stringMatched(1), ns);\r
+// }\r
+// else\r
+// {\r
+// String annType = r.stringMatched(1);\r
+// String annContent = r.stringMatched(2);\r
+//\r
+// // System.err.println("type:" + annType + " content: " + annContent);\r
+//\r
+// if (annType.equals("GF"))\r
+// {\r
+// /*\r
+// * Generic per-File annotation, free text Magic features: #=GF NH\r
+// * <tree in New Hampshire eXtended format> #=GF TN <Unique identifier\r
+// * for the next tree> Pfam descriptions: 7. DESCRIPTION OF FIELDS\r
+// * \r
+// * Compulsory fields: ------------------\r
+// * \r
+// * AC Accession number: Accession number in form PFxxxxx.version or\r
+// * PBxxxxxx. ID Identification: One word name for family. DE\r
+// * Definition: Short description of family. AU Author: Authors of the\r
+// * entry. SE Source of seed: The source suggesting the seed members\r
+// * belong to one family. GA Gathering method: Search threshold to\r
+// * build the full alignment. TC Trusted Cutoff: Lowest sequence score\r
+// * and domain score of match in the full alignment. NC Noise Cutoff:\r
+// * Highest sequence score and domain score of match not in full\r
+// * alignment. TP Type: Type of family -- presently Family, Domain,\r
+// * Motif or Repeat. SQ Sequence: Number of sequences in alignment. AM\r
+// * Alignment Method The order ls and fs hits are aligned to the model\r
+// * to build the full align. // End of alignment.\r
+// * \r
+// * Optional fields: ----------------\r
+// * \r
+// * DC Database Comment: Comment about database reference. DR Database\r
+// * Reference: Reference to external database. RC Reference Comment:\r
+// * Comment about literature reference. RN Reference Number: Reference\r
+// * Number. RM Reference Medline: Eight digit medline UI number. RT\r
+// * Reference Title: Reference Title. RA Reference Author: Reference\r
+// * Author RL Reference Location: Journal location. PI Previous\r
+// * identifier: Record of all previous ID lines. KW Keywords: Keywords.\r
+// * CC Comment: Comments. NE Pfam accession: Indicates a nested domain.\r
+// * NL Location: Location of nested domains - sequence ID, start and\r
+// * end of insert.\r
+// * \r
+// * Obsolete fields: ----------- AL Alignment method of seed: The\r
+// * method used to align the seed members.\r
+// */\r
+// // Let's save the annotations, maybe we'll be able to do something\r
+// // with them later...\r
+// Regex an = new Regex("(\\w+)\\s*(.*)");\r
+// if (an.search(annContent))\r
+// {\r
+// if (an.stringMatched(1).equals("NH"))\r
+// {\r
+// treeString.append(an.stringMatched(2));\r
+// }\r
+// else if (an.stringMatched(1).equals("TN"))\r
+// {\r
+// if (treeString.length() > 0)\r
+// {\r
+// if (treeName == null)\r
+// {\r
+// treeName = "Tree " + (getTreeCount() + 1);\r
+// }\r
+// addNewickTree(treeName, treeString.toString());\r
+// }\r
+// treeName = an.stringMatched(2);\r
+// treeString = new StringBuffer();\r
+// }\r
+// setAlignmentProperty(an.stringMatched(1), an.stringMatched(2));\r
+// }\r
+// }\r
+// else if (annType.equals("GS"))\r
+// {\r
+// // Generic per-Sequence annotation, free text\r
+// /*\r
+// * Pfam uses these features: Feature Description ---------------------\r
+// * ----------- AC <accession> ACcession number DE <freetext>\r
+// * DEscription DR <db>; <accession>; Database Reference OS <organism>\r
+// * OrganiSm (species) OC <clade> Organism Classification (clade, etc.)\r
+// * LO <look> Look (Color, etc.)\r
+// */\r
+// if (s.search(annContent))\r
+// {\r
+// String acc = s.stringMatched(1);\r
+// String type = s.stringMatched(2);\r
+// String content = s.stringMatched(3);\r
+// // TODO: store DR in a vector.\r
+// // TODO: store AC according to generic file db annotation.\r
+// Hashtable ann;\r
+// if (seqAnn.containsKey(acc))\r
+// {\r
+// ann = (Hashtable) seqAnn.get(acc);\r
+// }\r
+// else\r
+// {\r
+// ann = new Hashtable();\r
+// }\r
+// ann.put(type, content);\r
+// seqAnn.put(acc, ann);\r
+// }\r
+// else\r
+// {\r
+// throw new IOException("Error parsing " + line);\r
+// }\r
+// }\r
+// else if (annType.equals("GC"))\r
+// {\r
+// // Generic per-Column annotation, exactly 1 char per column\r
+// // always need a label.\r
+// if (x.search(annContent))\r
+// {\r
+// // parse out and create alignment annotation directly.\r
+// parseAnnotationRow(annotations, x.stringMatched(1),\r
+// x.stringMatched(2));\r
+// }\r
+// }\r
+// else if (annType.equals("GR"))\r
+// {\r
+// // Generic per-Sequence AND per-Column markup, exactly 1 char per\r
+// // column\r
+// /*\r
+// * Feature Description Markup letters ------- -----------\r
+// * -------------- SS Secondary Structure [HGIEBTSCX] SA Surface\r
+// * Accessibility [0-9X] (0=0%-10%; ...; 9=90%-100%) TM TransMembrane\r
+// * [Mio] PP Posterior Probability [0-9*] (0=0.00-0.05; 1=0.05-0.15;\r
+// * *=0.95-1.00) LI LIgand binding [*] AS Active Site [*] IN INtron (in\r
+// * or after) [0-2]\r
+// */\r
+// if (s.search(annContent))\r
+// {\r
+// String acc = s.stringMatched(1);\r
+// String type = s.stringMatched(2);\r
+// String seq = new String(s.stringMatched(3));\r
+// String description = null;\r
+// // Check for additional information about the current annotation\r
+// // We use a simple string tokenizer here for speed\r
+// StringTokenizer sep = new StringTokenizer(seq, " \t");\r
+// description = sep.nextToken();\r
+// if (sep.hasMoreTokens())\r
+// {\r
+// seq = sep.nextToken();\r
+// }\r
+// else\r
+// {\r
+// seq = description;\r
+// description = new String();\r
+// }\r
+// // sequence id with from-to fields\r
+//\r
+// Hashtable ann;\r
+// // Get an object with all the annotations for this sequence\r
+// if (seqAnn.containsKey(acc))\r
+// {\r
+// // logger.debug("Found annotations for " + acc);\r
+// ann = (Hashtable) seqAnn.get(acc);\r
+// }\r
+// else\r
+// {\r
+// // logger.debug("Creating new annotations holder for " + acc);\r
+// ann = new Hashtable();\r
+// seqAnn.put(acc, ann);\r
+// }\r
+// //TODO test structure, call parseAnnotationRow with vector from hashtable for specific sequence\r
+// Hashtable features;\r
+// // Get an object with all the content for an annotation\r
+// if (ann.containsKey("features"))\r
+// {\r
+// // logger.debug("Found features for " + acc);\r
+// features = (Hashtable) ann.get("features");\r
+// }\r
+// else\r
+// {\r
+// // logger.debug("Creating new features holder for " + acc);\r
+// features = new Hashtable();\r
+// ann.put("features", features);\r
+// }\r
+//\r
+// Hashtable content;\r
+// if (features.containsKey(this.id2type(type)))\r
+// {\r
+// // logger.debug("Found content for " + this.id2type(type));\r
+// content = (Hashtable) features.get(this.id2type(type));\r
+// }\r
+// else\r
+// {\r
+// // logger.debug("Creating new content holder for " +\r
+// // this.id2type(type));\r
+// content = new Hashtable();\r
+// features.put(this.id2type(type), content);\r
+// }\r
+// String ns = (String) content.get(description);\r
+// if (ns == null)\r
+// {\r
+// ns = "";\r
+// }\r
+// ns += seq;\r
+// content.put(description, ns);\r
+//
+// if(type.equals("SS")){\r
+// Hashtable strucAnn;\r
+// if (seqAnn.containsKey(acc))\r
+// {\r
+// strucAnn = (Hashtable) seqAnn.get(acc);\r
+// }\r
+// else\r
+// {\r
+// strucAnn = new Hashtable();\r
+// }\r
+// \r
+// Vector newStruc=new Vector();\r
+// parseAnnotationRow(newStruc, type,ns);\r
+// \r
+// strucAnn.put(type, newStruc);\r
+// seqAnn.put(acc, strucAnn);\r
+// }\r
+// }\r
+// else\r
+// {\r
+// System.err\r
+// .println("Warning - couldn't parse sequence annotation row line:\n"\r
+// + line);\r
+// // throw new IOException("Error parsing " + line);\r
+// }\r
+// }\r
+// else\r
+// {\r
+// throw new IOException("Unknown annotation detected: " + annType\r
+// + " " + annContent);\r
+// }\r
+// }\r
+// }\r
+// if (treeString.length() > 0)\r
+// {\r
+// if (treeName == null)\r
+// {\r
+// treeName = "Tree " + (1 + getTreeCount());\r
+// }\r
+// addNewickTree(treeName, treeString.toString());\r
+// }\r
+// }\r
+//\r
protected static AlignmentAnnotation parseAnnotationRow(Vector annotation,\r
String label, String annots)\r
{\r
Regex openparen = new Regex("(<|\\[)", "(");\r
Regex closeparen = new Regex("(>|\\])", ")");\r
\r
- // Detect if file is RNA by looking for bracket types\r
+ // Detect if file is RNA by looking for bracket types\r
Regex detectbrackets = new Regex("(<|>|\\[|\\]|\\(|\\))");\r
\r
convert1 = openparen.replaceAll(annots);\r
if (detectbrackets.search(pos))\r
{\r
ann.secondaryStructure = jalview.schemes.ResidueProperties\r
- .getRNASecStrucState(pos).charAt(0);\r
+ .getRNASecStrucState(pos).charAt(0);\r
}\r
else\r
{\r
ann.displayCharacter = ""; // null; // " ";\r
}\r
else\r
- {\r
+ {\r
ann.displayCharacter = " " + ann.displayCharacter;\r
}\r
}\r
\r
els[i] = ann;\r
}\r
- AlignmentAnnotation annot = null;\r
+ AlignmentAnnotation annot = null;\r
Enumeration e = annotation.elements();\r
while (e.hasMoreElements())\r
{\r
annotation.addElement(annot);\r
}\r
else\r
- {\r
+ {\r
Annotation[] anns = new Annotation[annot.annotations.length\r
+ els.length];\r
- System.arraycopy(annot.annotations, 0, anns, 0,\r
- annot.annotations.length);\r
+ System.arraycopy(annot.annotations, 0, anns, 0,\r
+ annot.annotations.length);\r
System.arraycopy(els, 0, anns, annot.annotations.length, els.length);\r
annot.annotations = anns;\r
//System.out.println("else: ");\r
- }\r
- return annot;\r
+ }\r
+ return annot;\r
}\r
\r
public static String print(SequenceI[] s)\r
* \r
* \r
* return helicesAnnot; }\r
+ * \r
*/\r
+ /**\r
+ * make a friendly ID string.\r
+ * \r
+ * @param dataName\r
+ * @return truncated dataName to after last '/'\r
+ */\r
+ private String safeName(String dataName)\r
+ {\r
+ int b = 0;\r
+ while ((b = dataName.indexOf("/")) > -1 && b < dataName.length() )\r
+ { \r
+ dataName = dataName.substring(b + 1).trim();\r
+ \r
+ }\r
+ int e = (dataName.length() - dataName.indexOf("."))+1;\r
+ dataName = dataName.substring(1,e).trim();\r
+ return dataName;\r
+ }\r
}\r
import java.util.List;
import java.util.Map;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.xml.sax.SAXException;
+
+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.exceptions.ExceptionUnmatchedClosingParentheses;
+
/**
* A file parse for T-Coffee score ascii format. This file contains the alignment consensus
* for each resude in any sequence.
*/
public class TCoffeeScoreFile extends AlignFile {
- public TCoffeeScoreFile(String inFile, String type) throws IOException
+ public TCoffeeScoreFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses
{
super(inFile, type);
}
- public TCoffeeScoreFile(FileParse source) throws IOException
+ public TCoffeeScoreFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses
{
super(source);
}
protected JRadioButtonMenuItem nucleotideColour = new JRadioButtonMenuItem();
protected JRadioButtonMenuItem purinePyrimidineColour = new JRadioButtonMenuItem();
+
+ protected JRadioButtonMenuItem RNAInteractionColour = new JRadioButtonMenuItem();
// protected JRadioButtonMenuItem covariationColour = new
// JRadioButtonMenuItem();
colours.add(purinePyrimidineColour);
// colours.add(covariationColour);
colours.add(tcoffeeColour);
-
+ colours.add(RNAInteractionColour);
setColourSelected(jalview.bin.Cache
.getDefault("DEFAULT_COLOUR", "None"));
purinePyrimidineColour.setSelected(true);
break;
+
+ case ColourSchemeProperty.RNAINTERACTION:
+ RNAInteractionColour.setSelected(true);
+
+ break;
/*
* case ColourSchemeProperty.COVARIATION:
* covariationColour.setSelected(true);
});
this.getContentPane().setLayout(borderLayout1);
alignFrameMenuBar.setFont(new java.awt.Font("Verdana", 0, 11));
+ alignFrameMenuBar.setBackground(Color.lightGray);
statusBar.setBackground(Color.white);
statusBar.setFont(new java.awt.Font("Verdana", 0, 11));
statusBar.setBorder(BorderFactory.createLineBorder(Color.black));
});
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() {
colourMenu.add(buriedColour);
colourMenu.add(nucleotideColour);
colourMenu.add(purinePyrimidineColour);
+ colourMenu.add(RNAInteractionColour);
// colourMenu.add(covariationColour);
colourMenu.add(tcoffeeColour);
colourMenu.add(userDefinedColour);
colourMenu.add(abovePIDThreshold);
colourMenu.add(modifyPID);
colourMenu.add(annotationColour);
- colourMenu.add(rnahelicesColour);
+ colourMenu.add(rnahelicesColour);
calculateMenu.add(sort);
calculateMenu.add(calculateTree);
calculateMenu.addSeparator();
protected void purinePyrimidineColour_actionPerformed(ActionEvent e)
{
}
+
+ protected void RNAInteractionColour_actionPerformed(ActionEvent e)
+ {
+ }
+
/*
* protected void covariationColour_actionPerformed(ActionEvent e) { }
*/
private void jbInit() throws Exception
{
+
FileMenu.setText("File");
HelpMenu.setText("Help");
VamsasMenu.setText("Vamsas");
desktopMenubar.add(VamsasMenu);
desktopMenubar.add(HelpMenu);
desktopMenubar.add(windowMenu);
+ desktopMenubar.setBackground(Color.lightGray);
FileMenu.add(inputMenu);
FileMenu.add(inputSequence);
FileMenu.addSeparator();
+
package jalview.renderer;
import jalview.analysis.AAFrequency;
int lastSSX, int x, int y, int iconOffset, int startRes,
int column, boolean validRes, boolean validEnd)
{
+
g.setColor(STEM_COLOUR);
int sCol = (lastSSX / charWidth) + startRes;
int x1 = lastSSX;
// If a closing base pair half of the stem, display a backward arrow
if (column > 0 && closeparen.search(dc))
{
+
if (diffupstream)
// if (validRes && column>1 && row_annotations[column-2]!=null &&
// dc.equals(row_annotations[column-2].displayCharacter))
}
else
{
+
// display a forward arrow
if (diffdownstream)
{
*/
private int imgWidth;
+
+ public void drawNotCanonicalAnnot(Graphics g, Color nonCanColor, Annotation[] row_annotations,
+ int lastSSX, int x, int y, int iconOffset, int startRes,
+ int column, boolean validRes, boolean validEnd)
+ {
+ //System.out.println(nonCanColor);
+
+ g.setColor(nonCanColor);
+ int sCol = (lastSSX / charWidth) + startRes;
+ int x1 = lastSSX;
+ int x2 = (x * charWidth);
+ Regex closeparen = new Regex("}|]|<|a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z");
+
+ String dc = (column == 0 || row_annotations[column - 1] == null) ? ""
+ : row_annotations[column - 1].displayCharacter;
+
+ boolean diffupstream = sCol == 0 || row_annotations[sCol - 1] == null
+ || !dc.equals(row_annotations[sCol - 1].displayCharacter);
+ boolean diffdownstream = !validRes || !validEnd
+ || row_annotations[column] == null
+ || !dc.equals(row_annotations[column].displayCharacter);
+ // System.out.println("Column "+column+" diff up: "+diffupstream+" down:"+diffdownstream);
+ // If a closing base pair half of the stem, display a backward arrow
+ if (column > 0 && closeparen.search(dc))// closeletter_b.search(dc)||closeletter_c.search(dc)||closeletter_d.search(dc)||closecrochet.search(dc)) )
+ {
+
+ if (diffupstream)
+ // if (validRes && column>1 && row_annotations[column-2]!=null &&
+ // dc.equals(row_annotations[column-2].displayCharacter))
+ {
+ g.fillPolygon(new int[]
+ { lastSSX + 5, lastSSX + 5, lastSSX }, new int[]
+ { y + iconOffset, y + 14 + iconOffset, y + 8 + iconOffset }, 3);
+ x1 += 5;
+ }
+ if (diffdownstream)
+ {
+ x2 -= 1;
+ }
+ }
+ else
+ {
+
+ // display a forward arrow
+ if (diffdownstream)
+ {
+ g.fillPolygon(new int[]
+ { x2 - 5, x2 - 5, x2 }, new int[]
+ { y + iconOffset, y + 14 + iconOffset, y + 8 + iconOffset }, 3);
+ x2 -= 5;
+ }
+ if (diffupstream)
+ {
+ x1 += 1;
+ }
+ }
+ // draw arrow body
+ g.fillRect(x1, y + 4 + iconOffset, x2 - x1, 7);
+ }
// public void updateFromAnnotationPanel(FontMetrics annotFM, AlignViewportI
// av)
public void updateFromAwtRenderPanel(AwtRenderPanelI annotPanel,
.equals(row_annotations[column - 1].displayCharacter) || (row_annotations[column].displayCharacter
.length() < 2 && row_annotations[column].secondaryStructure == ' ')))
{
- g.drawString(row_annotations[column].displayCharacter, x
+ g.drawString(row_annotations[column].displayCharacter
+ , x
* charWidth + charOffset, y + iconOffset);
}
g.setFont(ofont);
if (row.hasIcons)
{
char ss = validRes ? row_annotations[column].secondaryStructure
- : ' ';
- if (ss == 'S')
+ : '-';
+
+ if (ss == '(')
{
// distinguish between forward/backward base-pairing
if (row_annotations[column].displayCharacter.indexOf(')') > -1)
{
- ss = 's';
+
+ ss = ')';
+
}
}
+ if (ss == '[')
+ {
+ if ((row_annotations[column].displayCharacter.indexOf(']') > -1))
+ {
+ ss = ']';
+
+
+ }
+ }
+ if (ss == '{')
+ {
+ // distinguish between forward/backward base-pairing
+ if (row_annotations[column].displayCharacter.indexOf('}') > -1)
+ {
+ ss = '}';
+
+
+ }
+ }
+ if (ss == '<')
+ {
+ // distinguish between forward/backward base-pairing
+ if (row_annotations[column].displayCharacter.indexOf('<') > -1)
+ {
+ ss = '>';
+
+
+ }
+ }
+ if (ss == 'A')
+ {
+ // distinguish between forward/backward base-pairing
+ if (row_annotations[column].displayCharacter.indexOf('a') > -1)
+ {
+ ss = 'a';
+
+
+ }
+ }
+
+ if (ss == 'B')
+ {
+ // distinguish between forward/backward base-pairing
+ if (row_annotations[column].displayCharacter.indexOf('b') > -1)
+ {
+ ss = 'b';
+
+ }
+ }
+
+ if (ss == 'C')
+ {
+ // distinguish between forward/backward base-pairing
+ if (row_annotations[column].displayCharacter.indexOf('c') > -1)
+ {
+ ss = 'c';
+
+ }
+ }
+ if (ss == 'D')
+ {
+ // distinguish between forward/backward base-pairing
+ if (row_annotations[column].displayCharacter.indexOf('d') > -1)
+ {
+ ss = 'd';
+
+ }
+ }
+ if (ss == '1')
+ {
+ // distinguish between forward/backward base-pairing
+ if (row_annotations[column].displayCharacter.indexOf('e') > -1)
+ {
+ ss = 'e';
+
+ }
+ }
+ if (ss == 'F')
+ {
+ // distinguish between forward/backward base-pairing
+ if (row_annotations[column].displayCharacter.indexOf('f') > -1)
+ {
+ ss = 'f';
+
+ }
+ }
+ if (ss == 'G')
+ {
+ // distinguish between forward/backward base-pairing
+ if (row_annotations[column].displayCharacter.indexOf('g') > -1)
+ {
+ ss = 'g';
+
+ }
+ }
+ if (ss == '2')
+ {
+ // distinguish between forward/backward base-pairing
+ if (row_annotations[column].displayCharacter.indexOf('h') > -1)
+ {
+ ss = 'h';
+
+ }
+ }
+ if (ss == 'I')
+ {
+ // distinguish between forward/backward base-pairing
+ if (row_annotations[column].displayCharacter.indexOf('i') > -1)
+ {
+ ss = 'i';
+
+ }
+ }
+ if (ss == 'J')
+ {
+ // distinguish between forward/backward base-pairing
+ if (row_annotations[column].displayCharacter.indexOf('j') > -1)
+ {
+ ss = 'j';
+
+ }
+ }
+ if (ss == 'K')
+ {
+ // distinguish between forward/backward base-pairing
+ if (row_annotations[column].displayCharacter.indexOf('k') > -1)
+ {
+ ss = 'k';
+
+ }
+ }
+ if (ss == 'L')
+ {
+ // distinguish between forward/backward base-pairing
+ if (row_annotations[column].displayCharacter.indexOf('l') > -1)
+ {
+ ss = 'l';
+
+ }
+ }
+ if (ss == 'M')
+ {
+ // distinguish between forward/backward base-pairing
+ if (row_annotations[column].displayCharacter.indexOf('m') > -1)
+ {
+ ss = 'm';
+
+ }
+ }
+ if (ss == 'N')
+ {
+ // distinguish between forward/backward base-pairing
+ if (row_annotations[column].displayCharacter.indexOf('n') > -1)
+ {
+ ss = 'n';
+
+ }
+ }
+ if (ss == 'O')
+ {
+ // distinguish between forward/backward base-pairing
+ if (row_annotations[column].displayCharacter.indexOf('o') > -1)
+ {
+ ss = 'o';
+
+ }
+ }
+ if (ss == 'P')
+ {
+ // distinguish between forward/backward base-pairing
+ if (row_annotations[column].displayCharacter.indexOf('p') > -1)
+ {
+ ss = 'p';
+
+ }
+ }
+ if (ss == 'Q')
+ {
+ // distinguish between forward/backward base-pairing
+ if (row_annotations[column].displayCharacter.indexOf('q') > -1)
+ {
+ ss = 'q';
+
+ }
+ }
+ if (ss == 'R')
+ {
+ // distinguish between forward/backward base-pairing
+ if (row_annotations[column].displayCharacter.indexOf('r') > -1)
+ {
+ ss = 'r';
+
+ }
+ }
+ if (ss == 'S')
+ {
+ // distinguish between forward/backward base-pairing
+ if (row_annotations[column].displayCharacter.indexOf('s') > -1)
+ {
+ ss = 's';
+
+ }
+ }
+ if (ss == 'T')
+ {
+ // distinguish between forward/backward base-pairing
+ if (row_annotations[column].displayCharacter.indexOf('t') > -1)
+ {
+ ss = 't';
+
+ }
+ }
+ if (ss == 'U')
+ {
+ // distinguish between forward/backward base-pairing
+ if (row_annotations[column].displayCharacter.indexOf('u') > -1)
+ {
+ ss = 'u';
+
+ }
+ }
+ if (ss == 'V')
+ {
+ // distinguish between forward/backward base-pairing
+ if (row_annotations[column].displayCharacter.indexOf('v') > -1)
+ {
+ ss = 'v';
+
+ }
+ }
+ if (ss == 'W')
+ {
+ // distinguish between forward/backward base-pairing
+ if (row_annotations[column].displayCharacter.indexOf('w') > -1)
+ {
+ ss = 'w';
+
+ }
+ }
+ if (ss == 'X')
+ {
+ // distinguish between forward/backward base-pairing
+ if (row_annotations[column].displayCharacter.indexOf('x') > -1)
+ {
+ ss = 'x';
+
+ }
+ }
+ if (ss == 'Y')
+ {
+ // distinguish between forward/backward base-pairing
+ if (row_annotations[column].displayCharacter.indexOf('y') > -1)
+ {
+ ss = 'y';
+
+ }
+ }
+ if (ss == 'Z')
+ {
+ // distinguish between forward/backward base-pairing
+ if (row_annotations[column].displayCharacter.indexOf('z') > -1)
+ {
+ ss = 'z';
+
+ }
+ }
if (!validRes || (ss != lastSS))
{
if (x > -1)
column, validRes, validEnd);
break;
- case 'S': // Stem case for RNA secondary structure
- case 's': // and opposite direction
+ case '(': // Stem case for RNA secondary structure
+ case ')': // and opposite direction
drawStemAnnot(g, row_annotations, lastSSX, x, y, iconOffset, startRes,
column, validRes, validEnd);
break;
-
+ case '{':
+ case '}':
+ case '[':
+ case ']':
+ case '>':
+ case '<':
+ case 'A':
+ case 'a':
+ case 'B':
+ case 'b':
+ case 'C':
+ case 'c':
+ case 'D':
+ case 'd':
+ case '1':
+ case 'e':
+ case 'F':
+ case 'f':
+ case 'G':
+ case 'g':
+ case '2':
+ case 'h':
+ case 'I':
+ case 'i':
+ case 'J':
+ case 'j':
+ case 'K':
+ case 'k':
+ case 'L':
+ case 'l':
+ case 'M':
+ case 'm':
+ case 'N':
+ case 'n':
+ case 'O':
+ case 'o':
+ case 'P':
+ case 'p':
+ case 'Q':
+ case 'q':
+ case 'R':
+ case 'r':
+ case 'S':
+ case 's':
+ case 'T':
+ case 't':
+ case 'U':
+ case 'u':
+ case 'V':
+ case 'v':
+ case 'W':
+ case 'w':
+ case 'X':
+ case 'x':
+ case 'Y':
+ case 'y':
+ case 'Z':
+ case 'z':
+ //System.out.println(lastSS);
+ Color nonCanColor= getNotCanonicalColor(lastSS);
+ drawNotCanonicalAnnot(g, nonCanColor, row_annotations, lastSSX, x, y, iconOffset, startRes,
+ column, validRes, validEnd);
+ break;
default:
g.setColor(Color.gray);
g.fillRect(lastSSX, y + 6 + iconOffset, (x * charWidth)
drawStemAnnot(g, row_annotations, lastSSX, x, y, iconOffset, startRes,
column, validRes, validEnd);
break;
+ case '{':
+ case '}':
+ case '[':
+ case ']':
+ case '>':
+ case '<':
+ case 'A':
+ case 'a':
+ case 'B':
+ case 'b':
+ case 'C':
+ case 'c':
+ case 'D':
+ case 'd':
+ case '1':
+ case 'e':
+ case 'F':
+ case 'f':
+ case 'G':
+ case 'g':
+ case '2':
+ case 'h':
+ case 'I':
+ case 'i':
+ case 'J':
+ case 'j':
+ case 'K':
+ case 'k':
+ case 'L':
+ case 'l':
+ case 'M':
+ case 'm':
+ case 'N':
+ case 'n':
+ case 'O':
+ case 'o':
+ case 'P':
+ case 'p':
+ case 'Q':
+ case 'q':
+ case 'R':
+ case 'r':
+ case 'T':
+ case 't':
+ case 'U':
+ case 'u':
+ case 'V':
+ case 'v':
+ case 'W':
+ case 'w':
+ case 'X':
+ case 'x':
+ case 'Y':
+ case 'y':
+ case 'Z':
+ case 'z':
+ //System.out.println(lastSS);
+ Color nonCanColor = getNotCanonicalColor(lastSS);
+ drawNotCanonicalAnnot(g,nonCanColor, row_annotations, lastSSX, x, y, iconOffset, startRes,
+ column, validRes, validEnd);
+ break;
default:
drawGlyphLine(g, row_annotations, lastSSX, x, y, iconOffset, startRes,
column, validRes, validEnd);
private final Color HELIX_COLOUR = Color.red;
private final Color STEM_COLOUR = Color.blue;
+
+ private Color sdNOTCANONICAL_COLOUR;
public void drawGlyphLine(Graphics g, Annotation[] row,
int lastSSX, int x, int y, int iconOffset, int startRes,
}
public void drawSheetAnnot(Graphics g, Annotation[] row,
+
int lastSSX, int x, int y, int iconOffset, int startRes,
int column, boolean validRes, boolean validEnd)
{
x += charWidth;
}
}
+
+
+ Color getNotCanonicalColor(char lastss)
+ {
+ switch (lastss)
+ {
+ case '{':
+ case '}':
+ return Color.cyan;
+
+ case '[':
+ case ']':
+ return Color.green;
+
+ case '>':
+ case '<':
+ return Color.magenta;
+
+ case 'A':
+ case 'a':
+ return Color.orange;
+
+ case 'B':
+ case 'b':
+ return Color.pink;
+
+ case 'C':
+ case 'c':
+ return Color.red;
+
+ case 'D':
+ case 'd':
+ return Color.yellow;
+
+ case '1':
+ case 'e':
+ return Color.black;
+
+ case 'F':
+ case 'f':
+ return Color.darkGray;
+
+ case 'G':
+ case 'g':
+ return Color.gray;
+
+ case '2':
+ case 'h':
+ return Color.lightGray;
+
+ case 'I':
+ case 'i':
+ return Color.white;
+
+ case 'J':
+ case 'j':
+ return Color.cyan;
+
+ case 'K':
+ case 'k':
+ return Color.magenta;
+
+ case 'L':
+ case 'l':
+ return Color.orange;
+
+ case 'M':
+ case 'm':
+ return Color.red;
+
+ case 'N':
+ case 'n':
+ return Color.yellow;
+
+ case 'O':
+ case 'o':
+ return Color.pink;
+
+ case 'P':
+ case 'p':
+ return Color.black;
+
+ case 'Q':
+ case 'q':
+ return Color.blue;
+
+ case 'R':
+ case 'r':
+ return Color.cyan;
+
+ case 'S':
+ case 's':
+ return Color.magenta;
+
+ case 'T':
+ case 't':
+ return Color.darkGray;
+
+ case 'U':
+ case 'u':
+ return Color.yellow;
+
+ case 'V':
+ case 'v':
+ return Color.blue;
+
+ case 'W':
+ case 'w':
+ return Color.orange;
+
+ case 'X':
+ case 'x':
+ return Color.magenta;
+
+ case 'Y':
+ case 'y':
+ return Color.blue;
+
+ case 'Z':
+ case 'z':
+ return Color.blue;
+
+ default :
+ System.out.println("This is not a interaction");
+ return null;
+
+ }
+ }
}
+
+
+
public static final int TCOFFEE = 15;
+ public static final int RNAINTERACTION = 16;
/**
* index of first colourscheme (includes 'None')
{
ret = PURINEPYRIMIDINE;
}
+
+ else if (name.equalsIgnoreCase("RNA Interaction type"))
+ {
+ ret = RNAINTERACTION;
+ }
// else if (name.equalsIgnoreCase("Covariation"))
// {
// ret = COVARIATION;
{
index = TCOFFEE;
}
+ else if (cs instanceof RNAInteractionColourScheme)
+ {
+ index = RNAINTERACTION;
+ }
+
+
/*
* else if (cs instanceof CovariationColourScheme) { index = COVARIATION; }
*/
ret = "T-Coffee Scores";
break;
+
+ case RNAINTERACTION:
+ ret = "RNA Interaction type";
+
+ break;
/*
* case COVARIATION: ret = "Covariation";
*
case TCOFFEE:
cs = new TCoffeeColourScheme(coll);
+ break;
+
+ case RNAINTERACTION:
+ cs = new RNAInteractionColourScheme();
+ break;
+
// case COVARIATION:
// cs = new CovariationColourScheme(annotation);
--- /dev/null
+package jalview.schemes;
+
+import jalview.datamodel.SequenceI;
+
+import java.awt.Color;
+
+
+public class RNAInteractionColourScheme extends ResidueColourScheme{
+ public RNAInteractionColourScheme()
+ {
+ super();
+ }
+
+ /**
+ * DOCUMENT ME!
+ *
+ * @param n
+ * DOCUMENT ME!
+ *
+ * @return DOCUMENT ME!
+ */
+ @Override
+ public Color findColour(char c)
+ {
+ // System.out.println("called"); log.debug
+ return colors[ResidueProperties.nucleotideIndex[c]];
+ }
+
+ /**
+ * DOCUMENT ME!
+ *
+ * @param n
+ * DOCUMENT ME!
+ * @param j
+ * DOCUMENT ME!
+ *
+ * @return DOCUMENT ME!
+ */
+ @Override
+ public Color findColour(char c, int j, SequenceI seq)
+ {
+ Color currentColour;
+ if ((threshold == 0) || aboveThreshold(c, j))
+ {
+ try
+ {
+ currentColour = colors[ResidueProperties.nucleotideIndex[c]];
+ } catch (Exception ex)
+ {
+ return Color.white;
+ }
+ }
+ else
+ {
+ return Color.white;
+ }
+
+ if (conservationColouring)
+ {
+ currentColour = applyConservation(currentColour, j);
+ }
+
+ return currentColour;
+ }
+ }
*/
public class ResidueColourScheme implements ColourSchemeI
{
- final int[] symbolIndex;
+ int[] symbolIndex;
boolean conservationColouring = false;
Color[] colors = null;
static
{
toRNAssState = new Hashtable();
- toRNAssState.put(")", "S");
- toRNAssState.put("(", "S");
+ toRNAssState.put(")", "(");
+ toRNAssState.put("(", "(");
+ toRNAssState.put("]", "[");
+ toRNAssState.put("[", "[");
+ toRNAssState.put("{", "{");
+ toRNAssState.put("}", "{");
+ toRNAssState.put(">", ">");
+ toRNAssState.put("<", ">");
+ toRNAssState.put("A", "A");
+ toRNAssState.put("a", "A");
+ toRNAssState.put("B", "B");
+ toRNAssState.put("b", "B");
+ toRNAssState.put("C", "C");
+ toRNAssState.put("c", "C");
+ toRNAssState.put("D", "D");
+ toRNAssState.put("d", "D");
+ toRNAssState.put("1", "1");
+ toRNAssState.put("e", "1");
+ toRNAssState.put("F", "F");
+ toRNAssState.put("f", "F");
+ toRNAssState.put("G", "G");
+ toRNAssState.put("g", "G");
+ toRNAssState.put("2", "2");
+ toRNAssState.put("h", "2");
+ toRNAssState.put("I", "I");
+ toRNAssState.put("i", "I");
+ toRNAssState.put("J", "J");
+ toRNAssState.put("j", "J");
+ toRNAssState.put("K", "K");
+ toRNAssState.put("k", "K");
+ toRNAssState.put("L", "L");
+ toRNAssState.put("l", "L");
+ toRNAssState.put("M", "M");
+ toRNAssState.put("m", "M");
+ toRNAssState.put("N", "N");
+ toRNAssState.put("n", "N");
+ toRNAssState.put("O", "O");
+ toRNAssState.put("o", "O");
+ toRNAssState.put("P", "P");
+ toRNAssState.put("p", "P");
+ toRNAssState.put("Q", "Q");
+ toRNAssState.put("q", "Q");
+ toRNAssState.put("R", "R");
+ toRNAssState.put("r", "R");
+ toRNAssState.put("S", "S");
+ toRNAssState.put("s", "S");
+ toRNAssState.put("T", "T");
+ toRNAssState.put("t", "T");
+ toRNAssState.put("U", "U");
+ toRNAssState.put("u", "U");
+ toRNAssState.put("V", "V");
+ toRNAssState.put("v", "V");
+ toRNAssState.put("W", "W");
+ toRNAssState.put("w", "W");
+ toRNAssState.put("X", "X");
+ toRNAssState.put("x", "X");
+ toRNAssState.put("Y", "Y");
+ toRNAssState.put("y", "Y");
+ toRNAssState.put("Z", "Z");
+ toRNAssState.put("z", "Z");
+
}
/**
import java.util.Hashtable;
import jalview.analysis.StructureFrequency;
+import jalview.analysis.StructureFrequency;
import jalview.api.AlignCalcWorkerI;
import jalview.api.AlignViewportI;
import jalview.api.AlignmentViewPanel;
try {
jalview.analysis.StructureFrequency.calculate(
- alignment.getSequencesArray(), 0, alignment.getWidth(),
- hStrucConsensus, true, rnaStruc);
+ alignment.getSequencesArray(), 0, alignment.getWidth(),
+ hStrucConsensus, true, rnaStruc);
} catch (ArrayIndexOutOfBoundsException x)
{
calcMan.workerComplete(this);
--- /dev/null
+package jalview.ws.jws1;
+
+import java.io.BufferedInputStream;
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.DataInputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.Reader;
+import java.io.StringWriter;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLConnection;
+
+import java.net.URLEncoder;
+
+
+
+public class Annotate3D {
+ //protected BufferedReader in;
+ //protected BufferedWriter out;
+
+ public Annotate3D()
+ {
+ System.out.println("Annotate3D");
+ //try {
+ // Create a URL for the desired page
+ //String id = "1HR2";
+ //URL url = new URL("http://paradise-ibmc.u-strasbg.fr/webservices/annotate3d?pdbid="+id);
+ //in = new BufferedReader(new InputStreamReader(url.openStream()));
+ //String str;
+ //OutputStream out1 = null;
+ //out = new BufferedWriter(new OutputStreamWriter(out1, "temp.rnaml"));
+ //while ((str = in.readLine()) != null) {
+ //System.out.println(str);
+ //out.write(str);
+ //}
+ //in.close();
+ //out.close();
+ //} catch (MalformedURLException e) {
+ //} catch (IOException e) {
+ //}
+ }
+
+ public Annotate3D(String path) throws InterruptedException{
+ System.out.println("Annotate3D");
+ try {
+// //URL url = new URL("http://paradise-ibmc.u-strasbg.fr/webservices/annotate3d?data="+inFile);
+// System.out.println("Step1");
+// FileReader r = new FileReader(inFile);
+// BufferedReader in = new BufferedReader(r);
+// StringBuffer content = new StringBuffer();
+// System.out.println("Step2");
+// while(in.readLine()!=null){
+// content.append(in.readLine());
+// //System.out.println("Step3"+in.readLine());
+// }
+//
+// String data = URLEncoder.encode("data", "UTF-8") + "=" + URLEncoder.encode(content.toString(), "UTF-8");
+// for (int i=0;i<data.length();i++)
+// {
+// System.out.print(data.charAt(i));
+// }
+
+ //String data = "width=50&height=100";
+
+
+// // Send the request
+// FileReader r = new FileReader(path);
+// BufferedReader in = new BufferedReader(r);
+// StringBuffer content = new StringBuffer();
+// System.out.println("Step1");
+// while(in.readLine()!=null){
+// content.append(in.readLine());
+//
+// }
+// System.out.println("Step2");
+// String data = URLEncoder.encode("data", "UTF-8") + "=" + URLEncoder.encode(content.toString(), "UTF-8");
+// System.out.println("Step2");
+// URL url = new URL("http://paradise-ibmc.u-strasbg.fr/webservices/annotate3d?data="+data);
+// DataInputStream is = new DataInputStream(url.openStream());
+// String str;
+// while ((str = is.readLine()) != null) {
+// System.out.println(str);
+// //out.write(str);
+// }
+ FileReader r = new FileReader(path);
+ BufferedReader in = new BufferedReader(r);
+ String content ="";
+ String str;
+
+ while((str=in.readLine())!=null){
+ //System.out.println(str);
+
+ content=content+str;
+ }
+ System.out.println("pdbfile="+content.toString());
+ System.out.println("capacité="+content.length());
+ String paramfile = URLEncoder.encode(content.toString(), "UTF-8");
+ System.out.println("param="+paramfile);
+ URL url = new URL("http://paradise-ibmc.u-strasbg.fr/webservices/annotate3d?data="+content);
+ BufferedReader is = new BufferedReader(new InputStreamReader(url.openStream()));
+ String str4;
+ while ((str4 = is.readLine()) != null) {
+ System.out.println(str4);
+ //out.write(str);
+ }
+ in.close();
+ is.close();
+
+// HttpURLConnection connection = (HttpURLConnection)url.openConnection();
+// connection.setRequestMethod("POST" );
+// connection.setRequestProperty("data", path );
+// //connection.setRequestProperty("nomDuChamp2", "valeurDuChamp2" );
+// BufferedReader input = new BufferedReader(new InputStreamReader(connection.getInputStream()));
+// //DataInputStream input = new DataInputStream(connection.getInputStream());
+// String c;
+// while((c=input.readLine())!=null){
+// System.out.print(c);
+// }
+// input.close();
+ //BufferedReader in1 = new BufferedReader(is);
+
+// OutputStream out1 = null;
+// System.out.println("Step3");
+// BufferedWriter out = new BufferedWriter(new OutputStreamWriter(out1, "temp.rnaml"));
+//
+// in.close();
+// out.close();
+
+
+ //return;
+
+ //System.out.println(data.length());
+ //System.out.println("step2");
+ //URL url = new URL("http://paradise-ibmc.u-strasbg.fr/webservices/annotate3d?data="+data);
+ //System.out.println("step3");
+ //URLConnection conn = url.openConnection();
+ //conn.setDoOutput(true);
+ //OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
+
+ //write parameters
+ //writer.write(data);
+ // writer.flush();
+
+ // Get the response
+// StringBuffer answer = new StringBuffer();
+// //BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
+// //String line;
+// while ((line = reader.readLine()) != null) {
+// answer.append(line);
+// System.out.println(line);
+// }
+// writer.close();
+// reader.close();
+
+ //Output the response
+
+
+ } catch (MalformedURLException ex) {
+ ex.printStackTrace();
+ } catch (IOException ex) {
+ ex.printStackTrace();
+ }
+ }
+
+ //in = new BufferedReader(new InputStreamReader(url.openStream()));
+
+ //String str;
+
+
+ //out = new FileOutputStream("temp.rnaml");
+ //out = new BufferedWriter(new FileWriter("temp.rnaml"));
+
+ //while ((str = in.readLine()) != null) {
+ //System.out.println(str);
+ //out.write(str);
+ //System.out.println(str);
+// in.close();
+
+
+ //out.close();
+// } catch (MalformedURLException e) {
+// } catch (IOException e) {
+// }
+//
+// }
+
+ //public BufferedWriter getReader()
+ //{
+ //System.out.println("The buffer");
+
+ //return out;
+
+
+ //}
+
+}
import java.io.StringReader;
import java.util.List;
+import javax.xml.parsers.ParserConfigurationException;
+
import org.junit.Test;
+import org.xml.sax.SAXException;
+
+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.exceptions.ExceptionUnmatchedClosingParentheses;
public class TCoffeeScoreFileTest {
final static File ALIGN_FILE = new File("test/jalview/io/tcoffee.fasta_aln");
@Test
- public void testReadHeader() throws IOException, FileNotFoundException {
+ public void testReadHeader() throws IOException, FileNotFoundException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses {
TCoffeeScoreFile scoreFile = new TCoffeeScoreFile(SCORE_FILE.getPath(),AppletFormatAdapter.FILE);
assertTrue(scoreFile.getWarningMessage(),scoreFile.isValid());
@Test
- public void testWrongFile() {
+ public void testWrongFile() throws ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses {
try {
TCoffeeScoreFile result = new TCoffeeScoreFile(ALIGN_FILE.getPath(), FormatAdapter.FILE);
assertFalse(result.isValid());
}
@Test
- public void testHeightAndWidth() throws IOException {
+ public void testHeightAndWidth() throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses {
TCoffeeScoreFile result = new TCoffeeScoreFile(SCORE_FILE.getPath(), FormatAdapter.FILE);
assertTrue(result.isValid());
assertEquals( 8, result.getHeight() );
}
@Test
- public void testParse() throws IOException {
+ public void testParse() throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses {
TCoffeeScoreFile parser = new TCoffeeScoreFile(SCORE_FILE.getPath(), FormatAdapter.FILE);
@Test
- public void testGetAsList() throws IOException {
+ public void testGetAsList() throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses {
TCoffeeScoreFile parser = new TCoffeeScoreFile(SCORE_FILE.getPath(),FormatAdapter.FILE);
assertTrue(parser.getWarningMessage(),parser.isValid());
@Test
- public void testGetAsArray() throws IOException {
+ public void testGetAsArray() throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses {
TCoffeeScoreFile parser = new TCoffeeScoreFile(SCORE_FILE.getPath(),FormatAdapter.FILE);
assertTrue(parser.getWarningMessage(),parser.isValid());