From: b.stoever Date: Thu, 2 Jul 2015 11:11:16 +0000 (+0000) Subject: Adjustments to recent changes in LibrAlign. X-Git-Tag: 3.8.0^2~59^2~39 X-Git-Url: https://dev.e-taxonomy.eu/gitweb/taxeditor.git/commitdiff_plain/1f2cc436ff089bec5b5a97a9dc876d4667bbb83f Adjustments to recent changes in LibrAlign. (The additional project https://secure.bioinfweb.info/Code/svn/LibrAlign / trunk / main / info.bioinfweb.libralign.biojava1 needs to be in the workspace from now on.) --- diff --git a/.gitattributes b/.gitattributes index 8c999ebd7..3bddeb671 100644 --- a/.gitattributes +++ b/.gitattributes @@ -376,8 +376,6 @@ eu.etaxonomy.taxeditor.editor/icons/pherogram-insert-left-disabled-16x16.png -te eu.etaxonomy.taxeditor.editor/icons/pherogram-insert-right-16x16.png -text eu.etaxonomy.taxeditor.editor/icons/pherogram-insert-right-disabled-16x16.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 @@ -461,8 +459,6 @@ 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/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/CDMAlignmentObjectPlaceholder.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/molecular/PherogramMouseListener.java -text eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/PherogramViewPart.java -text eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/TaxonNameEditor.java -text diff --git a/eu.etaxonomy.taxeditor.editor/.classpath b/eu.etaxonomy.taxeditor.editor/.classpath index f227f6cae..9fcc4578c 100644 --- a/eu.etaxonomy.taxeditor.editor/.classpath +++ b/eu.etaxonomy.taxeditor.editor/.classpath @@ -5,8 +5,6 @@ - - @@ -16,5 +14,6 @@ + diff --git a/eu.etaxonomy.taxeditor.editor/.project b/eu.etaxonomy.taxeditor.editor/.project index 18951eb2b..d3dac54bd 100644 --- a/eu.etaxonomy.taxeditor.editor/.project +++ b/eu.etaxonomy.taxeditor.editor/.project @@ -36,6 +36,11 @@ 2 WORKSPACE_LOC/_Lib/bin + + lib/info.bioinfweb.libralign.biojava1 + 2 + WORKSPACE_LOC/info.bioinfweb.libralign.biojava1/bin + lib/info.bioinfweb.libralign.core 2 diff --git a/eu.etaxonomy.taxeditor.editor/META-INF/MANIFEST.MF b/eu.etaxonomy.taxeditor.editor/META-INF/MANIFEST.MF index 30660ab0a..c248ae626 100644 --- a/eu.etaxonomy.taxeditor.editor/META-INF/MANIFEST.MF +++ b/eu.etaxonomy.taxeditor.editor/META-INF/MANIFEST.MF @@ -178,8 +178,6 @@ Bundle-ClassPath: ., pdebuild.jar, compatibility.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/, @@ -188,4 +186,5 @@ Bundle-ClassPath: ., lib/info.bioinfweb.libralign.core/, lib/info.bioinfweb.libralign.swt/, lib/info.bioinfweb.tic.core/, - lib/info.bioinfweb.tic.swt/ + lib/info.bioinfweb.tic.swt/, + lib/info.bioinfweb.libralign.biojava1/ diff --git a/eu.etaxonomy.taxeditor.editor/build.properties b/eu.etaxonomy.taxeditor.editor/build.properties index efa5396fe..74507213e 100644 --- a/eu.etaxonomy.taxeditor.editor/build.properties +++ b/eu.etaxonomy.taxeditor.editor/build.properties @@ -7,8 +7,6 @@ bin.includes = META-INF/,\ p2.inf,\ OSGI-INF/l10n/plugin.properties,\ OSGI-INF/l10n/plugin_de.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/,\ @@ -17,4 +15,5 @@ bin.includes = META-INF/,\ lib/info.bioinfweb.libralign.core/,\ lib/info.bioinfweb.libralign.swt/,\ lib/info.bioinfweb.tic.core/,\ - lib/info.bioinfweb.tic.swt/ + lib/info.bioinfweb.tic.swt/,\ + lib/info.bioinfweb.libralign.biojava1/ 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 deleted file mode 100644 index e5f1d6bad..000000000 Binary files a/eu.etaxonomy.taxeditor.editor/lib/biojava3-alignment-3.0.7.jar and /dev/null 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 deleted file mode 100644 index c9f1f81f4..000000000 Binary files a/eu.etaxonomy.taxeditor.editor/lib/biojava3-core-3.0.7.jar and /dev/null differ 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 index 9ccc8261f..0308fe9f3 100644 --- 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 @@ -10,7 +10,6 @@ package eu.etaxonomy.taxeditor.editor.molecular; -import info.bioinfweb.jphyloio.events.TokenSetType; import info.bioinfweb.libralign.alignmentarea.AlignmentArea; import info.bioinfweb.libralign.alignmentarea.selection.SelectionModel; import info.bioinfweb.libralign.alignmentarea.tokenpainter.NucleotideTokenPainter; @@ -27,7 +26,7 @@ import info.bioinfweb.libralign.model.events.SequenceChangeEvent; import info.bioinfweb.libralign.model.events.SequenceRenamedEvent; import info.bioinfweb.libralign.model.events.TokenChangeEvent; import info.bioinfweb.libralign.model.implementations.PackedAlignmentModel; -import info.bioinfweb.libralign.model.tokenset.BioJavaTokenSet; +import info.bioinfweb.libralign.model.tokenset.CharacterTokenSet; import info.bioinfweb.libralign.model.tokenset.TokenSet; import info.bioinfweb.libralign.multiplealignments.AlignmentAreaList; import info.bioinfweb.libralign.multiplealignments.MultipleAlignmentsContainer; @@ -51,8 +50,6 @@ import java.util.TreeMap; import org.biojava.bio.chromatogram.ChromatogramFactory; import org.biojava.bio.chromatogram.UnsupportedChromatogramFormatException; -import org.biojava3.core.sequence.compound.DNACompoundSet; -import org.biojava3.core.sequence.compound.NucleotideCompound; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Composite; @@ -180,9 +177,8 @@ public class AlignmentEditor extends EditorPart { AlignmentArea result = new AlignmentArea(container); result.setAllowVerticalScrolling(allowVerticalScrolling); - TokenSet tokenSet = new BioJavaTokenSet( - TokenSetType.DNA, new DNACompoundSet(), true); //TODO Should NUCLEOTIDE be used instead? - AlignmentModel provider = new PackedAlignmentModel(tokenSet); + CharacterTokenSet tokenSet = CharacterTokenSet.newDNAInstance(); //TODO Should NUCLEOTIDE be used instead? + AlignmentModel provider = new PackedAlignmentModel(tokenSet); result.setAlignmentModel(provider, false); provider.getChangeListeners().add(DIRTY_LISTENER); result.getPaintSettings().getTokenPainterList().set(0, new NucleotideTokenPainter()); @@ -262,10 +258,10 @@ public class AlignmentEditor extends EditorPart { AlignmentModel consensusModel = getEditableConsensusArea().getAlignmentModel(); int id = consensusModel.addSequence(CONSENSUS_NAME); Collection tokens = new ArrayList(); // First save tokens in a collection to avoid GUI updated for each token. - tokens.add(consensusModel.getTokenSet().tokenByKeyChar('A')); - tokens.add(consensusModel.getTokenSet().tokenByKeyChar('C')); - tokens.add(consensusModel.getTokenSet().tokenByKeyChar('G')); - tokens.add(consensusModel.getTokenSet().tokenByKeyChar('T')); + tokens.add(consensusModel.getTokenSet().tokenByRepresentation("A")); + tokens.add(consensusModel.getTokenSet().tokenByRepresentation("C")); + tokens.add(consensusModel.getTokenSet().tokenByRepresentation("G")); + tokens.add(consensusModel.getTokenSet().tokenByRepresentation("T")); consensusModel.insertTokensAt(id, 0, tokens); } catch (Exception e) { @@ -635,7 +631,7 @@ public class AlignmentEditor extends EditorPart { public void addRead(URI pherogramURI, boolean reverseComplemented) throws IOException, UnsupportedChromatogramFormatException { - addRead(newReadName(), pherogramURI, reverseComplemented, null, 0, 0, 0, null); // Position values will be ignored, if shifts == null. + addRead(newReadName(), pherogramURI, reverseComplemented, null, null, null, null, null); } @@ -681,8 +677,8 @@ public class AlignmentEditor extends EditorPart { else if (pherogramProvider != null) { // Copy base call sequence into alignment: tokens = new ArrayList(); for (int i = 0; i < pherogramProvider.getSequenceLength(); i++) { - tokens.add(provider.getTokenSet().tokenByKeyChar( - pherogramProvider.getBaseCall(i).getUpperedBase().charAt(0))); + tokens.add(provider.getTokenSet().tokenByRepresentation( + Character.toString(pherogramProvider.getBaseCall(i)))); } setDirty(); } diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/CDMAlignmentObjectPlaceholder.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/CDMAlignmentObjectPlaceholder.java deleted file mode 100644 index 8cd3edb5c..000000000 --- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/CDMAlignmentObjectPlaceholder.java +++ /dev/null @@ -1,98 +0,0 @@ -package eu.etaxonomy.taxeditor.editor.molecular; - - -import info.bioinfweb.libralign.pherogram.model.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 CDMAlignmentObjectPlaceholder { - /** - * 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 final Sequence editableSequence = null; // Could also be of type String, if helpful for CDM architecture. - private final List shiftChangeList = new ArrayList(); - private String readName = ""; - private boolean reverseComplemeted = false; - - - 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; - } - - - public String getReadName() { - return readName; - } - - - public void setReadName(String readName) { - this.readName = readName; - } - - - public boolean isReverseComplemeted() { - return reverseComplemeted; - } - - - public void setReverseComplemeted(boolean reverseComplemeted) { - this.reverseComplemeted = reverseComplemeted; - } - } - - - private final Map> consensusSequences = new TreeMap>(); // Could also be of type Map, if helpful for CDM architecture. - private final 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 deleted file mode 100644 index 2139f628f..000000000 --- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/ContigSequenceDataProvider.java +++ /dev/null @@ -1,47 +0,0 @@ -// $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.jphyloio.events.TokenSetType; -import info.bioinfweb.libralign.model.AlignmentModel; -import info.bioinfweb.libralign.model.implementations.PackedAlignmentModel; -import info.bioinfweb.libralign.model.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 PackedAlignmentModel - implements AlignmentModel { - - - public ContigSequenceDataProvider() { - super(new BioJavaTokenSet(TokenSetType.NUCLEOTIDE, - 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. - } -}