Project

General

Profile

Revision c3a66f55

IDc3a66f5584db1d5e090b7410a2853ad802fde359
Parent f65a3304
Child 6829d79d

Added by Ben Stöver about 7 years ago

Example in AlignmentEditor changed to a more realistic case.

View differences:

.gitattributes
429 429
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/AlignmentEditor.java -text
430 430
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/AlignmentEditorInput.java -text
431 431
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/CMDAlignmentObjectPlaceholder.java -text
432
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/ContigSequenceDataProvider.java -text
432 433
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/TaxonNameEditor.java -text
433 434
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/container/AbstractGroup.java -text
434 435
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/container/AbstractGroupedContainer.java -text
......
598 599
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/uses/operation/CreateTaxonUseOperation.java -text
599 600
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/uses/operation/CreateUseRecordOperation.java -text
600 601
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/uses/operation/CreateUseSummaryOperation.java -text
602
eu.etaxonomy.taxeditor.editor/src/main/resources/AlignmentTestData/JR430_JR-P01.ab1 -text
603
eu.etaxonomy.taxeditor.editor/src/main/resources/AlignmentTestData/JR444_JR-P05.ab1 -text
601 604
eu.etaxonomy.taxeditor.editor/src/main/resources/TaonDescriptionEditor.screen -text
602 605
eu.etaxonomy.taxeditor.editor/src/main/resources/TestPherogram_qualityScore.scf -text
603 606
eu.etaxonomy.taxeditor.editor/src/main/resources/log4j.properties -text
eu.etaxonomy.taxeditor.editor/.project
1
<?xml version="1.0" encoding="UTF-8"?>
2
<projectDescription>
3
	<name>eu.etaxonomy.taxeditor.editor</name>
4
	<comment>NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>
5
	<projects>
6
	</projects>
7
	<buildSpec>
8
		<buildCommand>
9
			<name>org.eclipse.jdt.core.javabuilder</name>
10
			<arguments>
11
			</arguments>
12
		</buildCommand>
13
		<buildCommand>
14
			<name>org.eclipse.pde.ManifestBuilder</name>
15
			<arguments>
16
			</arguments>
17
		</buildCommand>
18
		<buildCommand>
19
			<name>org.eclipse.pde.SchemaBuilder</name>
20
			<arguments>
21
			</arguments>
22
		</buildCommand>
23
	</buildSpec>
24
	<natures>
25
		<nature>org.eclipse.jdt.core.javanature</nature>
26
		<nature>org.eclipse.pde.PluginNature</nature>
27
	</natures>
28
	<linkedResources>
29
		<link>
30
			<name>lib/LibrAlign</name>
31
			<type>2</type>
32
			<location>/home/pplitzner/svn/LibrAlign/LibrAlign/main/bin</location>
33
		</link>
34
		<link>
35
			<name>lib/bioinfweb.commons</name>
36
			<type>2</type>
37
			<location>/home/pplitzner/svn/LibrAlign/commons/main/bin</location>
38
		</link>
39
	</linkedResources>
40
</projectDescription>
1
<?xml version="1.0" encoding="UTF-8"?>
2
<projectDescription>
3
	<name>eu.etaxonomy.taxeditor.editor</name>
4
	<comment>NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>
5
	<projects>
6
	</projects>
7
	<buildSpec>
8
		<buildCommand>
9
			<name>org.eclipse.jdt.core.javabuilder</name>
10
			<arguments>
11
			</arguments>
12
		</buildCommand>
13
		<buildCommand>
14
			<name>org.eclipse.pde.ManifestBuilder</name>
15
			<arguments>
16
			</arguments>
17
		</buildCommand>
18
		<buildCommand>
19
			<name>org.eclipse.pde.SchemaBuilder</name>
20
			<arguments>
21
			</arguments>
22
		</buildCommand>
23
	</buildSpec>
24
	<natures>
25
		<nature>org.eclipse.jdt.core.javanature</nature>
26
		<nature>org.eclipse.pde.PluginNature</nature>
27
	</natures>
28
	<linkedResources>
29
		<link>
30
			<name>lib/LibrAlign</name>
31
			<type>2</type>
32
			<locationURI>WORKSPACE_LOC/LibrAlign/bin</locationURI>
33
		</link>
34
		<link>
35
			<name>lib/bioinfweb.commons</name>
36
			<type>2</type>
37
			<locationURI>WORKSPACE_LOC/_Lib/bin</locationURI>
38
		</link>
39
	</linkedResources>
40
</projectDescription>
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/AlignmentEditor.java
20 20
import info.bioinfweb.libralign.dataarea.implementations.SequenceIndexArea;
21 21
import info.bioinfweb.libralign.dataarea.implementations.pherogram.PherogramArea;
22 22
import info.bioinfweb.libralign.pherogram.BioJavaPherogramProvider;
23
import info.bioinfweb.libralign.pherogram.PherogramProvider;
24
import info.bioinfweb.libralign.pherogram.ReverseComplementPherogramProvider;
23 25
import info.bioinfweb.libralign.sequenceprovider.implementations.BioJavaSequenceDataProvider;
24 26
import info.bioinfweb.libralign.sequenceprovider.tokenset.BioJavaTokenSet;
25 27

  
......
59 61
			//ResourcesPlugin.getWorkspace().getRoot().getFile("/eu.etaxonomy.taxeditor.editor/src/main/resources/TestPherogram_qualityScore.scf");
60 62
			//System.out.println(AlignmentEditor.class.getResource("/"));
61 63
			//System.out.println(AlignmentEditor.class.getResource("/../resources/TestPherogram_qualityScore.scf"));
62
			BioJavaPherogramProvider pherogramProvider = new BioJavaPherogramProvider(ChromatogramFactory.create(
63
					new File("D:\\Users\\BenStoever\\Documents\\Studium\\Projekte\\Promotion\\EDITor\\Quelltexte\\LibrAlign branch\\Repository\\eu.etaxonomy.taxeditor.editor\\src\\main\\resources\\TestPherogram_qualityScore.scf")));
64
//			BioJavaPherogramProvider pherogramProvider = new BioJavaPherogramProvider(ChromatogramFactory.create(
65
//					new File("D:\\Users\\BenStoever\\Documents\\Studium\\Projekte\\Promotion\\EDITor\\Quelltexte\\LibrAlign branch\\Repository\\eu.etaxonomy.taxeditor.editor\\src\\main\\resources\\TestPherogram_qualityScore.scf")));
64 66
		    //TODO Replace this absolute path with a path working with every workspace location.
65 67
			
66 68
			Alignment<DNASequence, NucleotideCompound> alignment = 
67 69
					new SimpleAlignment<DNASequence, NucleotideCompound>();
68
			alignment.add("Sequence 1", new DNASequence("ATCGTAGATCGTAGATCGTAGATCGTAGATCGTAGATCGTAGATCGTAG"));
69
			alignment.add("Sequence 2", new DNASequence("AT-GTTG"));
70
			alignment.add("Sequence 3", new DNASequence("AT-GTAG"));
70
			alignment.add("Read 1", new DNASequence("TAAGATACAACAAGGTTTCGGGCA-CCTTATCCACGCAGTAAGGGGATCAGAGGTTTTTCTCTCATTCATGTATCGTGGATCAGTAAGGCAATTTTGCTACCCTGTCTGCTCTTTCTAGCATTTTACTAATGCCCCAGAAATTAGGAATAAAGATTTTATATGAAAGAAAGGGCGAATTAATTCATAAGGGACTGGTATCCATTCTTATTTGATTTGATACATTGTATCCATTAACATTACATTGGCGAATTGGGCGAAGGTGCGGAAAGAGAGGGATTCGAACCCTCGGTAAACAAAAGTCTACATAGCAGTTCCAATGCTACGCCTTGAACCACTCGGCCACCTCTCCTACATAAGGATTTTGGTCCCAAACCAAAAAGAGGGAGTTGTTCAAATTAGATTCTTAGGTAGGTCCGGACAACGAATTCAAATGAATAAGGTAAGGGGACATCCCCCCTCCCTCCCCTTTGTTTTTTTCTTTATTTGGTTAGGGCGGGGGACTCGACTCTTATTGAATTTTCATATGTATCACAGCTCGAAACGAAAGAACTCGTGGGGGGGTCGTTTCCTTTTTGGATCTTGAACGACTAGGTTCAAGAGATGAGAGAATTCAGGATACCCACAAGAAAGACTAATCCAATCCATAACGATGTACCAGAAAAGACAATATTTTTATTACCTGACCA"));
71
			alignment.add("Read 2", new DNASequence("TAAGATACAACAAGGTTTCGGGCAACCTTATCCACGCAGTAAGGGGATCAGAGGTTTTTCTCTCATTCATGTATCGTGGATCAGTAAGGCAATTTTGCTACCCTGTCTGCTCTTTCTAGCATTTTACTAATGCCCCAGAAATTAGGAATAAAGATTTTATATGAAAGAAAGGGCGAATTAATTCATAAGGGACTGGTATCCATTCTTATTTGATTTGATACATTGTATCCATTAACATTACATTGGCGAATTGGGCGAAGGTGCGGAAAGAGAGGGATTCGAACCCTCGGTAAACAAAAGTCTACATAGCAGTTCCAATGCTACGCCTTGAACCACTCGGCCACCTCTCCTACATAAGGATTTTGGTCCCAAACCAAAAAGAGGGAGTTGTTCAAATTAGATTCTTAGGTAGGTCCGGACAACGAATTCAAATGAATAAGGTAAGGGGACATCCCCCCTCCCTCCCCTTTGTTTTTTTCTTTATTTGGTTAGGGCGGGGGACTCGACTCTTATTGAATTTTCATATGTATCACAGCTCGAAACGAAAGAACTCGTGGGGGGGTCGTTTCCTTTTTGGATCTTGAACGACTAGGTTCAAGAGATGAGAGAATTCAGGATACCCACAAGAAAGACTAATCCAATCCATAACGATGTACCAGAAAAGACAATATTTTTATTACCTGACCA"));
72
			//alignment.add("Consensus edit 1", new DNASequence("TAAGATACAACAAGGTTTCGGGCAACCTTATCCACGCAGTAAGGGGATCAGAGGTTTTTCTCTCATTCATGTATCGTGGATCAGTAAGGCAATTTTGCTACCCTGTCTGCTCTTTCTAGCATTTTACTAATGCCCCAGAAATTAGGAATAAAGATTTTATATGAAAGAAAGGGCGAATTAATTCATAAGGGACTGGTATCCATTCTTATTTGATTTGATACATTGTATCCATTAACATTACATTGGCGAATTGGGCGAAGGTGCGGAAAGAGAGGGATTCGAACCCTCGGTAAACAAAAGTCTACATAGCAGTTCCAATGCTACGCCTTGAACCACTCGGCCACCTCTCCTACATAAGGATTTTGGTCCCAAACCAAAAAGAGGGAGTTGTTCAAATTAGATTCTTAGGTAGGTCCGGACAACGAATTCAAATGAATAAGGTAAGGGGACATCCCCCCTCCCTCCCCTTTGTTTTTTTCTTTATTTGGTTAGGGCGGGGGACTCGACTCTTATTGAATTTTCATATGTATCACAGCTCGAAACGAAAGAACTCGTGGGGGGGTCGTTTCCTTTTTGGATCTTGAACGACTAGGTTCAAGAGATGAGAGAATTCAGGATACCCACAAGAAAGACTAATCCAATCCATAACGATGTACCAGAAAAGACAATATTTTTATTACCTGACCA"));
71 73
			
72
			StringBuffer seqBuffer = new StringBuffer(pherogramProvider.getSequenceLength());
73
			for (int i = 1; i <= pherogramProvider.getSequenceLength(); i++) {
74
				seqBuffer.append(pherogramProvider.getBaseCall(i).getUpperedBase());
75
			}
76
			alignment.add("Sequence 4", new DNASequence("-----" + seqBuffer.substring(0, 38) + 
77
					seqBuffer.substring(39, 49) + "--" + seqBuffer.substring(49)));  // One A is deleted for shift change specified below. 
74
//			StringBuffer seqBuffer = new StringBuffer(pherogramProvider.getSequenceLength());
75
//			for (int i = 1; i <= pherogramProvider.getSequenceLength(); i++) {
76
//				seqBuffer.append(pherogramProvider.getBaseCall(i).getUpperedBase());
77
//			}
78
//			alignment.add("Sequence 4", new DNASequence("-----" + seqBuffer.substring(0, 38) + 
79
//					seqBuffer.substring(39, 49) + "--" + seqBuffer.substring(49)));  // One A is deleted for shift change specified below. 
78 80
			
79 81
			BioJavaSequenceDataProvider<DNASequence, NucleotideCompound> sequenceProvider = 
80 82
					new BioJavaSequenceDataProvider<DNASequence, NucleotideCompound>(
......
89 91
			//sequenceIndexArea.setHeight(25);
90 92
			result.getDataAreas().getTopAreas().add(sequenceIndexArea);
91 93
			
94
//			PherogramArea pherogramArea = new PherogramArea(result, pherogramProvider);
95
//			pherogramArea.setFirstSeqPos(34 + 5);
96
//			pherogramArea.setLeftCutPosition(34);
97
//			pherogramArea.setRightCutPosition(820);
98
//			pherogramArea.getAlignmentModel().setShiftChange(38, -1);
99
//			pherogramArea.getAlignmentModel().setShiftChange(49, 2);
100
//			result.getDataAreas().getSequenceAreas(sequenceProvider.sequenceIDByName("Sequence 4")).add(pherogramArea);
101

  
102
			PherogramProvider pherogramProvider = new BioJavaPherogramProvider(ChromatogramFactory.create(
103
				    new File("D:\\Users\\BenStoever\\Documents\\Studium\\Projekte\\Promotion\\EDITor\\Quelltexte\\LibrAlign branch\\Repository\\eu.etaxonomy.taxeditor.editor\\src\\main\\resources\\AlignmentTestData\\JR430_JR-P01.ab1")));
92 104
			PherogramArea pherogramArea = new PherogramArea(result, pherogramProvider);
93
			pherogramArea.setFirstSeqPos(34 + 5);
94
			pherogramArea.setLeftCutPosition(34);
95
			pherogramArea.setRightCutPosition(820);
96
			pherogramArea.getAlignmentModel().setShiftChange(38, -1);
97
			pherogramArea.getAlignmentModel().setShiftChange(49, 2);
98
			result.getDataAreas().getSequenceAreas(sequenceProvider.sequenceIDByName("Sequence 4")).add(pherogramArea);
99
			
100
			result.getDataAreas().getBottomAreas().add(new ConsensusSequenceArea(result));
105
			pherogramArea.setFirstSeqPos(1);
106
			pherogramArea.setLeftCutPosition(13);
107
			pherogramArea.setRightCutPosition(697);
108
			pherogramArea.getAlignmentModel().setShiftChange(14, 1);
109
			pherogramArea.getAlignmentModel().setShiftChange(35, 1);
110
			result.getDataAreas().getSequenceAreas(sequenceProvider.sequenceIDByName("Read 1")).add(pherogramArea);
111

  
112
	  		pherogramProvider = new ReverseComplementPherogramProvider(new BioJavaPherogramProvider(ChromatogramFactory.create(
113
  				new File("D:\\Users\\BenStoever\\Documents\\Studium\\Projekte\\Promotion\\EDITor\\Quelltexte\\LibrAlign branch\\Repository\\eu.etaxonomy.taxeditor.editor\\src\\main\\resources\\AlignmentTestData\\JR444_JR-P05.ab1"))));
114
			pherogramArea = new PherogramArea(result, pherogramProvider);
115
			pherogramArea.setFirstSeqPos(1);
116
			pherogramArea.setLeftCutPosition(267);
117
			pherogramArea.getAlignmentModel().setShiftChange(273, -1);
118
			pherogramArea.setVerticalScale(20 * pherogramArea.getVerticalScale());
119
			result.getDataAreas().getSequenceAreas(sequenceProvider.sequenceIDByName("Read 2")).add(pherogramArea);
120

  
121
	  		
122
	  	    result.getDataAreas().getBottomAreas().add(new ConsensusSequenceArea(result));
101 123
			return result;
102 124
		}
103 125
		catch (Exception e) {
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/ContigSequenceDataProvider.java
1
// $Id$
2
/**
3
* Copyright (C) 2014 EDIT
4
* European Distributed Institute of Taxonomy
5
* http://www.e-taxonomy.eu
6
*
7
* The contents of this file are subject to the Mozilla Public License Version 1.1
8
* See LICENSE.TXT at the top of this package for the full license terms.
9
*/
10
package eu.etaxonomy.taxeditor.editor.molecular;
11

  
12

  
13
import org.biojava3.core.sequence.compound.NucleotideCompound;
14

  
15
import info.bioinfweb.commons.bio.biojava3.core.sequence.compound.AlignmentAmbiguityDNACompoundSet;
16
import info.bioinfweb.libralign.sequenceprovider.SequenceDataProvider;
17
import info.bioinfweb.libralign.sequenceprovider.implementations.PackedSequenceDataProvider;
18
import info.bioinfweb.libralign.sequenceprovider.tokenset.BioJavaTokenSet;
19

  
20

  
21

  
22
/**
23
 * The LibrAlign sequence data provider used to edit contig alignments with the {@link AlignmentEditor}.
24
 * 
25
 * @author Ben Stöver
26
 * @date 04.08.2014
27
 */
28
public class ContigSequenceDataProvider extends PackedSequenceDataProvider<NucleotideCompound> 
29
        implements SequenceDataProvider<NucleotideCompound> {
30

  
31
	
32
	public ContigSequenceDataProvider() {
33
		super(new BioJavaTokenSet<NucleotideCompound>(AlignmentAmbiguityDNACompoundSet.getAlignmentAmbiguityDNACompoundSet()));
34
	}
35
	
36
	
37
	public void saveToCMD() {  //TODO Add cmd node as parameter  
38
		//TODO impl.
39
	}
40
	
41
	
42
	public void loadFromCMD() {  //TODO Add cmd node as parameter
43
		//TODO impl.
44
	}
45
}

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)