Project

General

Profile

« Previous | Next » 

Revision bc036167

Added by Ben Stöver almost 8 years ago

Bug fix: CDMSequenceMatrixAdapter now defines valid columns for its character set.
Draft for ExportSingleReadAlignmentWizard added.

View differences:

.gitattributes
1989 1989
eu.etaxonomy.taxeditor.cdmlib/build.properties merge=ours
1990 1990
eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/handler/ExportSequenceToFileHandler.java -text
1991 1991
eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/io/CDMSequenceMatrixAdapter.java -text
1992
eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/io/ExportSingleReadAlignmentWizardPage.java -text
1993 1992
eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/io/SequenceIDIterator.java -text
1993
eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/io/wizard/ExportSingleReadAlignmentWizard.java -text
1994
eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/io/wizard/ExportSingleReadAlignmentWizardPage.java -text
1994 1995
eu.etaxonomy.taxeditor.molecular/src/test/java/eu/etaxonomy/taxeditor/molecular/io/SequenceIDIteratorTest.java -text
1995 1996
eu.etaxonomy.taxeditor/eu.etaxonomy.taxeditor.product merge=ours
1996 1997
eu.etaxonomy.taxeditor/eu.etaxonomy.taxeditor.product.with.jre merge=ours
eu.etaxonomy.taxeditor.molecular/.gitignore
48 48
!src/test/.directory
49 49
!src/test/hibernate.log
50 50
!src/test/.settings
51
!src/main/java/eu/etaxonomy/taxeditor/molecular/io/wizard/.project
52
!src/main/java/eu/etaxonomy/taxeditor/molecular/io/wizard/integration-test.log
53
!src/main/java/eu/etaxonomy/taxeditor/molecular/io/wizard/target
54
!src/main/java/eu/etaxonomy/taxeditor/molecular/io/wizard/.directory
55
!src/main/java/eu/etaxonomy/taxeditor/molecular/io/wizard/hibernate.log
56
!src/main/java/eu/etaxonomy/taxeditor/molecular/io/wizard/.settings
eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/io/CDMSequenceMatrixAdapter.java
19 19
import info.bioinfweb.jphyloio.dataadapters.ObjectListDataAdapter;
20 20
import info.bioinfweb.jphyloio.dataadapters.implementations.NoCharDefsNoSetsMatrixDataAdapter;
21 21
import info.bioinfweb.jphyloio.dataadapters.implementations.readtowriteadapter.StoreObjectListDataAdapter;
22
import info.bioinfweb.jphyloio.events.CharacterSetIntervalEvent;
22 23
import info.bioinfweb.jphyloio.events.LinkedLabeledIDEvent;
23 24
import info.bioinfweb.jphyloio.events.SequenceTokensEvent;
24 25
import info.bioinfweb.jphyloio.events.TokenSetDefinitionEvent;
......
65 66

  
66 67
    private ObjectListDataAdapter<TokenSetDefinitionEvent> createTokenSetList() {
67 68
        StoreObjectListDataAdapter<TokenSetDefinitionEvent> result = new StoreObjectListDataAdapter<TokenSetDefinitionEvent>();
68
        result.setObjectStartEvent(new TokenSetDefinitionEvent(CharacterStateSetType.DNA,
69
                ReadWriteConstants.DEFAULT_TOKEN_SET_ID_PREFIX, null));
69
        final String id = ReadWriteConstants.DEFAULT_TOKEN_SET_ID_PREFIX;
70
        result.setObjectStartEvent(new TokenSetDefinitionEvent(CharacterStateSetType.DNA, id, null));
71
        result.getObjectContent(id).add(new CharacterSetIntervalEvent(0, getColumnCount(null)));  //TODO Change this expression, if column count should return -1 in the future.
70 72
        return result;
71 73
    }
72 74

  
......
141 143
    public LinkedLabeledIDEvent getSequenceStartEvent(ReadWriteParameterMap parameters, String sequenceID) {
142 144
        int singleReadIndex = extractSingleReadIndexFromID(sequenceID);
143 145
        if (singleReadIndex >= 0) {
144
            return new LinkedLabeledIDEvent(EventContentType.SEQUENCE, sequenceID, "singleRead" + singleReadIndex, null);
146
            return new LinkedLabeledIDEvent(EventContentType.SEQUENCE, sequenceID, "Single read " + singleReadIndex, null);
145 147
                    //TODO Use name displayed in derivate hierarchy or specified name as label instead?
146 148
        }
147 149
        else if (CONSENSUS_SEQUENCE_ID.equals(sequenceID)) {
eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/io/ExportSingleReadAlignmentWizardPage.java
1
// $Id$
2
/**
3
* Copyright (C) 2016 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.molecular.io;
11

  
12

  
13
import org.eclipse.jface.wizard.WizardPage;
14
import org.eclipse.swt.SWT;
15
import org.eclipse.swt.events.SelectionAdapter;
16
import org.eclipse.swt.events.SelectionEvent;
17
import org.eclipse.swt.layout.FormAttachment;
18
import org.eclipse.swt.layout.FormData;
19
import org.eclipse.swt.layout.FormLayout;
20
import org.eclipse.swt.widgets.Button;
21
import org.eclipse.swt.widgets.Composite;
22
import org.eclipse.swt.widgets.Text;
23

  
24

  
25

  
26
/**
27
 * Wizard page that allows to specify which parts of a single read alignment shall be exported to an alignment file.
28
 *
29
 * @author Ben St&ouml;ver
30
 * @date 18.04.2016
31
 */
32
public class ExportSingleReadAlignmentWizardPage extends WizardPage {
33
    private Text consensusSequenceNameTextField;
34
    private Button exportConsensusSequenceCB;
35
    private Button exportSingleReadsCB;
36

  
37

  
38
    /**
39
     * Create the wizard.
40
     */
41
    public ExportSingleReadAlignmentWizardPage() {
42
        super("SingleReadSequencesExport");  //TODO Which pageName should be used here? Any conventions?
43
        setTitle("Sequence export");
44
        setDescription("Defines which sequences of the single read alignment shall be exported.");
45
    }
46

  
47

  
48
    /**
49
     * Create contents of the wizard.
50
     *
51
     * @param parent the parent component
52
     */
53
    @Override
54
    public void createControl(Composite parent) {
55
        Composite container = new Composite(parent, SWT.NULL);
56

  
57
        setControl(container);
58
        container.setLayout(new FormLayout());
59

  
60
        exportSingleReadsCB = new Button(container, SWT.CHECK);
61
        exportSingleReadsCB.setSelection(true);
62
        FormData fd_exportSingleReadsCB = new FormData();
63
        fd_exportSingleReadsCB.top = new FormAttachment(0, 10);
64
        fd_exportSingleReadsCB.left = new FormAttachment(0, 10);
65
        exportSingleReadsCB.setLayoutData(fd_exportSingleReadsCB);
66
        exportSingleReadsCB.setText("Export single reads");
67

  
68
        exportConsensusSequenceCB = new Button(container, SWT.CHECK);
69
        exportConsensusSequenceCB.setSelection(true);
70
        exportConsensusSequenceCB.addSelectionListener(new SelectionAdapter() {
71
            @Override
72
            public void widgetSelected(SelectionEvent e) {
73
                consensusSequenceNameTextField.setEnabled(exportConsensusSequenceCB.getSelection());
74
            }
75
        });
76
        FormData fd_exportConsensusSequenceCB = new FormData();
77
        fd_exportConsensusSequenceCB.top = new FormAttachment(exportSingleReadsCB, 6);
78
        fd_exportConsensusSequenceCB.left = new FormAttachment(exportSingleReadsCB, 0, SWT.LEFT);
79
        exportConsensusSequenceCB.setLayoutData(fd_exportConsensusSequenceCB);
80
        exportConsensusSequenceCB.setText("Export consensus sequence");
81

  
82
        consensusSequenceNameTextField = new Text(container, SWT.BORDER);
83
        consensusSequenceNameTextField.setText("ConsensusSequence");
84
        FormData fd_consensusSequenceNameTextField = new FormData();
85
        fd_consensusSequenceNameTextField.bottom = new FormAttachment(30);
86
        fd_consensusSequenceNameTextField.right = new FormAttachment(28);
87
        fd_consensusSequenceNameTextField.top = new FormAttachment(0, 62);
88
        fd_consensusSequenceNameTextField.left = new FormAttachment(0, 32);
89
        consensusSequenceNameTextField.setLayoutData(fd_consensusSequenceNameTextField);
90
    }
91
}
eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/io/wizard/ExportSingleReadAlignmentWizard.java
1
// $Id$
2
/**
3
* Copyright (C) 2016 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.molecular.io.wizard;
11

  
12

  
13
import org.eclipse.jface.wizard.Wizard;
14

  
15

  
16

  
17
/**
18
 * A wizard to export a single read alignment from <i>CDM</i> using <i>JPhyloIO</i>.
19
 *
20
 * @author Ben Stöver
21
 * @date 23.06.2016
22
 */
23
public class ExportSingleReadAlignmentWizard extends Wizard {
24
    public ExportSingleReadAlignmentWizard() {
25
        setWindowTitle("Export single read alignment");  //TODO Use multi languange message
26
    }
27

  
28

  
29
    @Override
30
    public void addPages() {
31
        addPage(new ExportSingleReadAlignmentWizardPage());
32
    }
33

  
34

  
35
    @Override
36
    public boolean performFinish() {
37
        return true;  //TODO Check inputs
38
    }
39
}
eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/io/wizard/ExportSingleReadAlignmentWizardPage.java
1
// $Id$
2
/**
3
* Copyright (C) 2016 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.molecular.io.wizard;
11

  
12

  
13
import org.eclipse.jface.wizard.WizardPage;
14
import org.eclipse.swt.SWT;
15
import org.eclipse.swt.events.SelectionAdapter;
16
import org.eclipse.swt.events.SelectionEvent;
17
import org.eclipse.swt.layout.FormAttachment;
18
import org.eclipse.swt.layout.FormData;
19
import org.eclipse.swt.layout.FormLayout;
20
import org.eclipse.swt.widgets.Button;
21
import org.eclipse.swt.widgets.Composite;
22
import org.eclipse.swt.widgets.Text;
23

  
24

  
25

  
26
/**
27
 * Wizard page that allows to specify which parts of a single read alignment shall be exported to an alignment file.
28
 *
29
 * @author Ben St&ouml;ver
30
 * @date 18.04.2016
31
 */
32
public class ExportSingleReadAlignmentWizardPage extends WizardPage {
33
    private Text consensusSequenceNameTextField;
34
    private Button exportConsensusSequenceCB;
35
    private Button exportSingleReadsCB;
36

  
37

  
38
    /**
39
     * Create the wizard.
40
     */
41
    public ExportSingleReadAlignmentWizardPage() {
42
        super("SingleReadSequencesExport");  //TODO Which pageName should be used here? Any conventions?
43
        setTitle("Sequence export");
44
        setDescription("Defines which sequences of the single read alignment shall be exported.");
45
    }
46

  
47

  
48
    /**
49
     * Create contents of the wizard.
50
     *
51
     * @param parent the parent component
52
     */
53
    @Override
54
    public void createControl(Composite parent) {
55
        Composite container = new Composite(parent, SWT.NULL);
56

  
57
        setControl(container);
58
        container.setLayout(new FormLayout());
59

  
60
        exportSingleReadsCB = new Button(container, SWT.CHECK);
61
        exportSingleReadsCB.setSelection(true);
62
        FormData fd_exportSingleReadsCB = new FormData();
63
        fd_exportSingleReadsCB.top = new FormAttachment(0, 10);
64
        fd_exportSingleReadsCB.left = new FormAttachment(0, 10);
65
        exportSingleReadsCB.setLayoutData(fd_exportSingleReadsCB);
66
        exportSingleReadsCB.setText("Export single reads");
67

  
68
        exportConsensusSequenceCB = new Button(container, SWT.CHECK);
69
        exportConsensusSequenceCB.setSelection(true);
70
        exportConsensusSequenceCB.addSelectionListener(new SelectionAdapter() {
71
            @Override
72
            public void widgetSelected(SelectionEvent e) {
73
                consensusSequenceNameTextField.setEnabled(exportConsensusSequenceCB.getSelection());
74
            }
75
        });
76
        FormData fd_exportConsensusSequenceCB = new FormData();
77
        fd_exportConsensusSequenceCB.top = new FormAttachment(exportSingleReadsCB, 6);
78
        fd_exportConsensusSequenceCB.left = new FormAttachment(exportSingleReadsCB, 0, SWT.LEFT);
79
        exportConsensusSequenceCB.setLayoutData(fd_exportConsensusSequenceCB);
80
        exportConsensusSequenceCB.setText("Export consensus sequence");
81

  
82
        consensusSequenceNameTextField = new Text(container, SWT.BORDER);
83
        consensusSequenceNameTextField.setText("ConsensusSequence");
84
        FormData fd_consensusSequenceNameTextField = new FormData();
85
        fd_consensusSequenceNameTextField.bottom = new FormAttachment(30);
86
        fd_consensusSequenceNameTextField.right = new FormAttachment(28);
87
        fd_consensusSequenceNameTextField.top = new FormAttachment(0, 62);
88
        fd_consensusSequenceNameTextField.left = new FormAttachment(0, 32);
89
        consensusSequenceNameTextField.setLayoutData(fd_consensusSequenceNameTextField);
90
    }
91
}

Also available in: Unified diff