From: Patric Plitzner Date: Mon, 27 Oct 2014 13:45:51 +0000 (+0000) Subject: merge-update from trunk X-Git-Tag: 3.8.0^2~59^2~110 X-Git-Url: https://dev.e-taxonomy.eu/gitweb/taxeditor.git/commitdiff_plain/26254193b965dc0bb91a50b162b9e091c298e63f?hp=7c6e83fe0ab93017b619b75580da1c585193b2b2 merge-update from trunk --- diff --git a/.gitattributes b/.gitattributes index 7955a88cd..b784f78f8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -358,6 +358,11 @@ eu.etaxonomy.taxeditor.editor/icons/edit_16x16.gif -text eu.etaxonomy.taxeditor.editor/icons/emblem-photos.png -text eu.etaxonomy.taxeditor.editor/icons/leaf_detail.png -text eu.etaxonomy.taxeditor.editor/icons/xper64.png -text +eu.etaxonomy.taxeditor.editor/lib/biojava3-alignment-3.0.7.jar -text +eu.etaxonomy.taxeditor.editor/lib/biojava3-core-3.0.7.jar -text +eu.etaxonomy.taxeditor.editor/lib/commons-lang3-3.1.jar -text +eu.etaxonomy.taxeditor.editor/lib/core-1.8.5.jar -text +eu.etaxonomy.taxeditor.editor/lib/sequencing-1.8.5.jar -text eu.etaxonomy.taxeditor.editor/p2.inf -text eu.etaxonomy.taxeditor.editor/plugin.xml -text eu.etaxonomy.taxeditor.editor/pom.xml -text @@ -381,7 +386,10 @@ eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/Viewer eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/group/authority/CdmAuthorityEditor.java -text eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/group/authority/CdmAuthorityEditorInput.java -text eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/group/authority/handler/EditCdmAuthoritiesHandler.java -text +eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/AddAHandler.java -text eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/EditNewTaxonHandler.java -text +eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/LoadPherogramHandler.java -text +eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenAlignmentEditor.java -text eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenChecklistEditorHandler.java -text eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenDerivateViewHandler.java -text eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenParentHandler.java -text @@ -414,6 +422,10 @@ eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/po eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/operation/CreateNodeOperation.java -text eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/operation/DeleteNodeOperation.java -text eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/operation/RefreshNodeNumberingOperation.java -text +eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/AlignmentEditor.java -text +eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/AlignmentEditorInput.java -text +eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/CMDAlignmentObjectPlaceholder.java -text +eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/ContigSequenceDataProvider.java -text eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/TaxonNameEditor.java -text eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/container/AbstractGroup.java -text eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/container/AbstractGroupedContainer.java -text @@ -585,7 +597,10 @@ eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/u eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/uses/operation/CreateTaxonUseOperation.java -text eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/uses/operation/CreateUseRecordOperation.java -text eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/uses/operation/CreateUseSummaryOperation.java -text +eu.etaxonomy.taxeditor.editor/src/main/resources/AlignmentTestData/JR430_JR-P01.ab1 -text +eu.etaxonomy.taxeditor.editor/src/main/resources/AlignmentTestData/JR444_JR-P05.ab1 -text eu.etaxonomy.taxeditor.editor/src/main/resources/TaonDescriptionEditor.screen -text +eu.etaxonomy.taxeditor.editor/src/main/resources/TestPherogram_qualityScore.scf -text eu.etaxonomy.taxeditor.editor/src/main/resources/log4j.properties -text eu.etaxonomy.taxeditor.editor/src/test/java/eu/etaxonomy/taxeditor/editor/Application.java -text eu.etaxonomy.taxeditor.editor/src/test/java/eu/etaxonomy/taxeditor/editor/ApplicationActionBarAdvisor.java -text diff --git a/eu.etaxonomy.taxeditor.application/plugin_customization.ini b/eu.etaxonomy.taxeditor.application/plugin_customization.ini index d97cc21c8..736937100 100644 --- a/eu.etaxonomy.taxeditor.application/plugin_customization.ini +++ b/eu.etaxonomy.taxeditor.application/plugin_customization.ini @@ -1,4 +1,5 @@ org.eclipse.ui/SHOW_PROGRESS_ON_STARTUP = true org.eclipse.ui/SHOW_TRADITIONAL_STYLE_TABS=false org.eclipse.ui/DOCK_PERSPECTIVE_BAR=top-right -org.eclipse.ui/SHOW_TEXT_ON_PERSPECTIVE_BAR=true \ No newline at end of file +org.eclipse.ui/SHOW_TEXT_ON_PERSPECTIVE_BAR=true +org.eclipse.ui/KEY_CONFIGURATION_ID=eu.etaxonomy.taxeditor.bindings.scheme.default \ No newline at end of file diff --git a/eu.etaxonomy.taxeditor.editor/.classpath b/eu.etaxonomy.taxeditor.editor/.classpath index 856e9f909..f7c4e43f8 100644 --- a/eu.etaxonomy.taxeditor.editor/.classpath +++ b/eu.etaxonomy.taxeditor.editor/.classpath @@ -1,9 +1,16 @@ - - - - - - - - - + + + + + + + + + + + + + + + + diff --git a/eu.etaxonomy.taxeditor.editor/.project b/eu.etaxonomy.taxeditor.editor/.project index e25293c2f..ce8935ac2 100644 --- a/eu.etaxonomy.taxeditor.editor/.project +++ b/eu.etaxonomy.taxeditor.editor/.project @@ -1,28 +1,40 @@ - - - eu.etaxonomy.taxeditor.editor - NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse. - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - + + + eu.etaxonomy.taxeditor.editor + NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse. + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.pde.PluginNature + + + + lib/LibrAlign + 2 + WORKSPACE_LOC/LibrAlign/bin + + + lib/bioinfweb.commons + 2 + WORKSPACE_LOC/_Lib/bin + + + diff --git a/eu.etaxonomy.taxeditor.editor/META-INF/MANIFEST.MF b/eu.etaxonomy.taxeditor.editor/META-INF/MANIFEST.MF index 0718ed6fb..dc6052e58 100644 --- a/eu.etaxonomy.taxeditor.editor/META-INF/MANIFEST.MF +++ b/eu.etaxonomy.taxeditor.editor/META-INF/MANIFEST.MF @@ -175,4 +175,11 @@ Bundle-ClassPath: ., jdimodel.jar, pdebuild.jar, compatibility.jar, - junit.jar + junit.jar, + lib/biojava3-alignment-3.0.7.jar, + lib/biojava3-core-3.0.7.jar, + lib/core-1.8.5.jar, + lib/sequencing-1.8.5.jar, + lib/bioinfweb.commons/, + lib/LibrAlign/, + lib/commons-lang3-3.1.jar diff --git a/eu.etaxonomy.taxeditor.editor/build.properties b/eu.etaxonomy.taxeditor.editor/build.properties index 356db7a1c..91b72a915 100644 --- a/eu.etaxonomy.taxeditor.editor/build.properties +++ b/eu.etaxonomy.taxeditor.editor/build.properties @@ -7,4 +7,11 @@ bin.includes = META-INF/,\ icons/,\ p2.inf,\ OSGI-INF/l10n/plugin_de.properties,\ - OSGI-INF/l10n/plugin_en.properties + OSGI-INF/l10n/plugin_en.properties,\ + lib/biojava3-alignment-3.0.7.jar,\ + lib/biojava3-core-3.0.7.jar,\ + lib/core-1.8.5.jar,\ + lib/sequencing-1.8.5.jar,\ + lib/bioinfweb.commons/,\ + lib/LibrAlign/,\ + lib/commons-lang3-3.1.jar diff --git a/eu.etaxonomy.taxeditor.editor/lib/biojava3-alignment-3.0.7.jar b/eu.etaxonomy.taxeditor.editor/lib/biojava3-alignment-3.0.7.jar new file mode 100644 index 000000000..e5f1d6bad Binary files /dev/null and b/eu.etaxonomy.taxeditor.editor/lib/biojava3-alignment-3.0.7.jar differ diff --git a/eu.etaxonomy.taxeditor.editor/lib/biojava3-core-3.0.7.jar b/eu.etaxonomy.taxeditor.editor/lib/biojava3-core-3.0.7.jar new file mode 100644 index 000000000..c9f1f81f4 Binary files /dev/null and b/eu.etaxonomy.taxeditor.editor/lib/biojava3-core-3.0.7.jar differ diff --git a/eu.etaxonomy.taxeditor.editor/lib/commons-lang3-3.1.jar b/eu.etaxonomy.taxeditor.editor/lib/commons-lang3-3.1.jar new file mode 100644 index 000000000..a85e539b1 Binary files /dev/null and b/eu.etaxonomy.taxeditor.editor/lib/commons-lang3-3.1.jar differ diff --git a/eu.etaxonomy.taxeditor.editor/lib/core-1.8.5.jar b/eu.etaxonomy.taxeditor.editor/lib/core-1.8.5.jar new file mode 100644 index 000000000..c6c7bdc54 Binary files /dev/null and b/eu.etaxonomy.taxeditor.editor/lib/core-1.8.5.jar differ diff --git a/eu.etaxonomy.taxeditor.editor/lib/sequencing-1.8.5.jar b/eu.etaxonomy.taxeditor.editor/lib/sequencing-1.8.5.jar new file mode 100644 index 000000000..b987ebee8 Binary files /dev/null and b/eu.etaxonomy.taxeditor.editor/lib/sequencing-1.8.5.jar differ diff --git a/eu.etaxonomy.taxeditor.editor/plugin.xml b/eu.etaxonomy.taxeditor.editor/plugin.xml index 8788f3911..90254eae6 100644 --- a/eu.etaxonomy.taxeditor.editor/plugin.xml +++ b/eu.etaxonomy.taxeditor.editor/plugin.xml @@ -83,6 +83,12 @@ id="eu.etaxonomy.taxeditor.editor.view.checklist.ChecklistEditor" name="%editor.name.8"> + + @@ -243,6 +249,11 @@ + + @@ -914,6 +925,30 @@ + + + + + + + + + + + + + + + + - + + + + + + + + @@ -1394,6 +1443,16 @@ id="eu.etaxonomy.taxeditor.bindings.scheme.default" name="%scheme.name"> + + + + diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/EditorUtil.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/EditorUtil.java index d3f414a03..4ed9313d3 100644 --- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/EditorUtil.java +++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/EditorUtil.java @@ -35,6 +35,8 @@ import eu.etaxonomy.taxeditor.editor.group.authority.CdmAuthorityEditorInput; import eu.etaxonomy.taxeditor.editor.internal.TaxeditorEditorPlugin; import eu.etaxonomy.taxeditor.editor.key.KeyEditor; import eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyEditorInput; +import eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor; +import eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditorInput; import eu.etaxonomy.taxeditor.editor.view.checklist.ChecklistEditorInput; import eu.etaxonomy.taxeditor.editor.view.checklist.ChecklistEditor; import eu.etaxonomy.taxeditor.editor.view.dataimport.BioCaseEditorInput; @@ -116,6 +118,16 @@ public class EditorUtil extends AbstractUtility { open(input, ChecklistEditor.ID); } + /** + * Opens a new AlignmentEditor for the given input + * @param input + * @throws PartInitException + */ + public static void open(AlignmentEditorInput input) + throws PartInitException { + open(input, AlignmentEditor.ID); + } + /** * Opens a new {@link DataImportEditor} for the given input * @param input a {@link DataImportEditorInput} diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/AddAHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/AddAHandler.java new file mode 100644 index 000000000..052b6ffaf --- /dev/null +++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/AddAHandler.java @@ -0,0 +1,31 @@ +package eu.etaxonomy.taxeditor.editor.handler; + + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.ui.IEditorPart; + +import eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor; +import eu.etaxonomy.taxeditor.model.AbstractUtility; +import eu.etaxonomy.taxeditor.model.MessagingUtils; + + + +public class AddAHandler extends AbstractHandler { + /* (non-Javadoc) + * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent) + */ + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + IEditorPart activeEditor = AbstractUtility.getActiveEditor(); + if(activeEditor instanceof AlignmentEditor){ + AlignmentEditor alignmentEditor = (AlignmentEditor) activeEditor; +// alignmentEditor.getAlignmentArea().getSelection() + } + MessagingUtils.informationDialog("Added A", "Added A"); + return null; // Reserved for future use + } + + +} diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/LoadPherogramHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/LoadPherogramHandler.java new file mode 100644 index 000000000..84f6b3a5b --- /dev/null +++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/LoadPherogramHandler.java @@ -0,0 +1,32 @@ +package eu.etaxonomy.taxeditor.editor.handler; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.swt.widgets.FileDialog; +import org.eclipse.ui.IEditorPart; + +import eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor; +import eu.etaxonomy.taxeditor.model.AbstractUtility; + + +public class LoadPherogramHandler extends AbstractHandler{ + + /* (non-Javadoc) + * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent) + */ + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + IEditorPart activeEditor = AbstractUtility.getActiveEditor(); + if(activeEditor instanceof AlignmentEditor){ + AlignmentEditor alignmentEditor = (AlignmentEditor) activeEditor; + FileDialog fileDialog = new FileDialog(alignmentEditor.getSite().getShell()); + String path = fileDialog.open(); + System.out.println(path); +// alignmentEditor.getAlignmentArea().getSelection() + } + return null; + } + + +} diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenAlignmentEditor.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenAlignmentEditor.java new file mode 100644 index 000000000..b978857ac --- /dev/null +++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenAlignmentEditor.java @@ -0,0 +1,42 @@ +// $Id$ +/** +* Copyright (C) 2014 EDIT +* European Distributed Institute of Taxonomy +* http://www.e-taxonomy.eu +* +* The contents of this file are subject to the Mozilla Public License Version 1.1 +* See LICENSE.TXT at the top of this package for the full license terms. +*/ +package eu.etaxonomy.taxeditor.editor.handler; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.ui.PartInitException; + +import eu.etaxonomy.taxeditor.editor.EditorUtil; +import eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditorInput; +import eu.etaxonomy.taxeditor.model.MessagingUtils; + +/** + * @author pplitzner + * @date 04.08.2014 + * + */ +public class OpenAlignmentEditor extends AbstractHandler { + + /* (non-Javadoc) + * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent) + */ + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + + AlignmentEditorInput input = new AlignmentEditorInput(); + try { + EditorUtil.open(input); + } catch (PartInitException e) { + MessagingUtils.error(OpenAlignmentEditor.class, "Could not open AlignmentEditor", e); + } + return null; + } +} diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/AlignmentEditor.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/AlignmentEditor.java new file mode 100644 index 000000000..ab3c65165 --- /dev/null +++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/AlignmentEditor.java @@ -0,0 +1,218 @@ +// $Id$ +/** +* Copyright (C) 2014 EDIT +* European Distributed Institute of Taxonomy +* http://www.e-taxonomy.eu +* +* The contents of this file are subject to the Mozilla Public License Version 1.1 +* See LICENSE.TXT at the top of this package for the full license terms. +*/ +package eu.etaxonomy.taxeditor.editor.molecular; + + +import info.bioinfweb.commons.bio.biojava3.alignment.SimpleAlignment; +import info.bioinfweb.commons.bio.biojava3.alignment.template.Alignment; +import info.bioinfweb.commons.bio.biojava3.core.sequence.compound.AlignmentAmbiguityNucleotideCompoundSet; +import info.bioinfweb.libralign.AlignmentArea; +import info.bioinfweb.libralign.dataarea.implementations.ConsensusSequenceArea; +import info.bioinfweb.libralign.dataarea.implementations.SequenceIndexArea; +import info.bioinfweb.libralign.dataarea.implementations.pherogram.PherogramArea; +import info.bioinfweb.libralign.pherogram.BioJavaPherogramProvider; +import info.bioinfweb.libralign.pherogram.PherogramProvider; +import info.bioinfweb.libralign.pherogram.ReverseComplementPherogramProvider; +import info.bioinfweb.libralign.sequenceprovider.implementations.BioJavaSequenceDataProvider; +import info.bioinfweb.libralign.sequenceprovider.tokenset.BioJavaTokenSet; + +import java.io.File; + +import org.biojava.bio.chromatogram.ChromatogramFactory; +import org.biojava3.core.sequence.DNASequence; +import org.biojava3.core.sequence.compound.NucleotideCompound; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.ui.IEditorInput; +import org.eclipse.ui.IEditorSite; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.part.EditorPart; + + + +/** + * Editor component to edit a contig alignment used to combine different overlapping pherograms from Sanger sequencing to + * a consensus sequence. + *

+ * The contained GUI components used to edit the alignment come from LibrAlign. + * + * @author pplitzner + * @author Ben Stöver + * @date 04.08.2014 + */ +public class AlignmentEditor extends EditorPart { + public static final String ID = "eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor"; + + private AlignmentArea alignmentArea; + + + private AlignmentArea createAlignmentArea() { + try { + //ResourcesPlugin.getWorkspace().getRoot().getFile("/eu.etaxonomy.taxeditor.editor/src/main/resources/TestPherogram_qualityScore.scf"); + //System.out.println(AlignmentEditor.class.getResource("/")); + //System.out.println(AlignmentEditor.class.getResource("/../resources/TestPherogram_qualityScore.scf")); +// BioJavaPherogramProvider pherogramProvider = new BioJavaPherogramProvider(ChromatogramFactory.create( +// new File("D:\\Users\\BenStoever\\Documents\\Studium\\Projekte\\Promotion\\EDITor\\Quelltexte\\LibrAlign branch\\Repository\\eu.etaxonomy.taxeditor.editor\\src\\main\\resources\\TestPherogram_qualityScore.scf"))); + //TODO Replace this absolute path with a path working with every workspace location. + + Alignment alignment = + new SimpleAlignment(); + alignment.add("Read 1", new DNASequence("TAAGATACAACAAGGTTTCGGGCA-CCTTATCCACGCAGTAAGGGGATCAGAGGTTTTTCTCTCATTCATGTATCGTGGATCAGTAAGGCAATTTTGCTACCCTGTCTGCTCTTTCTAGCATTTTACTAATGCCCCAGAAATTAGGAATAAAGATTTTATATGAAAGAAAGGGCGAATTAATTCATAAGGGACTGGTATCCATTCTTATTTGATTTGATACATTGTATCCATTAACATTACATTGGCGAATTGGGCGAAGGTGCGGAAAGAGAGGGATTCGAACCCTCGGTAAACAAAAGTCTACATAGCAGTTCCAATGCTACGCCTTGAACCACTCGGCCACCTCTCCTACATAAGGATTTTGGTCCCAAACCAAAAAGAGGGAGTTGTTCAAATTAGATTCTTAGGTAGGTCCGGACAACGAATTCAAATGAATAAGGTAAGGGGACATCCCCCCTCCCTCCCCTTTGTTTTTTTCTTTATTTGGTTAGGGCGGGGGACTCGACTCTTATTGAATTTTCATATGTATCACAGCTCGAAACGAAAGAACTCGTGGGGGGGTCGTTTCCTTTTTGGATCTTGAACGACTAGGTTCAAGAGATGAGAGAATTCAGGATACCCACAAGAAAGACTAATCCAATCCATAACGATGTACCAGAAAAGACAATATTTTTATTACCTGACCA")); + alignment.add("Read 2", new DNASequence("TAAGATACAACAAGGTTTCGGGCAACCTTATCCACGCAGTAAGGGGATCAGAGGTTTTTCTCTCATTCATGTATCGTGGATCAGTAAGGCAATTTTGCTACCCTGTCTGCTCTTTCTAGCATTTTACTAATGCCCCAGAAATTAGGAATAAAGATTTTATATGAAAGAAAGGGCGAATTAATTCATAAGGGACTGGTATCCATTCTTATTTGATTTGATACATTGTATCCATTAACATTACATTGGCGAATTGGGCGAAGGTGCGGAAAGAGAGGGATTCGAACCCTCGGTAAACAAAAGTCTACATAGCAGTTCCAATGCTACGCCTTGAACCACTCGGCCACCTCTCCTACATAAGGATTTTGGTCCCAAACCAAAAAGAGGGAGTTGTTCAAATTAGATTCTTAGGTAGGTCCGGACAACGAATTCAAATGAATAAGGTAAGGGGACATCCCCCCTCCCTCCCCTTTGTTTTTTTCTTTATTTGGTTAGGGCGGGGGACTCGACTCTTATTGAATTTTCATATGTATCACAGCTCGAAACGAAAGAACTCGTGGGGGGGTCGTTTCCTTTTTGGATCTTGAACGACTAGGTTCAAGAGATGAGAGAATTCAGGATACCCACAAGAAAGACTAATCCAATCCATAACGATGTACCAGAAAAGACAATATTTTTATTACCTGACCA")); + //alignment.add("Consensus edit 1", new DNASequence("TAAGATACAACAAGGTTTCGGGCAACCTTATCCACGCAGTAAGGGGATCAGAGGTTTTTCTCTCATTCATGTATCGTGGATCAGTAAGGCAATTTTGCTACCCTGTCTGCTCTTTCTAGCATTTTACTAATGCCCCAGAAATTAGGAATAAAGATTTTATATGAAAGAAAGGGCGAATTAATTCATAAGGGACTGGTATCCATTCTTATTTGATTTGATACATTGTATCCATTAACATTACATTGGCGAATTGGGCGAAGGTGCGGAAAGAGAGGGATTCGAACCCTCGGTAAACAAAAGTCTACATAGCAGTTCCAATGCTACGCCTTGAACCACTCGGCCACCTCTCCTACATAAGGATTTTGGTCCCAAACCAAAAAGAGGGAGTTGTTCAAATTAGATTCTTAGGTAGGTCCGGACAACGAATTCAAATGAATAAGGTAAGGGGACATCCCCCCTCCCTCCCCTTTGTTTTTTTCTTTATTTGGTTAGGGCGGGGGACTCGACTCTTATTGAATTTTCATATGTATCACAGCTCGAAACGAAAGAACTCGTGGGGGGGTCGTTTCCTTTTTGGATCTTGAACGACTAGGTTCAAGAGATGAGAGAATTCAGGATACCCACAAGAAAGACTAATCCAATCCATAACGATGTACCAGAAAAGACAATATTTTTATTACCTGACCA")); + +// StringBuffer seqBuffer = new StringBuffer(pherogramProvider.getSequenceLength()); +// for (int i = 1; i <= pherogramProvider.getSequenceLength(); i++) { +// seqBuffer.append(pherogramProvider.getBaseCall(i).getUpperedBase()); +// } +// alignment.add("Sequence 4", new DNASequence("-----" + seqBuffer.substring(0, 38) + +// seqBuffer.substring(39, 49) + "--" + seqBuffer.substring(49))); // One A is deleted for shift change specified below. + + BioJavaSequenceDataProvider sequenceProvider = + new BioJavaSequenceDataProvider( + new BioJavaTokenSet( + AlignmentAmbiguityNucleotideCompoundSet.getAlignmentAmbiguityNucleotideCompoundSet(), true), + alignment); + + AlignmentArea result = new AlignmentArea(); + result.getContentArea().setSequenceProvider(sequenceProvider, false); + SequenceIndexArea sequenceIndexArea = new SequenceIndexArea(result.getContentArea()); + //sequenceIndexArea.setFirstIndex(5); + //sequenceIndexArea.setHeight(25); + result.getContentArea().getDataAreas().getTopAreas().add(sequenceIndexArea); + +// PherogramArea pherogramArea = new PherogramArea(result, pherogramProvider); +// pherogramArea.setFirstSeqPos(34 + 5); +// pherogramArea.setLeftCutPosition(34); +// pherogramArea.setRightCutPosition(820); +// pherogramArea.getAlignmentModel().setShiftChange(38, -1); +// pherogramArea.getAlignmentModel().setShiftChange(49, 2); +// result.getDataAreas().getSequenceAreas(sequenceProvider.sequenceIDByName("Sequence 4")).add(pherogramArea); + + PherogramProvider pherogramProvider = new BioJavaPherogramProvider(ChromatogramFactory.create( + new File("/home/pplitzner/svn/LibrAlign/taxeditor/eu.etaxonomy.taxeditor.editor/src/main/resources/AlignmentTestData/JR430_JR-P01.ab1"))); + PherogramArea pherogramArea = new PherogramArea(result.getContentArea(), pherogramProvider); + pherogramArea.setFirstSeqPos(1); + pherogramArea.setLeftCutPosition(13); + pherogramArea.setRightCutPosition(697); + pherogramArea.getAlignmentModel().setShiftChange(14, 1); + pherogramArea.getAlignmentModel().setShiftChange(35, 1); + result.getContentArea().getDataAreas().getSequenceAreas(sequenceProvider.sequenceIDByName("Read 1")).add(pherogramArea); + + pherogramProvider = new ReverseComplementPherogramProvider(new BioJavaPherogramProvider(ChromatogramFactory.create( + new File("/home/pplitzner/svn/LibrAlign/taxeditor/eu.etaxonomy.taxeditor.editor/src/main/resources/AlignmentTestData/JR444_JR-P05.ab1")))); + pherogramArea = new PherogramArea(result.getContentArea(), pherogramProvider); + pherogramArea.setFirstSeqPos(1); + pherogramArea.setLeftCutPosition(267); + pherogramArea.getAlignmentModel().setShiftChange(273, -1); + pherogramArea.setVerticalScale(20 * pherogramArea.getVerticalScale()); + result.getContentArea().getDataAreas().getSequenceAreas(sequenceProvider.sequenceIDByName("Read 2")).add(pherogramArea); + + + result.getContentArea().getDataAreas().getBottomAreas().add(new ConsensusSequenceArea(result.getContentArea())); + return result; + } + catch (Exception e) { + throw new RuntimeException(e); + } + +// Alignment alignment = +// new SimpleAlignment(); +// alignment.add("Sequence 1", new DNASequence("ATCGTAGATCGTAGATCGTAGATCGTAGATCGTAGATCGTAGATCGTAG")); +// alignment.add("Sequence 2", new DNASequence("AT-GTTG")); +// alignment.add("Sequence 3", new DNASequence("AT-GTAG")); +// +// BioJavaSequenceDataProvider sequenceProvider = +// new BioJavaSequenceDataProvider( +// new BioJavaTokenSet( +// AlignmentAmbiguityNucleotideCompoundSet.getAlignmentAmbiguityNucleotideCompoundSet()), +// alignment); +// +// AlignmentArea result = new AlignmentArea(); +// result.setSequenceProvider(sequenceProvider, false); +// SequenceIndexArea sequenceIndexArea = new SequenceIndexArea(result); +// //sequenceIndexArea.setFirstIndex(5); +// //sequenceIndexArea.setHeight(25); +// result.getDataAreas().getTopAreas().add(sequenceIndexArea); +// result.getDataAreas().getBottomAreas().add(new ConsensusSequenceArea(result)); +// return result; + } + + + /* (non-Javadoc) + * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite) + */ + @Override + public void createPartControl(Composite parent) { + alignmentArea = createAlignmentArea(); + Composite alignmentWidget = alignmentArea.createSWTWidget(parent, SWT.NONE); + //getSite().setSelectionProvider(provider) + } + + + /* (non-Javadoc) + * @see org.eclipse.ui.part.EditorPart#doSave(org.eclipse.core.runtime.IProgressMonitor) + */ + @Override + public void doSave(IProgressMonitor monitor) { + // TODO Auto-generated method stub + + } + + + /* (non-Javadoc) + * @see org.eclipse.ui.part.EditorPart#doSaveAs() + */ + @Override + public void doSaveAs() { + // TODO Auto-generated method stub + + } + + + /* (non-Javadoc) + * @see org.eclipse.ui.part.EditorPart#init(org.eclipse.ui.IEditorSite, org.eclipse.ui.IEditorInput) + */ + @Override + public void init(IEditorSite site, IEditorInput input) throws PartInitException { + setSite(site); + setInput(input); + } + + + /* (non-Javadoc) + * @see org.eclipse.ui.part.EditorPart#isDirty() + */ + @Override + public boolean isDirty() { + // TODO Auto-generated method stub + return false; + } + + + /* (non-Javadoc) + * @see org.eclipse.ui.part.EditorPart#isSaveAsAllowed() + */ + @Override + public boolean isSaveAsAllowed() { + // TODO Auto-generated method stub + return false; + } + + + /* (non-Javadoc) + * @see org.eclipse.ui.part.WorkbenchPart#setFocus() + */ + @Override + public void setFocus() { + //alignmentArea.getToolkitComponent().redistributeHeight(); + } +} diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/AlignmentEditorInput.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/AlignmentEditorInput.java new file mode 100644 index 000000000..9d25d6677 --- /dev/null +++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/AlignmentEditorInput.java @@ -0,0 +1,83 @@ +// $Id$ +/** +* Copyright (C) 2014 EDIT +* European Distributed Institute of Taxonomy +* http://www.e-taxonomy.eu +* +* The contents of this file are subject to the Mozilla Public License Version 1.1 +* See LICENSE.TXT at the top of this package for the full license terms. +*/ +package eu.etaxonomy.taxeditor.editor.molecular; + + +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.ui.IEditorInput; +import org.eclipse.ui.IPersistableElement; + + + +/** + * @author pplitzner + * @author Ben Stöver + * @date 04.08.2014 + */ +public class AlignmentEditorInput implements IEditorInput { + private static final String name = "AlignmentEditor"; + + + /* (non-Javadoc) + * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) + */ + @Override + public Object getAdapter(Class adapter) { + // TODO Auto-generated method stub + return null; + } + + + /* (non-Javadoc) + * @see org.eclipse.ui.IEditorInput#exists() + */ + @Override + public boolean exists() { + // TODO Auto-generated method stub + return false; + } + + + /* (non-Javadoc) + * @see org.eclipse.ui.IEditorInput#getImageDescriptor() + */ + @Override + public ImageDescriptor getImageDescriptor() { + // TODO Auto-generated method stub + return null; + } + + + /* (non-Javadoc) + * @see org.eclipse.ui.IEditorInput#getName() + */ + @Override + public String getName() { + return name; + } + + + /* (non-Javadoc) + * @see org.eclipse.ui.IEditorInput#getPersistable() + */ + @Override + public IPersistableElement getPersistable() { + return null; + } + + + /* (non-Javadoc) + * @see org.eclipse.ui.IEditorInput#getToolTipText() + */ + @Override + public String getToolTipText() { + return name; + } +} diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/CMDAlignmentObjectPlaceholder.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/CMDAlignmentObjectPlaceholder.java new file mode 100644 index 000000000..589b1c269 --- /dev/null +++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/CMDAlignmentObjectPlaceholder.java @@ -0,0 +1,76 @@ +package eu.etaxonomy.taxeditor.editor.molecular; + + +import info.bioinfweb.libralign.dataarea.implementations.pherogram.ShiftChange; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.TreeMap; + +import org.biojava3.core.sequence.compound.NucleotideCompound; +import org.biojava3.core.sequence.template.Sequence; + + + +/** + * This class is used as a replacement for a class representing the CMD objects storing an contig alignment during early + * development phase. + * + * @author Ben Stöver + * @date 06.08.2014 + */ +public class CMDAlignmentObjectPlaceholder { + /** + * Represents information in the contig alignment describing a single read sequence and the relation to its associated + * pherogram. + * + * @author Ben Stöver + * @date 06.08.2014 + */ + public static class Read { + private long pherogramObjectID = Long.MIN_VALUE; // The ID used in the CMD to identify the object storing the pherogram URL. (Dont' know if this is long, just as an example-) + private Sequence editableSequence = null; // Could also be of type String, if helpful for CDM architecture. + private List shiftChangeList = new ArrayList(); + + + public Read(long pherogramObjectID) { + super(); + this.pherogramObjectID = pherogramObjectID; + } + + + public long getPherogramObjectID() { + return pherogramObjectID; + } + + + public void setPherogramObjectID(long pherogramObjectID) { + this.pherogramObjectID = pherogramObjectID; + } + + + public List getShiftChangeList() { + return shiftChangeList; + } + + + public Sequence getEditableSequence() { + return editableSequence; + } + } + + + private Map> consensusSequences = new TreeMap>(); // Could also be of type Map, if helpful for CDM architecture. + private Map readSequences = new TreeMap(); + + + public Map> getConsensusSequences() { + return consensusSequences; + } + + + public Map getReadSequences() { + return readSequences; + } +} diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/ContigSequenceDataProvider.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/ContigSequenceDataProvider.java new file mode 100644 index 000000000..893b4eebf --- /dev/null +++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/ContigSequenceDataProvider.java @@ -0,0 +1,45 @@ +// $Id$ +/** +* Copyright (C) 2014 EDIT +* European Distributed Institute of Taxonomy +* http://www.e-taxonomy.eu +* +* The contents of this file are subject to the Mozilla Public License Version 1.1 +* See LICENSE.TXT at the top of this package for the full license terms. +*/ +package eu.etaxonomy.taxeditor.editor.molecular; + + +import org.biojava3.core.sequence.compound.NucleotideCompound; + +import info.bioinfweb.commons.bio.biojava3.core.sequence.compound.AlignmentAmbiguityDNACompoundSet; +import info.bioinfweb.libralign.sequenceprovider.SequenceDataProvider; +import info.bioinfweb.libralign.sequenceprovider.implementations.PackedSequenceDataProvider; +import info.bioinfweb.libralign.sequenceprovider.tokenset.BioJavaTokenSet; + + + +/** + * The LibrAlign sequence data provider used to edit contig alignments with the {@link AlignmentEditor}. + * + * @author Ben Stöver + * @date 04.08.2014 + */ +public class ContigSequenceDataProvider extends PackedSequenceDataProvider + implements SequenceDataProvider { + + + public ContigSequenceDataProvider() { + super(new BioJavaTokenSet(AlignmentAmbiguityDNACompoundSet.getAlignmentAmbiguityDNACompoundSet(), true)); + } + + + public void saveToCMD() { //TODO Add cmd node as parameter + //TODO impl. + } + + + public void loadFromCMD() { //TODO Add cmd node as parameter + //TODO impl. + } +} diff --git a/eu.etaxonomy.taxeditor.editor/src/main/resources/AlignmentTestData/JR430_JR-P01.ab1 b/eu.etaxonomy.taxeditor.editor/src/main/resources/AlignmentTestData/JR430_JR-P01.ab1 new file mode 100644 index 000000000..83a3be3b3 Binary files /dev/null and b/eu.etaxonomy.taxeditor.editor/src/main/resources/AlignmentTestData/JR430_JR-P01.ab1 differ diff --git a/eu.etaxonomy.taxeditor.editor/src/main/resources/AlignmentTestData/JR444_JR-P05.ab1 b/eu.etaxonomy.taxeditor.editor/src/main/resources/AlignmentTestData/JR444_JR-P05.ab1 new file mode 100644 index 000000000..be62c7cd5 Binary files /dev/null and b/eu.etaxonomy.taxeditor.editor/src/main/resources/AlignmentTestData/JR444_JR-P05.ab1 differ diff --git a/eu.etaxonomy.taxeditor.editor/src/main/resources/TestPherogram_qualityScore.scf b/eu.etaxonomy.taxeditor.editor/src/main/resources/TestPherogram_qualityScore.scf new file mode 100644 index 000000000..e680999a3 Binary files /dev/null and b/eu.etaxonomy.taxeditor.editor/src/main/resources/TestPherogram_qualityScore.scf differ diff --git a/eu.etaxonomy.taxeditor/.classpath b/eu.etaxonomy.taxeditor/.classpath index 7c95b583f..3446faf90 100644 --- a/eu.etaxonomy.taxeditor/.classpath +++ b/eu.etaxonomy.taxeditor/.classpath @@ -1,12 +1,12 @@ - - - - - - - - - - - - + + + + + + + + + + + +