git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
a04e586
)
JAL-2847 start of cleaning up db loading code
author
kjvdheide
<kjvanderheide@dundee.ac.uk>
Sun, 3 Dec 2017 16:30:05 +0000
(16:30 +0000)
committer
kjvdheide
<kjvanderheide@dundee.ac.uk>
Sun, 3 Dec 2017 16:30:05 +0000
(16:30 +0000)
src/jalview/ext/archaeopteryx/AptxInit.java
patch
|
blob
|
history
src/jalview/ext/archaeopteryx/LoadedTreeSequenceAssociation.java
[moved from
src/jalview/ext/archaeopteryx/LoadedTreeAssociation.java
with 97% similarity]
patch
|
blob
|
history
src/jalview/gui/AlignFrame.java
patch
|
blob
|
history
diff --git
a/src/jalview/ext/archaeopteryx/AptxInit.java
b/src/jalview/ext/archaeopteryx/AptxInit.java
index
805cc6c
..
b9a7ae2
100644
(file)
--- a/
src/jalview/ext/archaeopteryx/AptxInit.java
+++ b/
src/jalview/ext/archaeopteryx/AptxInit.java
@@
-108,20
+108,20
@@
public final class AptxInit
Desktop.instance.startLoading(filePath);
}
boolean nhx_or_nexus = false;
Desktop.instance.startLoading(filePath);
}
boolean nhx_or_nexus = false;
- final PhylogenyParser p = ParserUtils.createParserDependingOnFileType(
+ final PhylogenyParser parser = ParserUtils.createParserDependingOnFileType(
treeFile, VALIDATE_PHYLOXML_XSD);
treeFile, VALIDATE_PHYLOXML_XSD);
- if (p instanceof NHXParser)
+ if (parser instanceof NHXParser)
{
nhx_or_nexus = true;
{
nhx_or_nexus = true;
- final NHXParser nhx = (NHXParser) p;
+ final NHXParser nhx = (NHXParser) parser;
nhx.setReplaceUnderscores(REPLACE_NHX_UNDERSCORES);
nhx.setIgnoreQuotes(false);
nhx.setTaxonomyExtraction(TAXONOMY_EXTRACTION);
}
nhx.setReplaceUnderscores(REPLACE_NHX_UNDERSCORES);
nhx.setIgnoreQuotes(false);
nhx.setTaxonomyExtraction(TAXONOMY_EXTRACTION);
}
- else if (p instanceof NexusPhylogeniesParser)
+ else if (parser instanceof NexusPhylogeniesParser)
{
nhx_or_nexus = true;
{
nhx_or_nexus = true;
- final NexusPhylogeniesParser nex = (NexusPhylogeniesParser) p;
+ final NexusPhylogeniesParser nex = (NexusPhylogeniesParser) parser;
nex.setReplaceUnderscores(REPLACE_NHX_UNDERSCORES);
nex.setIgnoreQuotes(false);
}
nex.setReplaceUnderscores(REPLACE_NHX_UNDERSCORES);
nex.setIgnoreQuotes(false);
}
@@
-129,20
+129,20
@@
public final class AptxInit
// {
// MainFrameApplication.warnIfNotPhyloXmlValidation(APTX_CONFIG);
// }
// {
// MainFrameApplication.warnIfNotPhyloXmlValidation(APTX_CONFIG);
// }
- Phylogeny[] phylogenies = PhylogenyMethods.readPhylogenies(p, treeFile);
- MainFrame[] aptxFrames = new MainFrame[phylogenies.length];
+ Phylogeny[] trees = PhylogenyMethods.readPhylogenies(parser, treeFile);
+ MainFrame[] aptxFrames = new MainFrame[trees.length];
String treeTitle = treeFile.getName();
String treeTitle = treeFile.getName();
- for (int i = 0; i < phylogenies.length; i++)
+ for (int i = 0; i < trees.length; i++)
{
{
- Phylogeny tree = phylogenies[i];
+ Phylogeny tree = trees[i];
if (nhx_or_nexus && INTERNAL_NUMBERS_AS_CONFIDENCE)
{
PhylogenyMethods.transferInternalNodeNamesToConfidence(tree, "");
}
if (nhx_or_nexus && INTERNAL_NUMBERS_AS_CONFIDENCE)
{
PhylogenyMethods.transferInternalNodeNamesToConfidence(tree, "");
}
-
aptxFrames[i] = createAptxFrame(tree, viewport, treeTitle);
aptxFrames[i] = createAptxFrame(tree, viewport, treeTitle);
+
}
if (Desktop.instance != null)
{
}
if (Desktop.instance != null)
{
@@
-193,10
+193,6
@@
public final class AptxInit
public static MainFrame[] createInstancesFromDb(int databaseIndex,
AlignmentViewport viewport)
{
public static MainFrame[] createInstancesFromDb(int databaseIndex,
AlignmentViewport viewport)
{
- if (Desktop.desktop != null)
- {
- // Desktop.desktop.startLoading(treeTitle);
- }
URL url = null;
Phylogeny[] trees = null;
URL url = null;
Phylogeny[] trees = null;
@@
-209,22
+205,25
@@
public final class AptxInit
client.getInstructions() + "\n(Reference: "
+ client.getReference() + ")",
client.getDescription(), JvOptionPane.QUESTION_MESSAGE);
client.getInstructions() + "\n(Reference: "
+ client.getReference() + ")",
client.getDescription(), JvOptionPane.QUESTION_MESSAGE);
+
if ((identifier != null) && (identifier.trim().length() > 0))
{
if ((identifier != null) && (identifier.trim().length() > 0))
{
+ if (Desktop.instance != null)
+ {
+ Desktop.instance.startLoading(identifier);
+ }
+
identifier = identifier.trim();
if (client.isQueryInteger())
{
identifier = identifier.replaceAll("^\\D+", "");
identifier = identifier.trim();
if (client.isQueryInteger())
{
identifier = identifier.replaceAll("^\\D+", "");
- int id = -1;
+
+ int id;
try
{
id = Integer.parseInt(identifier);
} catch (final NumberFormatException e)
{
try
{
id = Integer.parseInt(identifier);
} catch (final NumberFormatException e)
{
- id = -1;
- }
- if (id < 1)
- {
JvOptionPane.showInternalMessageDialog(Desktop.desktop,
"Identifier is expected to be a number",
"Can not open URL", JvOptionPane.ERROR_MESSAGE);
JvOptionPane.showInternalMessageDialog(Desktop.desktop,
"Identifier is expected to be a number",
"Can not open URL", JvOptionPane.ERROR_MESSAGE);
@@
-471,17
+470,16
@@
public final class AptxInit
{
MainFrame aptxApp = Archaeopteryx.createApplication(aptxTree,
APTX_CONFIG, treeTitle);
{
MainFrame aptxApp = Archaeopteryx.createApplication(aptxTree,
APTX_CONFIG, treeTitle);
- // addPartitioningSlider(aptxApp);
-
- LoadedTreeAssociation bindAptxNodes = new LoadedTreeAssociation(
+ LoadedTreeSequenceAssociation bindAptxNodes = new LoadedTreeSequenceAssociation(
jalviewAlignport.getAlignment().getSequencesArray(), aptxTree);
jalviewAlignport.getAlignment().getSequencesArray(), aptxTree);
-
bindAptxNodes.associateLeavesToSequences();
bindAptxNodes.associateLeavesToSequences();
+
bindNodesToJalviewSequences(aptxApp, jalviewAlignport,
bindAptxNodes.getAlignmentWithNodes(),
bindAptxNodes.getNodesWithAlignment());
bindNodesToJalviewSequences(aptxApp, jalviewAlignport,
bindAptxNodes.getAlignmentWithNodes(),
bindAptxNodes.getNodesWithAlignment());
- bindFrameToJalview(aptxApp);
+ bindTreeViewFrameToJalview(aptxApp);
+
return aptxApp;
}
return aptxApp;
}
@@
-503,7
+501,8
@@
public final class AptxInit
}
}
- public static MainFrame bindFrameToJalview(final MainFrame aptxApp)
+ public static MainFrame bindTreeViewFrameToJalview(
+ final MainFrame aptxApp)
{
int width = 400;
int height = 550;
{
int width = 400;
int height = 550;
diff --git
a/src/jalview/ext/archaeopteryx/LoadedTreeAssociation.java
b/src/jalview/ext/archaeopteryx/LoadedTreeSequenceAssociation.java
similarity index 97%
rename from
src/jalview/ext/archaeopteryx/LoadedTreeAssociation.java
rename to
src/jalview/ext/archaeopteryx/LoadedTreeSequenceAssociation.java
index
c869cd5
..
1bc71b4
100644
(file)
--- a/
src/jalview/ext/archaeopteryx/LoadedTreeAssociation.java
+++ b/
src/jalview/ext/archaeopteryx/LoadedTreeSequenceAssociation.java
@@
-13,7
+13,7
@@
import java.util.Map;
import org.forester.phylogeny.Phylogeny;
import org.forester.phylogeny.PhylogenyNode;
import org.forester.phylogeny.Phylogeny;
import org.forester.phylogeny.PhylogenyNode;
-public class LoadedTreeAssociation
+public class LoadedTreeSequenceAssociation
implements ExternalLoadedTreeAssociationI
{
SequenceI[] alignSequences;
implements ExternalLoadedTreeAssociationI
{
SequenceI[] alignSequences;
@@
-24,7
+24,7
@@
public class LoadedTreeAssociation
Map<PhylogenyNode, SequenceI> nodesWithAlignment;
Map<PhylogenyNode, SequenceI> nodesWithAlignment;
- public LoadedTreeAssociation(SequenceI[] alignmentSequences,
+ public LoadedTreeSequenceAssociation(SequenceI[] alignmentSequences,
Phylogeny aptxTree)
{
alignSequences = alignmentSequences;
Phylogeny aptxTree)
{
alignSequences = alignmentSequences;
diff --git
a/src/jalview/gui/AlignFrame.java
b/src/jalview/gui/AlignFrame.java
index
97120fc
..
5f26925
100644
(file)
--- a/
src/jalview/gui/AlignFrame.java
+++ b/
src/jalview/gui/AlignFrame.java
@@
-4031,6
+4031,11
@@
public class AlignFrame extends GAlignFrame implements DropTargetListener,
}
}
}
}
+ /**
+ * Disgustingly hardcoded atm.
+ *
+ * @param databaseIndex
+ */
public void chooseTreeDb(int databaseIndex)
{
AptxInit.createInstancesFromDb(databaseIndex, viewport);
public void chooseTreeDb(int databaseIndex)
{
AptxInit.createInstancesFromDb(databaseIndex, viewport);