<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"/>
+ <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>
--- /dev/null
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.7
--- /dev/null
+eclipse.preferences.version=1
+org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false
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 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
{
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 jalview.datamodel.*;
import jalview.io.FileParse;
*/
boolean VisibleChainAnnotation = false;
- public PDBfile(String inFile, String inType) throws IOException
+ public PDBfile(String inFile, String inType) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
{
super(inFile, inType);
}
- public PDBfile(FileParse source) throws IOException
+ public PDBfile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
{
super(source);
}
{
// 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)
+ {
+ System.out.println("this is a PDB format and RNA sequence");
+ }
+
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'))
{
stack.push(i);
}
- else if ((base == '>') || (base == ')') || (base == '}')
- || (base == ']'))
+ else if ((base == '>') || (base == ')') || (base == '}')|| (base == ']')|| (base == 'a')|| (base == 'b')|| (base == 'c')|| (base == 'd'))
+
{
if (stack.isEmpty())
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
+\r
public class AlignFrame extends EmbmenuFrame implements ActionListener, ItemListener, KeyListener\r
{\r
public AlignmentPanel alignPanel;\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
*/\r
- public boolean loadScoreFile( String source ) throws IOException {\r
+ public boolean loadScoreFile( String source ) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed {\r
\r
TCoffeeScoreFile file = new TCoffeeScoreFile(source, AppletFormatAdapter.checkProtocol(source));\r
if( !file.isValid()) {\r
--- /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;
+ }
+}
*/
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;
/**
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);
+ System.out.println("here(1)");
}
public AppVarnaBinding(ArrayList<RNA> rnaList)
{
+ System.out.println("here(2)");
// super("VARNA in Jalview");
initVarnaEdit(rnaList);
}
private void initVarna(String seq, String str)
{
+ System.out.println("initialisation VARNA (appvarnabinding");
DefaultListModel dlm = new DefaultListModel();
DefaultListSelectionModel m = new DefaultListSelectionModel();
try
{
+ System.out.println("here");
vp = new VARNAPanel("0", ".");
_RNA1.setRNA(seq, str);
_RNA1.drawRNARadiate(vp.getConfig());
private void initVarnaEdit(ArrayList<RNA> rnaInList)
{
+ System.out.println("initialisation VARNA(2) (appvarnabinding");
DefaultListModel dlm = new DefaultListModel();
int marginTools = 40;
try
{
+ System.out.println("here(plop)");
vp = new VARNAPanel("0", ".");
for (int i = 0; i < rnaInList.size(); i++)
{
rnaInList.get(i).drawRNARadiate(vp.getConfig());
+ System.out.println(i);
}
} catch (ExceptionNonEqualLength e)
{
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 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
*/
- 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
{
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 MCview.*;
import jalview.analysis.*;
{
public void actionPerformed(ActionEvent e)
{
+ System.out.println("1:"+structureLine);
+ System.out.println("2:"+seq);
+ System.out.println("3:"+seq.getSequenceAsString());
+ System.out.println("4:"+rnastruc);
+ System.out.println("5:"+seq.getName());
+ System.out.println("6:"+ap);
new AppVarna(structureLine, seq, seq.getSequenceAsString(), rnastruc, seq
.getName(), ap);
+ System.out.println("end");
}
});
viewStructureMenu.add(menuItem);
public void actionPerformed(ActionEvent e)
{
// TODO: VARNA does'nt print gaps in the sequence
+
new AppVarna(seq.getName()+" structure",seq,seq.getSequenceAsString(), rnastruc, seq
.getName(), ap);
}
{
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();
+ }
}
});
enterPDB.setText("Enter PDB Id");
oal = null;
}
- public void pdbFromFile_actionPerformed()
+ public void pdbFromFile_actionPerformed() throws ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
{
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;
+
/**
* 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
*/
- public AlignFile(String inFile, String type) throws IOException
+ public AlignFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
{
super(inFile, type);
initData();
*
* @param source
* @throws IOException
+ * @throws SAXException
+ * @throws ParserConfigurationException
+ * @throws ExceptionFileFormatOrSyntax
+ * @throws ExceptionLoadingFailed
+ * @throws ExceptionPermissionDenied
*/
- public AlignFile(FileParse source) throws IOException
+ public AlignFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
{
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
*/
- public abstract void parse() throws IOException;
+ public abstract void parse() throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed;
/**
* 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
*/
public static final String[] READABLE_EXTENSIONS = new String[]
{ "fa, fasta, fastq", "aln", "pfam", "msf", "pir", "blc", "amsa", "jar",
- "sto,stk" }; // ,
+ "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"))
{
+ //if (contient de l'ARN)
+ // {
+ System.out.println(inFile); //donne le path
+
+ //new URL = http://paradise-ibmc.u-strasbg.fr/webservices/annotate3d?data=inFile;
+ //afile = new RnamlFile(inFile, type);
+
+ //}
afile = new MCview.PDBfile(inFile, type);
+
}
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 jalview.datamodel.*;
/**
*
* @throws IOException
* DOCUMENT ME!
+ * @throws SAXException
+ * @throws ParserConfigurationException
+ * @throws ExceptionFileFormatOrSyntax
+ * @throws ExceptionLoadingFailed
+ * @throws ExceptionPermissionDenied
*/
- public BLCFile(String inFile, String type) throws IOException
+ public BLCFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
{
super(inFile, type);
}
- public BLCFile(FileParse source) throws IOException
+ public BLCFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
{
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 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
{
super(inFile, type);
}
- public ClustalFile(FileParse source) throws IOException
+ public ClustalFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
{
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 jalview.datamodel.*;
/**
*
* @throws IOException
* DOCUMENT ME!
+ * @throws SAXException
+ * @throws ParserConfigurationException
+ * @throws ExceptionFileFormatOrSyntax
+ * @throws ExceptionLoadingFailed
+ * @throws ExceptionPermissionDenied
*/
- public FastaFile(String inFile, String type) throws IOException
+ public FastaFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
{
super(inFile, type);
}
- public FastaFile(FileParse source) throws IOException
+ public FastaFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
{
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
+\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
*/\r
- public FeaturesFile(String inFile, String type) throws IOException\r
+ public FeaturesFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed\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\r
{\r
super(source);\r
}\r
break;
}
+
+ if ((data.indexOf(">") > -1))
+ {
+ reply = "RNAML";
+ System.out.println("This is a RNAML format");
+ 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 jalview.datamodel.*;
/**
*
* @throws IOException
* DOCUMENT ME!
+ * @throws SAXException
+ * @throws ParserConfigurationException
+ * @throws ExceptionFileFormatOrSyntax
+ * @throws ExceptionLoadingFailed
+ * @throws ExceptionPermissionDenied
*/
- public JPredFile(String inFile, String type) throws IOException
+ public JPredFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
{
super(inFile, type);
}
- public JPredFile(FileParse source) throws IOException
+ public JPredFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
{
super(source);
}
*
* @param args
* DOCUMENT ME!
+ * @throws SAXException
+ * @throws ParserConfigurationException
+ * @throws ExceptionFileFormatOrSyntax
+ * @throws ExceptionLoadingFailed
+ * @throws ExceptionPermissionDenied
*/
- public static void main(String[] args)
+ public static void main(String[] args) throws ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
{
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 jalview.datamodel.*;
import jalview.util.*;
*
* @throws IOException
* DOCUMENT ME!
+ * @throws SAXException
+ * @throws ParserConfigurationException
+ * @throws ExceptionFileFormatOrSyntax
+ * @throws ExceptionLoadingFailed
+ * @throws ExceptionPermissionDenied
*/
- public MSFfile(String inFile, String type) throws IOException
+ public MSFfile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
{
super(inFile, type);
}
- public MSFfile(FileParse source) throws IOException
+ public MSFfile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
{
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 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
{
super(inFile, type);
}
- public PIRFile(FileParse source) throws IOException
+ public PIRFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
{
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 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
{
super(inFile, type);
}
- public PfamFile(FileParse source) throws IOException
+ public PfamFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
{
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 jalview.datamodel.*;
import jalview.util.*;
*
* @throws IOException
* DOCUMENT ME!
+ * @throws SAXException
+ * @throws ParserConfigurationException
+ * @throws ExceptionFileFormatOrSyntax
+ * @throws ExceptionLoadingFailed
+ * @throws ExceptionPermissionDenied
*/
- public PileUpfile(String inFile, String type) throws IOException
+ public PileUpfile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
{
super(inFile, type);
}
- public PileUpfile(FileParse source) throws IOException
+ public PileUpfile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
{
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 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.factories.RNAFactory;
+import fr.orsay.lri.varna.models.rna.RNA;
+import fr.orsay.lri.varna.utils.RNAMLParser;
+
+
+
+
+public class RnamlFile extends AlignFile
+{
+ public String id;
+
+ public RnamlFile()
+ {
+ super();
+
+ }
+
+ public RnamlFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
+ {
+ super(inFile, type);
+
+ }
+
+ public RnamlFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
+ {
+ super(source);
+
+ }
+
+
+
+
+ public void parse() throws ExceptionPermissionDenied, ExceptionLoadingFailed, ExceptionFileFormatOrSyntax, FileNotFoundException
+ {
+ System.out.println("this is a rnaml file");
+
+
+ FileReader fr = null;
+ fr = new FileReader(inFile);
+
+ BufferedReader r = new BufferedReader (fr);
+
+ Hashtable seqhash = new Hashtable();
+ Vector headers = new Vector();
+ //ArrayList<String> seq =new ArrayList();
+ System.out.println(r);
+ ArrayList<RNA> result = RNAFactory.loadSecStrRNAML(r);
+
+ System.out.println("this is the secondary scructure:" +result.toArray());
+ System.out.println("this is the secondary scructure:" +result.toString());
+ System.out.println("this is the secondary scructure:" +result.size());
+ for(int i=0;i<result.size();i++)
+ {
+ System.out.println(result.get(0).getSeq());
+ System.out.println(result.get(0).getStructBPSEQ());
+ System.out.println(result.get(0).getStructDBN(true));
+ String rna1 =result.get(0).getStructDBN(true);
+ System.out.println(result.get(0).getAnnotations());
+ String seq = result.get(0).getSeq();
+ System.out.println(type); //the type is "File"
+ System.out.println(inFile );//inFile is the path
+ int begin=0;
+ int end = seq.length()-1;
+ SequenceI[] seqs = new SequenceI[1];
+ id = safeName(getDataName());
+ seqs[0] = new Sequence(id, seq, begin, end);
+ SequenceFeature feat = new SequenceFeature(type, "",5, 13, 0f, null);
+ seqs[0].addSequenceFeature(feat);
+ this.setSeqs(seqs);
+
+ String[] annot=new String[10000] ;
+ Annotation[] ann = new Annotation[1000];
+ for(int j=0;j<rna1.length();j++)
+ {
+ annot[j] =rna1.substring(j,j+1);
+ System.out.println(annot[j]);
+ }
+
+ for(int k=0;k<rna1.length();k++)
+ {
+ ann[k] = new Annotation(annot[k], "", ' ', 0f);
+
+ ann[k].secondaryStructure = jalview.schemes.ResidueProperties.getRNASecStrucState(annot[k]).charAt(0);
+
+ }
+ AlignmentAnnotation align = new AlignmentAnnotation("Secondary structure","",ann);
+ seqs[0].addAlignmentAnnotation(align);
+ this.annotations.addElement(align);
+ }
+
+
+
+
+
+
+
+
+
+
+// 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;
+ }
+
+}
+
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 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
{
super(inFile, type);
}
- public SimpleBlastFile(FileParse source) throws IOException
+ public SimpleBlastFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
{
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 jalview.datamodel.*;\r
import jalview.analysis.Rna;\r
\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\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\r
{\r
super(source);\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;
+
/**
* 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
{
super(inFile, type);
}
- public TCoffeeScoreFile(FileParse source) throws IOException
+ public TCoffeeScoreFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed
{
super(source);
}
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, Annotation[] row_annotations,
+ int lastSSX, int x, int y, int iconOffset, int startRes,
+ int column, boolean validRes, boolean validEnd)
+ {
+
+ g.setColor(NOTCANONICAL_COLOUR);
+ int sCol = (lastSSX / charWidth) + startRes;
+ int x1 = lastSSX;
+ int x2 = (x * charWidth);
+ Regex closeparen = new Regex("(}|]|a|b|c|d)");
+
+ 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,
{
char ss = validRes ? row_annotations[column].secondaryStructure
: ' ';
+ //System.out.println(ss);
if (ss == 'S')
{
// distinguish between forward/backward base-pairing
if (row_annotations[column].displayCharacter.indexOf(')') > -1)
{
ss = 's';
+ System.out.println(ss);
+ }
+ }
+ if (ss == 'C')
+ {
+ if ((row_annotations[column].displayCharacter.indexOf(']') > -1) || (row_annotations[column].displayCharacter.indexOf('}') > -1))
+ {
+ ss = 'c';
+ System.out.println(ss);
}
}
if (!validRes || (ss != lastSS))
drawStemAnnot(g, row_annotations, lastSSX, x, y, iconOffset, startRes,
column, validRes, validEnd);
break;
-
+ case 'C':
+ case 'c':
+ drawNotCanonicalAnnot(g, 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 'c':
+ case 'C':
+ drawNotCanonicalAnnot(g, 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 final Color NOTCANONICAL_COLOUR = Color.red;
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)
{
toRNAssState = new Hashtable();
toRNAssState.put(")", "S");
toRNAssState.put("(", "S");
+ toRNAssState.put("]", "C");
+ toRNAssState.put("[", "C");
+ toRNAssState.put("{", "C");
+ toRNAssState.put("}", "C");
+ toRNAssState.put("A", "C");
+ toRNAssState.put("a", "C");
+ toRNAssState.put("B", "C");
+ toRNAssState.put("b", "C");
+ toRNAssState.put("C", "C");
+ toRNAssState.put("c", "C");
+ toRNAssState.put("D", "C");
+ toRNAssState.put("d", "C");
}
/**
import jalview.datamodel.AlignmentI;
import jalview.datamodel.Annotation;
import jalview.gui.AlignFrame;
+import jalview.gui.AlignmentPanel;
import jalview.ws.jws2.jabaws2.Jws2Instance;
import jalview.ws.params.WsParamSetI;
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;
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 {
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 {
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 {
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 {
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 {
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 {
TCoffeeScoreFile parser = new TCoffeeScoreFile(SCORE_FILE.getPath(),FormatAdapter.FILE);
assertTrue(parser.getWarningMessage(),parser.isValid());