Some actions for adjusting pherogram displaying added.
authorb.stoever <b.stoever@localhost>
Tue, 23 Jun 2015 15:58:31 +0000 (15:58 +0000)
committerb.stoever <b.stoever@localhost>
Tue, 23 Jun 2015 15:58:31 +0000 (15:58 +0000)
.gitattributes
eu.etaxonomy.taxeditor.editor/plugin.xml
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/AbstractPherogramComponentHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ChangePherogramQualityOutputType.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ToggleShowPherogramBaseCallLinesHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ToggleShowPherogramProbabilitiesHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/AlignmentEditor.java
eu.etaxonomy.taxeditor.editor/src/main/resources/AlignmentTestData/Test_qualityScore.scf [new file with mode: 0644]

index 07f5c4e..7c5bea0 100644 (file)
@@ -420,12 +420,16 @@ eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handle
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/SpecimenPropertyTester.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/TaxonParameterConverter.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/AbstractAlignmentEditorHandler.java -text svneol=unset#text/plain
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/AbstractPherogramComponentHandler.java -text svneol=unset#text/plain
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ChangePherogramQualityOutputType.java -text svneol=unset#text/plain
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/CreateConsensusSequenceHandler.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/CutPherogramLeftHandler.java -text svneol=unset#text/plain
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/CutPherogramRightHandler.java -text svneol=unset#text/plain
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ReverseComplementHandler.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ToggleInsertOverwriteHandler.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ToggleLeftRightInsertionHandler.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ToggleShowPherogramBaseCallLinesHandler.java -text svneol=unset#text/plain
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ToggleShowPherogramProbabilitiesHandler.java -text svneol=unset#text/plain
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/UpdateConsensusSequenceHandler.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/package-info.java -text svneol=unset#text/plain
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/create/NewNameHandler.java -text
@@ -652,6 +656,7 @@ eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/v
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/validation/ValidatorMessageMarkerField.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/AlignmentTestData/Test_qualityScore.scf -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
index 9b1edc9..d16220b 100644 (file)
             allPopups="false"
             locationURI="menu:org.eclipse.ui.main.menu">
          <menu
+               label="View">
+            <menu
+                  label="Pherogram">
+               <command
+                     commandId="eu.etaxonomy.taxeditor.editor.molecular.pherogramComponent.changeQualityOutput"
+                     style="push">
+               </command>
+               <command
+                     commandId="eu.etaxonomy.taxeditor.editor.molecular.pherogramComponent.toggleShowProbabilities"
+                     style="push">
+               </command>
+               <command
+                     commandId="eu.etaxonomy.taxeditor.editor.molecular.pherogramComponent.toggleShowBaseCallLines"
+                     style="push">
+               </command>
+               <visibleWhen
+                     checkEnabled="true">
+                  <with
+                        variable="activePartId">
+                     <or>
+                        <equals
+                              value="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor">
+                        </equals>
+                        <equals
+                              value="eu.etaxonomy.taxeditor.editor.molecular.PherogramView">
+                        </equals>
+                     </or>
+                  </with>
+               </visibleWhen>
+            </menu>
+         </menu>
+         <menu
                label="Alignment Editor">
             <command
                   commandId="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor.loadPherogram"
             class="eu.etaxonomy.taxeditor.editor.handler.alignmenteditor.UpdateConsensusSequenceHandler"
             commandId="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor.updateConsensus">
       </handler>
+      <handler
+            class="eu.etaxonomy.taxeditor.editor.handler.alignmenteditor.ToggleShowPherogramProbabilitiesHandler"
+            commandId="eu.etaxonomy.taxeditor.editor.molecular.pherogramComponent.toggleShowProbabilities">
+      </handler>
+      <handler
+            class="eu.etaxonomy.taxeditor.editor.handler.alignmenteditor.ToggleShowPherogramBaseCallLinesHandler"
+            commandId="eu.etaxonomy.taxeditor.editor.molecular.pherogramComponent.toggleShowBaseCallLines">
+      </handler>
+      <handler
+            class="eu.etaxonomy.taxeditor.editor.handler.alignmenteditor.ChangePherogramQualityOutputType"
+            commandId="eu.etaxonomy.taxeditor.editor.molecular.pherogramComponent.changeQualityOutput">
+      </handler>
    </extension>
    <extension
          name="%extension.name"
             id="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor.updateConsensus"
             name="Update consensus sequence">
       </command>
+      <command
+            id="eu.etaxonomy.taxeditor.editor.molecular.pherogramComponent.toggleShowProbabilities"
+            name="Toggle show probability values">
+      </command>
+      <command
+            id="eu.etaxonomy.taxeditor.editor.molecular.pherogramComponent.toggleShowBaseCallLines"
+            name="Toggle show base call lines">
+      </command>
+      <command
+            id="eu.etaxonomy.taxeditor.editor.molecular.pherogramComponent.changeQualityOutput"
+            name="Change quality output">
+      </command>
    </extension>
    <extension
          point="org.eclipse.core.expressions.definitions">
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/AbstractPherogramComponentHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/AbstractPherogramComponentHandler.java
new file mode 100644 (file)
index 0000000..e7b92d6
--- /dev/null
@@ -0,0 +1,60 @@
+// $Id$\r
+/**\r
+* Copyright (C) 2015 EDIT\r
+* European Distributed Institute of Taxonomy\r
+* http://www.e-taxonomy.eu\r
+*\r
+* The contents of this file are subject to the Mozilla Public License Version 1.1\r
+* See LICENSE.TXT at the top of this package for the full license terms.\r
+*/\r
+package eu.etaxonomy.taxeditor.editor.handler.alignmenteditor;\r
+\r
+\r
+import info.bioinfweb.libralign.alignmentarea.AlignmentArea;\r
+import info.bioinfweb.libralign.dataarea.implementations.pherogram.PherogramArea;\r
+import info.bioinfweb.libralign.pherogram.PherogramComponent;\r
+\r
+import java.util.Iterator;\r
+\r
+import org.eclipse.core.commands.AbstractHandler;\r
+import org.eclipse.core.commands.ExecutionEvent;\r
+import org.eclipse.core.commands.ExecutionException;\r
+import org.eclipse.ui.IWorkbenchPart;\r
+\r
+import eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor;\r
+import eu.etaxonomy.taxeditor.editor.molecular.PherogramViewPart;\r
+import eu.etaxonomy.taxeditor.model.AbstractUtility;\r
+\r
+\r
+\r
+/**\r
+ * Abstract handler implementation allows to performs the concrete operation either on an instance of\r
+ * {@link PherogramViewPart} or all {@link AlignmentArea}s inside an instance of {@link AlignmentEditor}.\r
+ *\r
+ * @author Ben Stöver\r
+ * @date 23.06.2015\r
+ */\r
+public abstract class AbstractPherogramComponentHandler extends AbstractHandler {\r
+    @Override\r
+    public Object execute(ExecutionEvent event) throws ExecutionException {\r
+        IWorkbenchPart activePart = AbstractUtility.getActivePart();\r
+\r
+        if (activePart instanceof AlignmentEditor) {\r
+            AlignmentEditor editor = (AlignmentEditor)activePart;\r
+            Iterator<Integer> idIterator = editor.getReadsArea().getAlignmentModel().sequenceIDIterator();\r
+            while (idIterator.hasNext()) {\r
+                PherogramArea area = editor.getPherogramArea(idIterator.next());\r
+                if (area != null) {\r
+                    doExecute(event, area);\r
+                }\r
+            }\r
+        }\r
+        else if (activePart instanceof PherogramViewPart) {\r
+            doExecute(event, ((PherogramViewPart)activePart).getPherogramView().getTraceCurveView());\r
+        }\r
+        return null;\r
+    }\r
+\r
+\r
+    public abstract void doExecute(ExecutionEvent event, PherogramComponent component) throws ExecutionException;\r
+}\r
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ChangePherogramQualityOutputType.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ChangePherogramQualityOutputType.java
new file mode 100644 (file)
index 0000000..18fc06f
--- /dev/null
@@ -0,0 +1,31 @@
+// $Id$\r
+/**\r
+* Copyright (C) 2015 EDIT\r
+* European Distributed Institute of Taxonomy\r
+* http://www.e-taxonomy.eu\r
+*\r
+* The contents of this file are subject to the Mozilla Public License Version 1.1\r
+* See LICENSE.TXT at the top of this package for the full license terms.\r
+*/\r
+package eu.etaxonomy.taxeditor.editor.handler.alignmenteditor;\r
+\r
+\r
+import info.bioinfweb.libralign.pherogram.PherogramComponent;\r
+\r
+import org.eclipse.core.commands.ExecutionEvent;\r
+import org.eclipse.core.commands.ExecutionException;\r
+\r
+\r
+\r
+/**\r
+ * Switches between the quality output types available for components displaying pherograms.\r
+ *\r
+ * @author Ben Stöver\r
+ * @date 19.06.2015\r
+ */\r
+public class ChangePherogramQualityOutputType extends AbstractPherogramComponentHandler {\r
+    @Override\r
+    public void doExecute(ExecutionEvent event, PherogramComponent component) throws ExecutionException {\r
+        component.getFormats().changeQualityOutputType();\r
+    }\r
+}\r
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ToggleShowPherogramBaseCallLinesHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ToggleShowPherogramBaseCallLinesHandler.java
new file mode 100644 (file)
index 0000000..43ceb31
--- /dev/null
@@ -0,0 +1,30 @@
+// $Id$\r
+/**\r
+* Copyright (C) 2015 EDIT\r
+* European Distributed Institute of Taxonomy\r
+* http://www.e-taxonomy.eu\r
+*\r
+* The contents of this file are subject to the Mozilla Public License Version 1.1\r
+* See LICENSE.TXT at the top of this package for the full license terms.\r
+*/\r
+package eu.etaxonomy.taxeditor.editor.handler.alignmenteditor;\r
+\r
+\r
+import info.bioinfweb.libralign.pherogram.PherogramComponent;\r
+\r
+import org.eclipse.core.commands.ExecutionEvent;\r
+import org.eclipse.core.commands.ExecutionException;\r
+\r
+\r
+\r
+/**\r
+ * @author BenStoever\r
+ * @date 23.06.2015\r
+ *\r
+ */\r
+public class ToggleShowPherogramBaseCallLinesHandler extends AbstractPherogramComponentHandler {\r
+    @Override\r
+    public void doExecute(ExecutionEvent event, PherogramComponent component) throws ExecutionException {\r
+        component.getFormats().toggleShowBaseCallLines();\r
+    }\r
+}\r
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ToggleShowPherogramProbabilitiesHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ToggleShowPherogramProbabilitiesHandler.java
new file mode 100644 (file)
index 0000000..41b03a0
--- /dev/null
@@ -0,0 +1,35 @@
+// $Id$\r
+/**\r
+* Copyright (C) 2015 EDIT\r
+* European Distributed Institute of Taxonomy\r
+* http://www.e-taxonomy.eu\r
+*\r
+* The contents of this file are subject to the Mozilla Public License Version 1.1\r
+* See LICENSE.TXT at the top of this package for the full license terms.\r
+*/\r
+package eu.etaxonomy.taxeditor.editor.handler.alignmenteditor;\r
+\r
+\r
+import info.bioinfweb.libralign.pherogram.PherogramComponent;\r
+\r
+import org.eclipse.core.commands.ExecutionEvent;\r
+import org.eclipse.core.commands.ExecutionException;\r
+\r
+import eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor;\r
+import eu.etaxonomy.taxeditor.editor.molecular.PherogramViewPart;\r
+\r
+\r
+\r
+/**\r
+ * Toggles whether probability values (substitution, overcall and undercall) should be displayed\r
+ * in pherogram areas of {@link AlignmentEditor} or {@link PherogramViewPart}.\r
+ *\r
+ * @author Ben Stöver\r
+ * @date 23.06.2015\r
+ */\r
+public class ToggleShowPherogramProbabilitiesHandler extends AbstractPherogramComponentHandler {\r
+    @Override\r
+    public void doExecute(ExecutionEvent event, PherogramComponent component) throws ExecutionException {\r
+        component.getFormats().toggleShowProbabilityValues();\r
+    }\r
+}\r
index 48b7c7f..c17ffa4 100644 (file)
@@ -217,7 +217,7 @@ public class AlignmentEditor extends EditorPart {
        }
 
 
-    private AlignmentArea getReadsArea() {
+    public AlignmentArea getReadsArea() {
        return getAlignmentsContainer().getAlignmentAreas().get(READS_AREA_INDEX);
     }
 
@@ -227,7 +227,7 @@ public class AlignmentEditor extends EditorPart {
     }
 
 
-    private PherogramArea getPherogramArea(int sequenceID) {
+    public PherogramArea getPherogramArea(int sequenceID) {
        return (PherogramArea)getReadsArea().getDataAreas().getSequenceAreas(sequenceID).get(
                PHEROGRAM_AREA_INDEX);
     }
@@ -244,7 +244,8 @@ public class AlignmentEditor extends EditorPart {
                // Just for testing:
                try {
                        addRead(new File("D:/Users/BenStoever/ownCloud/Dokumente/Projekte/EDITor/Quelltexte/LibrAlign branch/Repository/eu.etaxonomy.taxeditor.editor/src/main/resources/AlignmentTestData/JR430_JR-P01.ab1").toURI(), false);
-                       addRead(new File("D:/Users/BenStoever/ownCloud/Dokumente/Projekte/EDITor/Quelltexte/LibrAlign branch/Repository/eu.etaxonomy.taxeditor.editor/src/main/resources/AlignmentTestData/JR444_JR-P05.ab1").toURI(), false);
+            //addRead(new File("D:/Users/BenStoever/ownCloud/Dokumente/Projekte/EDITor/Quelltexte/LibrAlign branch/Repository/eu.etaxonomy.taxeditor.editor/src/main/resources/AlignmentTestData/JR444_JR-P05.ab1").toURI(), false);
+            addRead(new File("D:/Users/BenStoever/ownCloud/Dokumente/Projekte/EDITor/Quelltexte/LibrAlign branch/Repository/eu.etaxonomy.taxeditor.editor/src/main/resources/AlignmentTestData/Test_qualityScore.scf").toURI(), false);
 
                        // Add test consensus sequence:
                        AlignmentModel consensusModel = getEditableConsensusArea().getAlignmentModel();
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/resources/AlignmentTestData/Test_qualityScore.scf b/eu.etaxonomy.taxeditor.editor/src/main/resources/AlignmentTestData/Test_qualityScore.scf
new file mode 100644 (file)
index 0000000..e680999
Binary files /dev/null and b/eu.etaxonomy.taxeditor.editor/src/main/resources/AlignmentTestData/Test_qualityScore.scf differ