├── src ├── jade │ ├── lib │ │ ├── instr │ │ ├── libmatrixExp.so │ │ ├── compile.sh │ │ ├── jade_reconstruct_area_PJNI.h │ │ └── jade_reconstruct_area_PJNI.c │ ├── tree │ │ ├── TreeFileReader.java │ │ ├── TreeSimulator.java │ │ ├── NodeObject.java │ │ └── TreeObject.java │ ├── math │ │ ├── AP_praxis_method.java │ │ ├── ProbDistribution.java │ │ ├── IncompleteGammaFunctionSeries.java │ │ ├── IncompleteGammaFunctionFraction.java │ │ ├── InfiniteSeries.java │ │ ├── NormalDistribution.java │ │ ├── fRan.java │ │ ├── BetaDistribution.java │ │ ├── ExponentialDistribution.java │ │ ├── PrecisionCalculator.java │ │ └── ContinuedFraction.java │ ├── reconstruct │ │ ├── area │ │ │ ├── Area.java │ │ │ ├── PJNI.java │ │ │ ├── RangeReconstructor.java │ │ │ ├── AncSplit.java │ │ │ ├── BayesChain.java │ │ │ └── P.java │ │ └── discrete │ │ │ └── P.java │ ├── simulate │ │ ├── ExtinctionEpisode.java │ │ ├── BioGeoSim.java │ │ ├── GrowthEpisode.java │ │ ├── ConstantEpisode.java │ │ ├── Connection.java │ │ └── ExtinctionFunction.java │ ├── data │ │ ├── SitePattern.java │ │ ├── NumericDataType.java │ │ ├── Sequence.java │ │ ├── TransitionPenaltyTable.java │ │ └── DataType.java │ └── runners │ │ └── ConcatMain.java ├── org │ ├── virion │ │ └── jam │ │ │ ├── demo │ │ │ ├── images │ │ │ │ ├── find.png │ │ │ │ ├── infoTool.png │ │ │ │ ├── projectTool.png │ │ │ │ ├── prefsAdvanced.png │ │ │ │ ├── prefsClipboard.png │ │ │ │ ├── prefsGeneral.png │ │ │ │ ├── tableSelection.png │ │ │ │ ├── filterBackground.png │ │ │ │ └── tableSelectionGray.png │ │ │ ├── menus │ │ │ │ ├── DemoMenuHandler.java │ │ │ │ └── DemoMenuFactory.java │ │ │ └── DemoMenuBarFactory.java │ │ │ ├── panels │ │ │ ├── images │ │ │ │ ├── search │ │ │ │ │ ├── find.png │ │ │ │ │ ├── stop.png │ │ │ │ │ ├── findPopup.png │ │ │ │ │ ├── stopPressed.png │ │ │ │ │ └── stopRollover.png │ │ │ │ ├── status │ │ │ │ │ ├── stop.png │ │ │ │ │ ├── resume.png │ │ │ │ │ ├── reveal.png │ │ │ │ │ ├── warning.png │ │ │ │ │ ├── stopPressed.png │ │ │ │ │ ├── stopRollover.png │ │ │ │ │ ├── resumePressed.png │ │ │ │ │ ├── resumeRollover.png │ │ │ │ │ ├── revealPressed.png │ │ │ │ │ ├── revealRollover.png │ │ │ │ │ ├── warningPressed.png │ │ │ │ │ └── warningRollover.png │ │ │ │ ├── add │ │ │ │ │ ├── addButton.png │ │ │ │ │ ├── addButtonInactive.png │ │ │ │ │ └── addButtonPressed.png │ │ │ │ ├── plusminus │ │ │ │ │ ├── plus.png │ │ │ │ │ ├── minus.png │ │ │ │ │ ├── minusPressed.png │ │ │ │ │ ├── plusPressed.png │ │ │ │ │ ├── plusRollover.png │ │ │ │ │ └── minusRollover.png │ │ │ │ ├── network │ │ │ │ │ ├── network1.png │ │ │ │ │ ├── network2.png │ │ │ │ │ ├── network3.png │ │ │ │ │ ├── network4.png │ │ │ │ │ ├── network5.png │ │ │ │ │ ├── network6.png │ │ │ │ │ ├── network7.png │ │ │ │ │ └── network8.png │ │ │ │ ├── action │ │ │ │ │ ├── actionButton.png │ │ │ │ │ ├── actionButtonInactive.png │ │ │ │ │ └── actionButtonPressed.png │ │ │ │ ├── activity │ │ │ │ │ ├── activity1.png │ │ │ │ │ ├── activity10.png │ │ │ │ │ ├── activity11.png │ │ │ │ │ ├── activity12.png │ │ │ │ │ ├── activity2.png │ │ │ │ │ ├── activity3.png │ │ │ │ │ ├── activity4.png │ │ │ │ │ ├── activity5.png │ │ │ │ │ ├── activity6.png │ │ │ │ │ ├── activity7.png │ │ │ │ │ ├── activity8.png │ │ │ │ │ └── activity9.png │ │ │ │ └── remove │ │ │ │ │ ├── removeButton.png │ │ │ │ │ ├── removeButtonInactive.png │ │ │ │ │ └── removeButtonPressed.png │ │ │ ├── StatusListener.java │ │ │ ├── StatusBar.java │ │ │ ├── SearchPanelListener.java │ │ │ └── RuleModel.java │ │ │ ├── controlpalettes │ │ │ ├── images │ │ │ │ ├── pinIn.png │ │ │ │ ├── pinOut.png │ │ │ │ ├── pinInRollover.png │ │ │ │ └── pinOutRollover.png │ │ │ ├── ControllerListener.java │ │ │ ├── ControlPaletteListener.java │ │ │ └── AbstractController.java │ │ │ ├── disclosure │ │ │ ├── images │ │ │ │ ├── titleBackground.png │ │ │ │ ├── disclosureDownNormal.png │ │ │ │ ├── disclosureRightDown.png │ │ │ │ ├── disclosureDownPressed.png │ │ │ │ ├── disclosureRightNormal.png │ │ │ │ └── disclosureRightPressed.png │ │ │ └── DisclosureListener.java │ │ │ ├── util │ │ │ ├── TaskListener.java │ │ │ ├── SimpleListener.java │ │ │ ├── ListItemView.java │ │ │ ├── SimpleLongTask.java │ │ │ └── SimpleListenerManager.java │ │ │ ├── framework │ │ │ ├── Exportable.java │ │ │ ├── DocumentFrameFactory.java │ │ │ ├── Command.java │ │ │ ├── MenuBarFactory.java │ │ │ ├── MultiDocMenuBarFactory.java │ │ │ ├── SingleDocMenuBarFactory.java │ │ │ ├── MenuFactory.java │ │ │ ├── DefaultHelpMenuFactory.java │ │ │ ├── AuxilaryFrame.java │ │ │ └── DefaultEditMenuFactory.java │ │ │ ├── toolbar │ │ │ ├── ToolbarItem.java │ │ │ ├── ToolbarOptions.java │ │ │ ├── ToolbarAction.java │ │ │ ├── GenericToolbarItem.java │ │ │ └── ToolbarButton.java │ │ │ ├── controlpanels │ │ │ ├── ControlPaletteListener.java │ │ │ ├── ControlsSettings.java │ │ │ ├── ControlPalette.java │ │ │ ├── ControlsProvider.java │ │ │ └── Controls.java │ │ │ ├── preferences │ │ │ └── PreferencesSection.java │ │ │ ├── html │ │ │ ├── HTMLViewer.java │ │ │ └── SimpleLinkListener.java │ │ │ ├── mac │ │ │ ├── MacWindowMenuFactory.java │ │ │ └── MacHelpMenuFactory.java │ │ │ ├── console │ │ │ └── ConsoleMenuBarFactory.java │ │ │ └── table │ │ │ ├── AdvancedTableUI.java │ │ │ ├── WholeNumberCellEditor.java │ │ │ └── RealNumberCellEditor.java │ └── xml │ │ └── sax │ │ ├── helpers │ │ └── package.html │ │ ├── SAXNotRecognizedException.java │ │ └── SAXNotSupportedException.java ├── jebl │ ├── gui │ │ └── trees │ │ │ ├── treeviewer │ │ │ ├── images │ │ │ │ ├── polarTree.png │ │ │ │ ├── radialTree.png │ │ │ │ └── rectangularTree.png │ │ │ ├── TreeSelectionListener.java │ │ │ ├── painters │ │ │ │ ├── PainterListener.java │ │ │ │ ├── AbstractPainter.java │ │ │ │ └── Painter.java │ │ │ ├── treelayouts │ │ │ │ └── TreeLayoutListener.java │ │ │ └── decorators │ │ │ │ ├── BranchDecorator.java │ │ │ │ ├── TaxonDecorator.java │ │ │ │ └── AttributeBranchDecorator.java │ │ │ ├── treeviewer_dev │ │ │ ├── images │ │ │ │ ├── polarTree.png │ │ │ │ ├── radialTree.png │ │ │ │ └── rectangularTree.png │ │ │ ├── TreePaneListener.java │ │ │ ├── TreeSelectionListener.java │ │ │ ├── TreeViewerListener.java │ │ │ ├── treelayouts │ │ │ │ └── TreeLayoutListener.java │ │ │ ├── painters │ │ │ │ ├── PainterListener.java │ │ │ │ └── AbstractPainter.java │ │ │ └── decorators │ │ │ │ └── Decorator.java │ │ │ └── treecomponent │ │ │ └── RootedTreePainter.java │ ├── evolution │ │ ├── align │ │ │ ├── Output.java │ │ │ ├── SystemOut.java │ │ │ ├── TracebackSimple.java │ │ │ ├── Traceback.java │ │ │ ├── TracebackPlotter.java │ │ │ ├── TracebackAffine.java │ │ │ ├── scores │ │ │ │ ├── ScoreMatrix.java │ │ │ │ ├── AminoAcidScores.java │ │ │ │ ├── Hamming.java │ │ │ │ ├── JukesCantor.java │ │ │ │ ├── SubstScoreMatrix.java │ │ │ │ ├── Pam100.java │ │ │ │ ├── Pam110.java │ │ │ │ ├── Pam120.java │ │ │ │ ├── Pam130.java │ │ │ │ ├── Pam140.java │ │ │ │ ├── Pam150.java │ │ │ │ ├── Pam160.java │ │ │ │ ├── Pam170.java │ │ │ │ ├── Pam180.java │ │ │ │ ├── Pam190.java │ │ │ │ ├── Pam200.java │ │ │ │ ├── Pam210.java │ │ │ │ ├── Pam220.java │ │ │ │ ├── Pam230.java │ │ │ │ ├── Pam240.java │ │ │ │ ├── Pam250.java │ │ │ │ ├── Blosum55.java │ │ │ │ ├── Blosum60.java │ │ │ │ ├── Blosum62.java │ │ │ │ ├── Blosum65.java │ │ │ │ ├── Blosum70.java │ │ │ │ ├── Blosum75.java │ │ │ │ ├── Blosum80.java │ │ │ │ ├── Blosum85.java │ │ │ │ ├── Blosum90.java │ │ │ │ └── Blosum45.java │ │ │ ├── package.html │ │ │ ├── MultipleAligner.java │ │ │ ├── PairwiseAligner.java │ │ │ ├── AlignLinearSpace.java │ │ │ ├── AlignmentResult.java │ │ │ ├── AlignLinearSpaceAffine.java │ │ │ └── MaximalSegmentPair.java │ │ ├── distances │ │ │ ├── CannotBuildDistanceMatrixException.java │ │ │ └── DistanceMatrix.java │ │ ├── taxa │ │ │ └── MissingTaxonException.java │ │ ├── trees │ │ │ ├── TreeBuilder.java │ │ │ ├── HashPair.java │ │ │ ├── BaseNode.java │ │ │ └── BaseEdge.java │ │ ├── characters │ │ │ ├── CharacterType.java │ │ │ └── Character.java │ │ ├── sequences │ │ │ ├── GaplessSequence.java │ │ │ ├── SequenceStateException.java │ │ │ ├── Sequences.java │ │ │ ├── TranslatedSequence.java │ │ │ ├── CodonState.java │ │ │ ├── Sequence.java │ │ │ ├── NucleotideState.java │ │ │ └── AminoAcidState.java │ │ ├── io │ │ │ ├── AlignmentImporter.java │ │ │ ├── AlignmentExporter.java │ │ │ ├── SequenceExporter.java │ │ │ ├── DistanceMatrixImporter.java │ │ │ ├── ImmediateSequenceImporter.java │ │ │ ├── SequenceImporter.java │ │ │ ├── TreeExporter.java │ │ │ ├── IllegalCharacterPolicy.java │ │ │ ├── TreeImporter.java │ │ │ ├── FastaExporter.java │ │ │ └── NewickExporter.java │ │ ├── treemetrics │ │ │ ├── RootedTreeMetric.java │ │ │ └── BilleraMetric.java │ │ ├── graphs │ │ │ ├── Edge.java │ │ │ ├── Node.java │ │ │ └── Utils.java │ │ ├── treesimulation │ │ │ └── IntervalGenerator.java │ │ ├── alignments │ │ │ ├── Alignment.java │ │ │ ├── BootstrappedAlignment.java │ │ │ ├── JackknifedAlignment.java │ │ │ └── Patterns.java │ │ ├── aligners │ │ │ └── Aligner.java │ │ └── substmodel │ │ │ └── AminoAcidModel.java │ ├── math │ │ ├── MatrixCalcException.java │ │ ├── UnivariateFunction.java │ │ └── MultivariateFunction.java │ └── util │ │ └── AttributableHelper.java └── phyutility │ └── leafstability │ └── Calculator.java ├── manual.pdf └── README.md /src/jade/lib/instr: -------------------------------------------------------------------------------- 1 | use java -Djava.library.path=lib/ -jar jarfile 2 | -------------------------------------------------------------------------------- /manual.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/manual.pdf -------------------------------------------------------------------------------- /src/jade/tree/TreeFileReader.java: -------------------------------------------------------------------------------- 1 | package jade.tree; 2 | 3 | public class TreeFileReader { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/jade/lib/libmatrixExp.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/jade/lib/libmatrixExp.so -------------------------------------------------------------------------------- /src/org/virion/jam/demo/images/find.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/demo/images/find.png -------------------------------------------------------------------------------- /src/org/virion/jam/demo/images/infoTool.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/demo/images/infoTool.png -------------------------------------------------------------------------------- /src/jade/tree/TreeSimulator.java: -------------------------------------------------------------------------------- 1 | package jade.tree; 2 | 3 | public class TreeSimulator { 4 | public TreeSimulator(){ 5 | 6 | } 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/org/virion/jam/demo/images/projectTool.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/demo/images/projectTool.png -------------------------------------------------------------------------------- /src/org/virion/jam/demo/images/prefsAdvanced.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/demo/images/prefsAdvanced.png -------------------------------------------------------------------------------- /src/org/virion/jam/demo/images/prefsClipboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/demo/images/prefsClipboard.png -------------------------------------------------------------------------------- /src/org/virion/jam/demo/images/prefsGeneral.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/demo/images/prefsGeneral.png -------------------------------------------------------------------------------- /src/org/virion/jam/demo/images/tableSelection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/demo/images/tableSelection.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/search/find.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/search/find.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/search/stop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/search/stop.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/status/stop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/status/stop.png -------------------------------------------------------------------------------- /src/jade/math/AP_praxis_method.java: -------------------------------------------------------------------------------- 1 | package jade.math; 2 | 3 | public interface AP_praxis_method { 4 | 5 | public double funct(int n, double x[]); 6 | } -------------------------------------------------------------------------------- /src/jade/reconstruct/area/Area.java: -------------------------------------------------------------------------------- 1 | package jade.reconstruct.area; 2 | 3 | public class Area { 4 | private int number; 5 | private String name; 6 | } 7 | -------------------------------------------------------------------------------- /src/jebl/gui/trees/treeviewer/images/polarTree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/jebl/gui/trees/treeviewer/images/polarTree.png -------------------------------------------------------------------------------- /src/jebl/gui/trees/treeviewer/images/radialTree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/jebl/gui/trees/treeviewer/images/radialTree.png -------------------------------------------------------------------------------- /src/org/virion/jam/controlpalettes/images/pinIn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/controlpalettes/images/pinIn.png -------------------------------------------------------------------------------- /src/org/virion/jam/demo/images/filterBackground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/demo/images/filterBackground.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/add/addButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/add/addButton.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/plusminus/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/plusminus/plus.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/status/resume.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/status/resume.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/status/reveal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/status/reveal.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/status/warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/status/warning.png -------------------------------------------------------------------------------- /src/jebl/gui/trees/treeviewer_dev/images/polarTree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/jebl/gui/trees/treeviewer_dev/images/polarTree.png -------------------------------------------------------------------------------- /src/org/virion/jam/controlpalettes/images/pinOut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/controlpalettes/images/pinOut.png -------------------------------------------------------------------------------- /src/org/virion/jam/demo/images/tableSelectionGray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/demo/images/tableSelectionGray.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/network/network1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/network/network1.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/network/network2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/network/network2.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/network/network3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/network/network3.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/network/network4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/network/network4.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/network/network5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/network/network5.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/network/network6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/network/network6.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/network/network7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/network/network7.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/network/network8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/network/network8.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/plusminus/minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/plusminus/minus.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/search/findPopup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/search/findPopup.png -------------------------------------------------------------------------------- /src/jebl/gui/trees/treeviewer/images/rectangularTree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/jebl/gui/trees/treeviewer/images/rectangularTree.png -------------------------------------------------------------------------------- /src/jebl/gui/trees/treeviewer_dev/images/radialTree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/jebl/gui/trees/treeviewer_dev/images/radialTree.png -------------------------------------------------------------------------------- /src/org/virion/jam/disclosure/images/titleBackground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/disclosure/images/titleBackground.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/action/actionButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/action/actionButton.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/activity/activity1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/activity/activity1.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/activity/activity10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/activity/activity10.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/activity/activity11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/activity/activity11.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/activity/activity12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/activity/activity12.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/activity/activity2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/activity/activity2.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/activity/activity3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/activity/activity3.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/activity/activity4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/activity/activity4.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/activity/activity5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/activity/activity5.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/activity/activity6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/activity/activity6.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/activity/activity7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/activity/activity7.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/activity/activity8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/activity/activity8.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/activity/activity9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/activity/activity9.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/remove/removeButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/remove/removeButton.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/search/stopPressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/search/stopPressed.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/search/stopRollover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/search/stopRollover.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/status/stopPressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/status/stopPressed.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/status/stopRollover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/status/stopRollover.png -------------------------------------------------------------------------------- /src/org/virion/jam/controlpalettes/images/pinInRollover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/controlpalettes/images/pinInRollover.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/add/addButtonInactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/add/addButtonInactive.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/add/addButtonPressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/add/addButtonPressed.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/plusminus/minusPressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/plusminus/minusPressed.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/plusminus/plusPressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/plusminus/plusPressed.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/plusminus/plusRollover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/plusminus/plusRollover.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/status/resumePressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/status/resumePressed.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/status/resumeRollover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/status/resumeRollover.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/status/revealPressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/status/revealPressed.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/status/revealRollover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/status/revealRollover.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/status/warningPressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/status/warningPressed.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/status/warningRollover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/status/warningRollover.png -------------------------------------------------------------------------------- /src/jebl/gui/trees/treeviewer_dev/images/rectangularTree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/jebl/gui/trees/treeviewer_dev/images/rectangularTree.png -------------------------------------------------------------------------------- /src/org/virion/jam/controlpalettes/images/pinOutRollover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/controlpalettes/images/pinOutRollover.png -------------------------------------------------------------------------------- /src/org/virion/jam/disclosure/images/disclosureDownNormal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/disclosure/images/disclosureDownNormal.png -------------------------------------------------------------------------------- /src/org/virion/jam/disclosure/images/disclosureRightDown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/disclosure/images/disclosureRightDown.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/plusminus/minusRollover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/plusminus/minusRollover.png -------------------------------------------------------------------------------- /src/org/virion/jam/disclosure/images/disclosureDownPressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/disclosure/images/disclosureDownPressed.png -------------------------------------------------------------------------------- /src/org/virion/jam/disclosure/images/disclosureRightNormal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/disclosure/images/disclosureRightNormal.png -------------------------------------------------------------------------------- /src/org/virion/jam/disclosure/images/disclosureRightPressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/disclosure/images/disclosureRightPressed.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/action/actionButtonInactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/action/actionButtonInactive.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/action/actionButtonPressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/action/actionButtonPressed.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/remove/removeButtonInactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/remove/removeButtonInactive.png -------------------------------------------------------------------------------- /src/org/virion/jam/panels/images/remove/removeButtonPressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackrim/phyutility/HEAD/src/org/virion/jam/panels/images/remove/removeButtonPressed.png -------------------------------------------------------------------------------- /src/org/virion/jam/util/TaskListener.java: -------------------------------------------------------------------------------- 1 | package org.virion.jam.util; 2 | 3 | 4 | public interface TaskListener { 5 | 6 | void taskFinished(); 7 | 8 | void taskCanceled(); 9 | } 10 | -------------------------------------------------------------------------------- /src/jade/simulate/ExtinctionEpisode.java: -------------------------------------------------------------------------------- 1 | package jade.simulate; 2 | 3 | public class ExtinctionEpisode { 4 | public double fraction; 5 | public long number; 6 | public double probability; 7 | public String type; 8 | } 9 | -------------------------------------------------------------------------------- /src/jade/reconstruct/area/PJNI.java: -------------------------------------------------------------------------------- 1 | package jade.reconstruct.area; 2 | 3 | public class PJNI { 4 | public native double [] matrixExp(double [] mat, int size); 5 | static { 6 | System.loadLibrary("matrixExp"); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/jade/lib/compile.sh: -------------------------------------------------------------------------------- 1 | gcc -c -I/home/smitty/apps/jdk/jdk1.6.0/include -I/home/smitty/apps/jdk/jdk1.6.0/include/linux -o libmatrixExp.o jade_reconstruct_area_PJNI.c 2 | ld -shared -o libmatrixExp.so libmatrixExp.o -lm -lgsl -lgslcblas 3 | 4 | -------------------------------------------------------------------------------- /src/jebl/evolution/align/Output.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.align; 2 | 3 | public abstract class Output { 4 | 5 | public abstract void print(String s); 6 | public abstract void println(String s); 7 | public abstract void println(); 8 | } -------------------------------------------------------------------------------- /src/jade/simulate/BioGeoSim.java: -------------------------------------------------------------------------------- 1 | package jade.simulate; 2 | 3 | public class BioGeoSim { 4 | 5 | /** 6 | * @param args 7 | */ 8 | public static void main(String[] args) { 9 | // TODO Auto-generated method stub 10 | 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/org/virion/jam/framework/Exportable.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Exportable.java 3 | */ 4 | 5 | package org.virion.jam.framework; 6 | 7 | import javax.swing.*; 8 | 9 | public interface Exportable { 10 | 11 | JComponent getExportableComponent(); 12 | } -------------------------------------------------------------------------------- /src/org/virion/jam/util/SimpleListener.java: -------------------------------------------------------------------------------- 1 | package org.virion.jam.util; 2 | 3 | /** 4 | * @author Richard Moir 5 | * @version $Id: SimpleListener.java 482 2006-10-25 06:30:57Z twobeers $ 6 | */ 7 | public interface SimpleListener { 8 | 9 | void objectChanged(); 10 | } 11 | -------------------------------------------------------------------------------- /src/org/virion/jam/toolbar/ToolbarItem.java: -------------------------------------------------------------------------------- 1 | package org.virion.jam.toolbar; 2 | 3 | /** 4 | * @author rambaut 5 | * Date: Oct 18, 2005 6 | * Time: 10:19:19 PM 7 | */ 8 | public interface ToolbarItem { 9 | void setToolbarOptions(ToolbarOptions options); 10 | } 11 | -------------------------------------------------------------------------------- /src/org/virion/jam/framework/DocumentFrameFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * DocumentFrameFactory.java 3 | */ 4 | 5 | package org.virion.jam.framework; 6 | 7 | 8 | 9 | public interface DocumentFrameFactory { 10 | 11 | DocumentFrame createDocumentFrame(Application app, MenuBarFactory menuBarFactory); 12 | } -------------------------------------------------------------------------------- /src/jebl/evolution/align/SystemOut.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.align; 2 | 3 | class SystemOut extends Output { 4 | 5 | public final void print(String s) { System.out.print(s); } 6 | public final void println(String s) { System.out.println(s); } 7 | public final void println() { System.out.println(); } 8 | } 9 | -------------------------------------------------------------------------------- /src/org/virion/jam/util/ListItemView.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ListItemView 3 | * 4 | * Created on 28 August 2001, 11:33 5 | */ 6 | 7 | package org.virion.jam.util; 8 | 9 | 10 | 11 | 12 | /** 13 | * @author adru001 14 | */ 15 | public interface ListItemView { 16 | 17 | void setItemToView(Object o); 18 | } 19 | -------------------------------------------------------------------------------- /src/jebl/gui/trees/treeviewer/TreeSelectionListener.java: -------------------------------------------------------------------------------- 1 | package jebl.gui.trees.treeviewer; 2 | 3 | /** 4 | * @author Andrew Rambaut 5 | * @version $Id: TreeSelectionListener.java 181 2006-01-23 17:31:10Z rambaut $ 6 | */ 7 | public interface TreeSelectionListener { 8 | 9 | void selectionChanged(); 10 | } 11 | -------------------------------------------------------------------------------- /src/jebl/gui/trees/treeviewer/painters/PainterListener.java: -------------------------------------------------------------------------------- 1 | package jebl.gui.trees.treeviewer.painters; 2 | 3 | /** 4 | * @author Andrew Rambaut 5 | * @version $Id: PainterListener.java 181 2006-01-23 17:31:10Z rambaut $ 6 | */ 7 | public interface PainterListener { 8 | 9 | void painterChanged(); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /src/jebl/gui/trees/treeviewer_dev/TreePaneListener.java: -------------------------------------------------------------------------------- 1 | package jebl.gui.trees.treeviewer_dev; 2 | 3 | /** 4 | * @author Andrew Rambaut 5 | * @version $Id: TreePaneListener.java 536 2006-11-21 16:10:24Z rambaut $ 6 | */ 7 | public interface TreePaneListener { 8 | 9 | void treePaneSettingsChanged(); 10 | } 11 | -------------------------------------------------------------------------------- /src/jebl/gui/trees/treeviewer_dev/TreeSelectionListener.java: -------------------------------------------------------------------------------- 1 | package jebl.gui.trees.treeviewer_dev; 2 | 3 | /** 4 | * @author Andrew Rambaut 5 | * @version $Id: TreeSelectionListener.java 294 2006-04-14 10:28:11Z rambaut $ 6 | */ 7 | public interface TreeSelectionListener { 8 | 9 | void selectionChanged(); 10 | } 11 | -------------------------------------------------------------------------------- /src/jebl/gui/trees/treeviewer/treelayouts/TreeLayoutListener.java: -------------------------------------------------------------------------------- 1 | package jebl.gui.trees.treeviewer.treelayouts; 2 | 3 | /** 4 | * @author Andrew Rambaut 5 | * @version $Id: TreeLayoutListener.java 181 2006-01-23 17:31:10Z rambaut $ 6 | */ 7 | public interface TreeLayoutListener { 8 | 9 | void treeLayoutChanged(); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /src/jebl/gui/trees/treeviewer_dev/TreeViewerListener.java: -------------------------------------------------------------------------------- 1 | package jebl.gui.trees.treeviewer_dev; 2 | 3 | /** 4 | * @author Andrew Rambaut 5 | * @version $Id: TreeViewerListener.java 536 2006-11-21 16:10:24Z rambaut $ 6 | */ 7 | public interface TreeViewerListener { 8 | void treeChanged(); 9 | 10 | void treeSettingsChanged(); 11 | } 12 | -------------------------------------------------------------------------------- /src/org/virion/jam/controlpalettes/ControllerListener.java: -------------------------------------------------------------------------------- 1 | package org.virion.jam.controlpalettes; 2 | 3 | /** 4 | * @author Andrew Rambaut 5 | * @author Alexei Drummond 6 | * @version $Id: ControllerListener.java 363 2006-06-27 16:26:09Z rambaut $ 7 | */ 8 | public interface ControllerListener { 9 | void controlsChanged(); 10 | } 11 | -------------------------------------------------------------------------------- /src/jebl/gui/trees/treeviewer_dev/treelayouts/TreeLayoutListener.java: -------------------------------------------------------------------------------- 1 | package jebl.gui.trees.treeviewer_dev.treelayouts; 2 | 3 | /** 4 | * @author Andrew Rambaut 5 | * @version $Id: TreeLayoutListener.java 294 2006-04-14 10:28:11Z rambaut $ 6 | */ 7 | public interface TreeLayoutListener { 8 | 9 | void treeLayoutChanged(); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /src/org/virion/jam/controlpanels/ControlPaletteListener.java: -------------------------------------------------------------------------------- 1 | package org.virion.jam.controlpanels; 2 | 3 | /** 4 | * @author Andrew Rambaut 5 | * @author Alexei Drummond 6 | * @version $Id: ControlPaletteListener.java 183 2006-01-23 21:29:48Z rambaut $ 7 | */ 8 | public interface ControlPaletteListener { 9 | void controlsChanged(); 10 | } 11 | -------------------------------------------------------------------------------- /src/jade/simulate/GrowthEpisode.java: -------------------------------------------------------------------------------- 1 | package jade.simulate; 2 | 3 | public class GrowthEpisode { 4 | public int extantstop; 5 | public int byextantstop; 6 | public double timestop; 7 | public double bytimestop; 8 | public double multipletimestop; 9 | public double birthrate; 10 | public double deathrate; 11 | public String stoptype; 12 | } 13 | -------------------------------------------------------------------------------- /src/jebl/evolution/align/TracebackSimple.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.align; 2 | 3 | class TracebackSimple extends Traceback { 4 | 5 | public TracebackSimple(int i, int j) { 6 | this.i = i; this.j = j; 7 | } 8 | 9 | public final void setTraceback(int i, int j) { 10 | this.i = i; 11 | this.j = j; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/org/virion/jam/controlpalettes/ControlPaletteListener.java: -------------------------------------------------------------------------------- 1 | package org.virion.jam.controlpalettes; 2 | 3 | /** 4 | * @author Andrew Rambaut 5 | * @author Alexei Drummond 6 | * @version $Id: ControlPaletteListener.java 294 2006-04-14 10:28:11Z rambaut $ 7 | */ 8 | public interface ControlPaletteListener { 9 | void controlsChanged(); 10 | } 11 | -------------------------------------------------------------------------------- /src/jade/data/SitePattern.java: -------------------------------------------------------------------------------- 1 | /* 2 | * SitePattern.java 3 | * 4 | * Created on April 18, 2005, 9:00 PM 5 | */ 6 | 7 | package jade.data; 8 | 9 | /** 10 | * 11 | * @author stephensmith 12 | */ 13 | public class SitePattern { 14 | 15 | /** Creates a new instance of SitePattern */ 16 | public SitePattern() { 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/jade/simulate/ConstantEpisode.java: -------------------------------------------------------------------------------- 1 | package jade.simulate; 2 | 3 | public class ConstantEpisode{ 4 | public int extantstop; 5 | public int byextantstop; 6 | public double timestop; 7 | public double bytimestop; 8 | public double multipletimestop; 9 | public boolean stochastic; 10 | public double birthdeathrate; 11 | public String stoptype; 12 | } 13 | -------------------------------------------------------------------------------- /src/org/virion/jam/controlpanels/ControlsSettings.java: -------------------------------------------------------------------------------- 1 | package org.virion.jam.controlpanels; 2 | 3 | /** 4 | * @author Andrew Rambaut 5 | * @version $Id: ControlsSettings.java 298 2006-04-16 09:00:35Z rambaut $ 6 | */ 7 | public interface ControlsSettings { 8 | 9 | void putSetting(String key, Object value); 10 | 11 | Object getSetting(String key); 12 | } 13 | -------------------------------------------------------------------------------- /src/org/virion/jam/demo/menus/DemoMenuHandler.java: -------------------------------------------------------------------------------- 1 | package org.virion.jam.demo.menus; 2 | 3 | import javax.swing.*; 4 | 5 | /** 6 | * @author Andrew Rambaut 7 | * @version $Id: DemoMenuHandler.java 386 2006-07-17 21:35:49Z rambaut $ 8 | */ 9 | public interface DemoMenuHandler { 10 | Action getFirstAction(); 11 | Action getSecondAction(); 12 | 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/jebl/gui/trees/treeviewer_dev/painters/PainterListener.java: -------------------------------------------------------------------------------- 1 | package jebl.gui.trees.treeviewer_dev.painters; 2 | 3 | /** 4 | * @author Andrew Rambaut 5 | * @version $Id: PainterListener.java 308 2006-05-01 21:15:41Z rambaut $ 6 | */ 7 | public interface PainterListener { 8 | 9 | void painterChanged(); 10 | 11 | void painterSettingsChanged(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/jade/data/NumericDataType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * NumericDataType.java 3 | * 4 | * Created on April 18, 2005, 8:26 PM 5 | */ 6 | 7 | package jade.data; 8 | 9 | /** 10 | * 11 | * @author stephensmith 12 | */ 13 | public class NumericDataType { 14 | 15 | /** Creates a new instance of NumericDataType */ 16 | public NumericDataType() { 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/jebl/evolution/align/Traceback.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.align; 2 | 3 | public abstract class Traceback { 4 | 5 | int i, j; // absolute coordinates 6 | 7 | public final int getX() { return i; } 8 | 9 | public final int getY() { return j; } 10 | 11 | public String toString() { return "("+getX() + ", " + getY()+")";}; 12 | } 13 | -------------------------------------------------------------------------------- /src/jebl/evolution/distances/CannotBuildDistanceMatrixException.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.distances; 2 | 3 | /** 4 | * @author Matthew Cheung 5 | * @version $Id$ 6 | */ 7 | public class CannotBuildDistanceMatrixException extends IllegalArgumentException { 8 | public CannotBuildDistanceMatrixException(String msg){ 9 | super(msg); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/jebl/evolution/taxa/MissingTaxonException.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.taxa; 2 | 3 | /** 4 | * @author Andrew Rambaut 5 | * @version $Id: MissingTaxonException.java 304 2006-04-25 11:04:53Z rambaut $ 6 | */ 7 | public class MissingTaxonException extends Throwable { 8 | public MissingTaxonException(Taxon taxon) { 9 | super("Taxon, " + taxon.getName() + ", is missing."); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/org/xml/sax/helpers/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

This package contains "helper" classes, including 6 | support for bootstrapping SAX-based applications. 7 | 8 |

See http://www.saxproject.org 9 | for more information about SAX.

10 | 11 | 12 | -------------------------------------------------------------------------------- /src/jebl/evolution/align/TracebackPlotter.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.align; 2 | 3 | /** 4 | * 5 | * @author Alexei Drummond 6 | * 7 | * @version $Id: TracebackPlotter.java 185 2006-01-23 23:03:18Z rambaut $ 8 | * 9 | */ 10 | public interface TracebackPlotter { 11 | 12 | void newTraceBack(String sequence1, String sequence2); 13 | 14 | void traceBack(Traceback t); 15 | 16 | void finishedTraceBack(); 17 | } 18 | -------------------------------------------------------------------------------- /src/jebl/gui/trees/treeviewer/decorators/BranchDecorator.java: -------------------------------------------------------------------------------- 1 | package jebl.gui.trees.treeviewer.decorators; 2 | 3 | import jebl.evolution.graphs.Node; 4 | import jebl.evolution.trees.Tree; 5 | 6 | import java.awt.*; 7 | 8 | /** 9 | * @author Andrew Rambaut 10 | * @version $Id: BranchDecorator.java 181 2006-01-23 17:31:10Z rambaut $ 11 | */ 12 | public interface BranchDecorator { 13 | Paint getBranchPaint(Tree tree, Node node); 14 | } 15 | -------------------------------------------------------------------------------- /src/jebl/gui/trees/treeviewer/decorators/TaxonDecorator.java: -------------------------------------------------------------------------------- 1 | package jebl.gui.trees.treeviewer.decorators; 2 | 3 | import jebl.evolution.taxa.Taxon; 4 | 5 | import java.awt.*; 6 | 7 | /** 8 | * @author Andrew Rambaut 9 | * @version $Id: TaxonDecorator.java 181 2006-01-23 17:31:10Z rambaut $ 10 | */ 11 | public interface TaxonDecorator { 12 | Paint getTaxonPaint(Taxon taxon); 13 | Font getTaxonFont(Taxon taxon, Font font); 14 | } 15 | -------------------------------------------------------------------------------- /src/org/virion/jam/disclosure/DisclosureListener.java: -------------------------------------------------------------------------------- 1 | package org.virion.jam.disclosure; 2 | 3 | import java.awt.*; 4 | 5 | /** 6 | * @author rambaut 7 | * Date: May 25, 2005 8 | * Time: 11:17:04 PM 9 | */ 10 | public interface DisclosureListener { 11 | void opening(Component component); 12 | void opened(Component component); 13 | 14 | void closing(Component component); 15 | void closed(Component component); 16 | } 17 | -------------------------------------------------------------------------------- /src/jebl/evolution/align/TracebackAffine.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.align; 2 | 3 | class TracebackAffine extends Traceback { 4 | 5 | int k; 6 | 7 | public TracebackAffine(int k, int i, int j) { 8 | 9 | this.k = k; 10 | this.i = i; 11 | this.j = j; 12 | } 13 | 14 | public final void setTraceback(int k, int i, int j) { 15 | this.i = i; 16 | this.j = j; 17 | this.k = k; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/jade/tree/NodeObject.java: -------------------------------------------------------------------------------- 1 | package jade.tree; 2 | 3 | public class NodeObject { 4 | private String name; 5 | private Object obj; 6 | 7 | public NodeObject(String name, Object obj){ 8 | this.name = name; 9 | this.obj = obj; 10 | } 11 | 12 | public Object getObject(){return obj;} 13 | public String getName(){return name;} 14 | public void setObject(Object obj){this.obj = obj;} 15 | public void setName(String name){ this.name = name;} 16 | } 17 | -------------------------------------------------------------------------------- /src/jade/tree/TreeObject.java: -------------------------------------------------------------------------------- 1 | package jade.tree; 2 | 3 | public class TreeObject { 4 | private String name; 5 | private Object obj; 6 | 7 | public TreeObject(String name, Object obj){ 8 | this.name = name; 9 | this.obj = obj; 10 | } 11 | 12 | public Object getObject(){return obj;} 13 | public String getName(){return name;} 14 | public void setObject(Object obj){this.obj = obj;} 15 | public void setName(String name){ this.name = name;} 16 | } 17 | -------------------------------------------------------------------------------- /src/jade/data/Sequence.java: -------------------------------------------------------------------------------- 1 | package jade.data; 2 | 3 | public class Sequence { 4 | public Sequence (String id, String sequence){ 5 | this.id=id; 6 | this.sequence=sequence; 7 | } 8 | public Sequence(){} 9 | public String getID(){return id;} 10 | public String getSeq(){return sequence;} 11 | public void setID(String id){this.id = id;} 12 | public void seqSeq(String seq){this.sequence = seq;} 13 | private String id; 14 | private String sequence; 15 | } 16 | -------------------------------------------------------------------------------- /src/org/virion/jam/panels/StatusListener.java: -------------------------------------------------------------------------------- 1 | package org.virion.jam.panels; 2 | 3 | /** 4 | * @author rambaut 5 | * Date: Jul 27, 2004 6 | * Time: 10:04:04 AM 7 | */ 8 | public interface StatusListener { 9 | 10 | /** 11 | * Called when the status is to be changed. 12 | * @param status the status constant 13 | * @param statusText the status text 14 | */ 15 | void statusChanged(int status, String statusText); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/org/virion/jam/framework/Command.java: -------------------------------------------------------------------------------- 1 | package org.virion.jam.framework; 2 | 3 | import javax.swing.*; 4 | 5 | /** 6 | * @author rambaut 7 | * Date: Dec 26, 2004 8 | * Time: 10:29:38 AM 9 | */ 10 | public interface Command { 11 | 12 | /** 13 | * Returns the swing Action for this command 14 | * @return the action object 15 | */ 16 | Action getAction(); 17 | 18 | String getPreferredMenu(); 19 | 20 | String getPreferredPosition(); 21 | } 22 | -------------------------------------------------------------------------------- /src/jade/reconstruct/area/RangeReconstructor.java: -------------------------------------------------------------------------------- 1 | package jade.reconstruct.area; 2 | import java.util.*; 3 | public interface RangeReconstructor { 4 | public void set_dipsersal(double x); 5 | public void set_extinction(double x); 6 | public void set_localextinction(ArrayList e); 7 | public void set_dispersalmatrix(ArrayList> d, int period); 8 | public void set_ratemodel(); 9 | public double eval_likelihood(); 10 | public int get_num_areas(); 11 | } 12 | -------------------------------------------------------------------------------- /src/jebl/evolution/trees/TreeBuilder.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.trees; 2 | 3 | import jebl.util.ProgressListener; 4 | 5 | /** 6 | * @author Andrew Rambaut 7 | * @author Alexei Drummond 8 | * @version $Id: TreeBuilder.java 301 2006-04-17 15:35:01Z rambaut $ 9 | */ 10 | public interface TreeBuilder { 11 | 12 | T build(); 13 | 14 | void addProgressListener(ProgressListener listener); 15 | 16 | void removeProgressListener(ProgressListener listener); 17 | } 18 | -------------------------------------------------------------------------------- /src/jebl/evolution/characters/CharacterType.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.characters; 2 | 3 | /** 4 | * @author Stephen A. Smith 5 | * 6 | */ 7 | public interface CharacterType { 8 | String getName(); 9 | 10 | public static final CharacterType DISCRETE = new CharacterType() { 11 | public String getName(){ return "DISCRETE"; } 12 | }; 13 | 14 | public static final CharacterType CONTINUOUS = new CharacterType() { 15 | public String getName(){ return "CONTINUOUS"; } 16 | }; 17 | } 18 | -------------------------------------------------------------------------------- /src/jebl/evolution/sequences/GaplessSequence.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.sequences; 2 | 3 | /** 4 | * @author rambaut 5 | * Date: Jul 27, 2005 6 | * Time: 12:48:31 AM 7 | */ 8 | public class GaplessSequence extends FilteredSequence { 9 | 10 | public GaplessSequence(Sequence source) { 11 | super(source); 12 | } 13 | 14 | protected State[] filterSequence(Sequence source) { 15 | return jebl.evolution.sequences.Utils.stripGaps(source.getStates()); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/org/virion/jam/preferences/PreferencesSection.java: -------------------------------------------------------------------------------- 1 | package org.virion.jam.preferences; 2 | 3 | import javax.swing.*; 4 | 5 | /** 6 | * @author Andrew Rambaut 7 | * @author Alexei Drummond 8 | * @version $Id: PreferencesSection.java 275 2006-03-22 16:58:56Z rambaut $ 9 | */ 10 | public interface PreferencesSection { 11 | String getTitle(); 12 | 13 | Icon getIcon(); 14 | 15 | JPanel getPanel(); 16 | 17 | void retrievePreferences(); 18 | 19 | void storePreferences(); 20 | } 21 | -------------------------------------------------------------------------------- /src/jebl/evolution/io/AlignmentImporter.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.io; 2 | 3 | import jebl.evolution.alignments.Alignment; 4 | 5 | import java.io.IOException; 6 | import java.util.List; 7 | 8 | /** 9 | * @author Andrew Rambaut 10 | * @author Alexei Drummond 11 | * 12 | * @version $Id: AlignmentImporter.java 185 2006-01-23 23:03:18Z rambaut $ 13 | */ 14 | public interface AlignmentImporter { 15 | 16 | /** 17 | * importAlignment. 18 | */ 19 | List importAlignments() throws IOException, ImportException; 20 | } 21 | -------------------------------------------------------------------------------- /src/jebl/evolution/treemetrics/RootedTreeMetric.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.treemetrics; 2 | 3 | import jebl.evolution.trees.RootedTree; 4 | 5 | /** 6 | * @author rambaut 7 | * Date: Jun 25, 2006 8 | * Time: 12:12:34 AM 9 | */ 10 | public interface RootedTreeMetric { 11 | /** 12 | * calculates the metric between two rooted trees 13 | * @param tree1 first tree 14 | * @param tree2 second tree 15 | * @return the tree metric value 16 | */ 17 | double getMetric(RootedTree tree1, RootedTree tree2); 18 | } 19 | -------------------------------------------------------------------------------- /src/jebl/evolution/graphs/Edge.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.graphs; 2 | 3 | import jebl.util.Attributable; 4 | 5 | /** 6 | * Represents a node in a graph or tree. In general it is 7 | * used only as a handle to traverse a graph or tree structure and 8 | * it has no methods or instance variables. 9 | * 10 | * @author Andrew Rambaut 11 | * @author Alexei Drummond 12 | * 13 | * @version $Id: Edge.java 295 2006-04-14 14:59:10Z rambaut $ 14 | */ 15 | public interface Edge extends Attributable { 16 | 17 | double getLength(); 18 | } 19 | -------------------------------------------------------------------------------- /src/jebl/gui/trees/treeviewer_dev/decorators/Decorator.java: -------------------------------------------------------------------------------- 1 | package jebl.gui.trees.treeviewer_dev.decorators; 2 | 3 | import jebl.evolution.taxa.Taxon; 4 | 5 | import java.awt.*; 6 | 7 | /** 8 | * @author Andrew Rambaut 9 | * @version $Id: Decorator.java 433 2006-08-27 19:34:13Z rambaut $ 10 | */ 11 | public interface Decorator { 12 | 13 | void setItem(Object item); 14 | 15 | Paint getPaint(Paint paint); 16 | Paint getFillPaint(Paint paint); 17 | Stroke getStroke(Stroke stroke); 18 | Font getFont(Font font); 19 | } 20 | -------------------------------------------------------------------------------- /src/jade/simulate/Connection.java: -------------------------------------------------------------------------------- 1 | package jade.simulate; 2 | 3 | public class Connection { 4 | public Connection(Area dest, double start, double end, double func){ 5 | this.dest = dest; 6 | this.start = start; 7 | this.end = end; 8 | this.func = func; 9 | } 10 | public Area getDest(){return dest;} 11 | public double getStart(){return start;} 12 | public double getEnd(){return end;} 13 | public double getFunc(){return func;} 14 | private Area dest; 15 | private double start; 16 | private double end; 17 | private double func; 18 | } 19 | -------------------------------------------------------------------------------- /src/jebl/evolution/treesimulation/IntervalGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * IntervalGenerator.java 3 | * 4 | * (c) 2005 JEBL Development Team 5 | * 6 | * This package is distributed under the 7 | * Lesser Gnu Public Licence (LGPL) 8 | */ 9 | package jebl.evolution.treesimulation; 10 | 11 | /** 12 | * @author Andrew Rambaut 13 | * @author Alexei Drummond 14 | * @version $Id: IntervalGenerator.java 563 2006-12-07 17:43:10Z rambaut $ 15 | */ 16 | public interface IntervalGenerator { 17 | double getInterval(double criticalValue, int lineageCount, double currentHeight); 18 | } 19 | -------------------------------------------------------------------------------- /src/org/virion/jam/framework/MenuBarFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * MenuBarFactory.java 3 | */ 4 | 5 | package org.virion.jam.framework; 6 | 7 | import javax.swing.*; 8 | import java.awt.*; 9 | 10 | public interface MenuBarFactory { 11 | 12 | public final static int MENU_MASK = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(); 13 | 14 | void populateMenuBar(JMenuBar menuBar, AbstractFrame frame); 15 | void deregisterMenuFactories(); 16 | void registerPermanentMenuFactory(MenuFactory menuFactory); 17 | void registerMenuFactory(MenuFactory menuFactory); 18 | } -------------------------------------------------------------------------------- /src/jebl/evolution/io/AlignmentExporter.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.io; 2 | 3 | import jebl.evolution.alignments.Alignment; 4 | 5 | import java.io.IOException; 6 | 7 | /** 8 | * @author Andrew Rambaut 9 | * @author Alexei Drummond 10 | * 11 | * @version $Id: AlignmentExporter.java 540 2006-11-23 19:59:23Z pepster $ 12 | */ 13 | public interface AlignmentExporter { 14 | 15 | /** 16 | * export one alignment. 17 | * @param alignment to export 18 | * @throws java.io.IOException 19 | */ 20 | void exportAlignment(Alignment alignment) throws IOException; 21 | } 22 | -------------------------------------------------------------------------------- /src/jebl/evolution/io/SequenceExporter.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.io; 2 | 3 | import jebl.evolution.sequences.Sequence; 4 | 5 | import java.io.IOException; 6 | import java.util.List; 7 | import java.util.Collection; 8 | 9 | /** 10 | * @author Andrew Rambaut 11 | * @author Alexei Drummond 12 | * 13 | * @version $Id: SequenceExporter.java 429 2006-08-26 18:17:39Z rambaut $ 14 | */ 15 | public interface SequenceExporter { 16 | 17 | /** 18 | * exportSequences. 19 | */ 20 | void exportSequences(Collection sequences) throws IOException; 21 | } 22 | -------------------------------------------------------------------------------- /src/jebl/evolution/sequences/SequenceStateException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * SequenceStateException.java 3 | * 4 | * (c) 2002-2005 JEBL Development Core Team 5 | * 6 | * This package may be distributed under the 7 | * Lesser Gnu Public Licence (LGPL) 8 | */ 9 | package jebl.evolution.sequences; 10 | 11 | /** 12 | * @author Andrew Rambaut 13 | * @author Alexei Drummond 14 | * 15 | * @version $Id: SequenceStateException.java 185 2006-01-23 23:03:18Z rambaut $ 16 | */ 17 | public class SequenceStateException extends Exception { 18 | public SequenceStateException(String s) { 19 | super(s); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/jebl/evolution/io/DistanceMatrixImporter.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.io; 2 | 3 | import jebl.evolution.distances.DistanceMatrix; 4 | 5 | import java.io.IOException; 6 | import java.util.List; 7 | 8 | /** 9 | * @author Andrew Rambaut 10 | * @author Alexei Drummond 11 | * @version $Id: DistanceMatrixImporter.java 185 2006-01-23 23:03:18Z rambaut $ 12 | */ 13 | public interface DistanceMatrixImporter { 14 | 15 | enum Triangle { LOWER, UPPER, BOTH }; 16 | 17 | /** 18 | * importDistances. 19 | */ 20 | List importDistanceMatrices() throws IOException, ImportException; 21 | } 22 | -------------------------------------------------------------------------------- /src/jade/lib/jade_reconstruct_area_PJNI.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | /* Header for class jade_reconstruct_area_PJNI */ 4 | 5 | #ifndef _Included_jade_reconstruct_area_PJNI 6 | #define _Included_jade_reconstruct_area_PJNI 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | /* 11 | * Class: jade_reconstruct_area_PJNI 12 | * Method: matrixExp 13 | * Signature: ([DI)[D 14 | */ 15 | JNIEXPORT jdoubleArray JNICALL Java_jade_reconstruct_area_PJNI_matrixExp 16 | (JNIEnv *, jobject, jdoubleArray, jint); 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | #endif 22 | -------------------------------------------------------------------------------- /src/phyutility/leafstability/Calculator.java: -------------------------------------------------------------------------------- 1 | package phyutility.leafstability; 2 | 3 | import jade.tree.*; 4 | import java.util.*; 5 | 6 | public class Calculator { 7 | public Calculator(){} 8 | public int calc(String [] inner, String [] outer, Tree tree){ 9 | int ret = 0; 10 | Node inn = tree.getMRCA(inner); 11 | Node out = tree.getMRCA(outer); 12 | Node temp = inn; 13 | ArrayList path = new ArrayList(); 14 | while(inn.getParent()!=null){ 15 | path.add(inn.getParent()); 16 | inn = inn.getParent(); 17 | } 18 | if(path.contains((Node)out)){ 19 | ret ++; 20 | } 21 | return ret; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/jebl/evolution/align/scores/ScoreMatrix.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.align.scores; 2 | 3 | /** 4 | * @author Alexei Drummond 5 | * 6 | * @version $Id: ScoreMatrix.java 360 2006-06-22 07:42:48Z pepster $ 7 | */ 8 | public interface ScoreMatrix { 9 | /** 10 | * 11 | * @return human readable name 12 | */ 13 | public String getName(); 14 | 15 | /** 16 | * @return the score for matching char x with char y 17 | */ 18 | float getScore(char x, char y); 19 | 20 | /** 21 | * @return a string containing the valid characters for this score matrix. 22 | */ 23 | String getAlphabet(); 24 | } 25 | -------------------------------------------------------------------------------- /src/jebl/evolution/align/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | jebl.evolution.align package 5 | 6 | 7 | 8 | Provides classes and interfaces for pairwise alignment of two sequences. 9 | All major algorithms including Smith-Waterman and Needleman-Wunsch 10 | are implemented. 11 |

12 | Some of the classes in this package are based on source code by Peter Sestoft, sestoft@dina.kvl.dk. 13 | His original source code can be at 14 | http://www.dina.kvl.dk/~sestoft/bsa.html 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/jebl/evolution/align/scores/AminoAcidScores.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.align.scores; 2 | 3 | /** 4 | * @author Alexei Drummond 5 | * 6 | * @version $Id: AminoAcidScores.java 360 2006-06-22 07:42:48Z pepster $ 7 | */ 8 | public class AminoAcidScores extends Scores { 9 | 10 | private String residues = "ARNDCQEGHILKMFPSTWYV"; 11 | 12 | public String getName() { 13 | return toString(); 14 | } 15 | 16 | public final String getAlphabet() { return residues + getExtraResidues(); } 17 | 18 | 19 | public AminoAcidScores() { 20 | } 21 | 22 | public AminoAcidScores(float m, float n) { 23 | buildScores(m, n); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/jade/reconstruct/area/AncSplit.java: -------------------------------------------------------------------------------- 1 | package jade.reconstruct.area; 2 | 3 | public class AncSplit { 4 | public AncSplit(int [] ancdists, int [][] descdists, double weight, double likelihood){ 5 | this.weight = weight; 6 | this.likelihood = likelihood; 7 | this.ancdist = ancdists; 8 | this.descdists = descdists; 9 | } 10 | private double weight; 11 | private double likelihood; 12 | private int [][] descdists; 13 | private int [] ancdist; 14 | 15 | public double get_weight(){return weight;} 16 | public double get_like(){return likelihood;} 17 | public int [] get_ancdist(){return ancdist;} 18 | public int [][] get_descdists(){return descdists;} 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/jebl/evolution/sequences/Sequences.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Sequences.java 3 | * 4 | * (c) 2002-2005 JEBL Development Core Team 5 | * 6 | * This package may be distributed under the 7 | * Lesser Gnu Public Licence (LGPL) 8 | */ 9 | package jebl.evolution.sequences; 10 | 11 | import jebl.evolution.taxa.Taxon; 12 | 13 | import java.util.Set; 14 | 15 | /** 16 | * A set of sequence objects. 17 | * 18 | * @author Andrew Rambaut 19 | * @author Alexei Drummond 20 | * 21 | * @version $Id: Sequences.java 185 2006-01-23 23:03:18Z rambaut $ 22 | */ 23 | public interface Sequences { 24 | 25 | Set getSequences(); 26 | 27 | Sequence getSequence(Taxon taxon); 28 | } 29 | -------------------------------------------------------------------------------- /src/jebl/math/MatrixCalcException.java: -------------------------------------------------------------------------------- 1 | package jebl.math; 2 | 3 | 4 | public class MatrixCalcException extends Exception{ 5 | public MatrixCalcException() { super(); } 6 | public MatrixCalcException(String message) { super(message); } 7 | 8 | public static class NotSquareMatrixException extends MatrixCalcException { 9 | public NotSquareMatrixException() { super(); } 10 | public NotSquareMatrixException(String message) { super(message); } 11 | } 12 | public static class PositiveDefiniteException extends MatrixCalcException { 13 | public PositiveDefiniteException() { super(); } 14 | public PositiveDefiniteException(String message) { super(message); } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/org/virion/jam/html/HTMLViewer.java: -------------------------------------------------------------------------------- 1 | package org.virion.jam.html; 2 | 3 | import javax.swing.*; 4 | import java.awt.*; 5 | 6 | /** 7 | * General-purpose class to display HTML in a standalone frame. 8 | */ 9 | public class HTMLViewer extends JFrame { 10 | 11 | private JEditorPane editorPane; 12 | 13 | public HTMLViewer(String title, String html) { 14 | super(title); 15 | getContentPane().setLayout(new BorderLayout()); 16 | editorPane = new JEditorPane("text/html", html); 17 | editorPane.setEditable(false); 18 | getContentPane().add(new JScrollPane(editorPane), BorderLayout.CENTER); 19 | } 20 | } 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/jebl/evolution/align/scores/Hamming.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.align.scores; 2 | 3 | 4 | /** 5 | * @author Andrew Rambaut 6 | * 7 | * @version $Id: Hamming.java 185 2006-01-23 23:03:18Z rambaut $ 8 | */ 9 | 10 | public class Hamming extends NucleotideScores { 11 | 12 | private final float[][] residueScores = { 13 | 14 | /* A C G T U */ 15 | { 0}, 16 | { -1, 0}, 17 | { -1, -1, 0}, 18 | { -1, -1, -1, 0}, 19 | { -1, -1, -1, 0, 0}}; 20 | 21 | public Hamming() { buildScores(residueScores); } 22 | 23 | public String toString() { 24 | return "Hamming (0/-1)"; 25 | } 26 | } -------------------------------------------------------------------------------- /src/org/virion/jam/controlpanels/ControlPalette.java: -------------------------------------------------------------------------------- 1 | package org.virion.jam.controlpanels; 2 | 3 | import javax.swing.*; 4 | 5 | /** 6 | * Date: 20/03/2006 7 | * Time: 10:23:21 8 | * 9 | * @author Joseph Heled 10 | * @version $Id: ControlPalette.java 482 2006-10-25 06:30:57Z twobeers $ 11 | */ 12 | public interface ControlPalette { 13 | 14 | JPanel getPanel(); 15 | 16 | void addControlsProvider(ControlsProvider provider, boolean addAtStart); 17 | 18 | void fireControlsChanged(); 19 | 20 | void addControlPanelListener(ControlPaletteListener listener); 21 | 22 | void removeControlPanelListener(ControlPaletteListener listener); 23 | 24 | void setupControls(); 25 | } 26 | -------------------------------------------------------------------------------- /src/jade/data/TransitionPenaltyTable.java: -------------------------------------------------------------------------------- 1 | // TransitionPenaltyTable.java 2 | // 3 | // (c) 1999-2001 PAL Development Core Team 4 | // 5 | // This package may be distributed under the 6 | // terms of the Lesser GNU General Public License (LGPL) 7 | 8 | 9 | package jade.data; 10 | 11 | 12 | /** 13 | * Implements a table of transition penalties for a particular datatype. 14 | * Used for alignment scoring. 15 | * 16 | * @version $Id: TransitionPenaltyTable.java,v 1.2 2001/07/13 14:39:13 korbinian Exp $ 17 | * 18 | * @author Alexei Drummond 19 | */ 20 | public interface TransitionPenaltyTable { 21 | 22 | double penalty(int a, int b); 23 | DataType getDataType(); 24 | } 25 | -------------------------------------------------------------------------------- /src/jebl/evolution/alignments/Alignment.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Alignment.java 3 | * 4 | * (c) 2005-2006 JEBL Development Team 5 | * 6 | * This package is distributed under the 7 | * Lesser Gnu Public Licence (LGPL) 8 | */ 9 | package jebl.evolution.alignments; 10 | 11 | import jebl.evolution.sequences.Sequence; 12 | import jebl.evolution.sequences.Sequences; 13 | 14 | import java.util.List; 15 | 16 | /** 17 | * @author Andrew Rambaut 18 | * @author Alexei Drummond 19 | * 20 | * @version $Id: Alignment.java 314 2006-05-03 01:21:14Z alexeidrummond $ 21 | */ 22 | public interface Alignment extends Sequences, Patterns { 23 | 24 | List getSequenceList(); 25 | 26 | int getSiteCount(); 27 | } 28 | -------------------------------------------------------------------------------- /src/jebl/evolution/graphs/Node.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Node.java 3 | * 4 | * (c) 2005 JEBL Development Team 5 | * 6 | * This package is distributed under the 7 | * Lesser Gnu Public Licence (LGPL) 8 | */ 9 | package jebl.evolution.graphs; 10 | 11 | import jebl.util.Attributable; 12 | 13 | /** 14 | * Represents a node in a graph or tree. In general it is 15 | * used only as a handle to traverse a graph or tree structure and 16 | * it has no methods or instance variables. 17 | * 18 | * @author Andrew Rambaut 19 | * @author Alexei Drummond 20 | * 21 | * @version $Id: Node.java 295 2006-04-14 14:59:10Z rambaut $ 22 | */ 23 | public interface Node extends Attributable { 24 | 25 | int getDegree(); 26 | } 27 | -------------------------------------------------------------------------------- /src/jebl/evolution/alignments/BootstrappedAlignment.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.alignments; 2 | 3 | import jebl.math.Random; 4 | 5 | /** 6 | * Date: 15/01/2006 7 | * Time: 10:13:50 8 | * 9 | * @author Joseph Heled 10 | * @version $Id: BootstrappedAlignment.java 585 2006-12-15 15:48:59Z twobeers $ 11 | * 12 | */ 13 | public class BootstrappedAlignment extends ResampledAlignment { 14 | 15 | public BootstrappedAlignment(Alignment srcAlignment) { 16 | final int nSites = srcAlignment.getSiteCount(); 17 | int[] sites = new int[nSites]; 18 | 19 | for(int n = 0; n < nSites; ++n) { 20 | sites[n] = Random.nextInt(nSites); 21 | } 22 | 23 | init(srcAlignment, sites); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/org/virion/jam/toolbar/ToolbarOptions.java: -------------------------------------------------------------------------------- 1 | package org.virion.jam.toolbar; 2 | 3 | /** 4 | * @author rambaut 5 | * Date: Oct 18, 2005 6 | * Time: 10:23:01 PM 7 | */ 8 | public final class ToolbarOptions { 9 | 10 | public static final int ICON_AND_TEXT = 0; 11 | public static final int ICON_ONLY = 1; 12 | public static final int TEXT_ONLY = 2; 13 | 14 | public ToolbarOptions(int display, boolean smallSize) { 15 | this.display = display; 16 | this.smallSize = smallSize; 17 | } 18 | 19 | public int getDisplay() { 20 | return display; 21 | } 22 | 23 | public boolean getSmallSize() { 24 | return smallSize; 25 | } 26 | 27 | private int display = ICON_AND_TEXT; 28 | private boolean smallSize = false; 29 | } 30 | -------------------------------------------------------------------------------- /src/jade/math/ProbDistribution.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ProbDistribution.java 3 | * 4 | * Created on August 9, 2005, 3:09 PM 5 | * 6 | * To change this template, choose Tools | Options and locate the template under 7 | * the Source Creation and Management node. Right-click the template and choose 8 | * Open. You can then make changes to the template in the Source Editor. 9 | */ 10 | 11 | package jade.math; 12 | 13 | /** 14 | * 15 | * @author stephensmith 16 | */ 17 | public interface ProbDistribution { 18 | /** 19 | *@return double value 20 | */ 21 | public double getValue(); 22 | 23 | /** 24 | *@return the integral of the probability density function from 0 to x 25 | */ 26 | public double getPDF(double x); 27 | } 28 | -------------------------------------------------------------------------------- /src/jebl/evolution/trees/HashPair.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.trees; 2 | 3 | /** 4 | * A pair suitable for use in a HashMap. 5 | * 6 | * @author Joseph Heled 7 | * 8 | * @version $Id: HashPair.java 544 2006-11-28 00:06:19Z twobeers $ 9 | */ 10 | 11 | class HashPair { 12 | HashPair(T a, T b) { 13 | first = a; 14 | second = b; 15 | } 16 | 17 | public int hashCode() { 18 | return first.hashCode() + second.hashCode(); 19 | } 20 | 21 | public boolean equals(Object x) { 22 | if( x instanceof HashPair ) { 23 | return ((HashPair) x).first.equals(first) && ((HashPair )x).second.equals(second); 24 | } 25 | return false; 26 | } 27 | 28 | public final T first; 29 | public final T second; 30 | } -------------------------------------------------------------------------------- /src/jebl/evolution/align/MultipleAligner.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.align; 2 | 3 | import jebl.evolution.alignments.Alignment; 4 | import jebl.evolution.sequences.Sequence; 5 | import jebl.evolution.trees.RootedTree; 6 | import jebl.util.ProgressListener; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * @author Joseph Heled 12 | * @version $Id: MultipleAligner.java 482 2006-10-25 06:30:57Z twobeers $ 13 | * Date: 6/05/2006 Time: 08:08:22 14 | */ 15 | public interface MultipleAligner { 16 | Alignment doAlign(List seqs, RootedTree guideTree, ProgressListener progress); 17 | 18 | Alignment doAlign(Alignment a1, Alignment a2, ProgressListener progress); 19 | 20 | Alignment doAlign(Alignment alignment, Sequence sequence, ProgressListener progress); 21 | } 22 | -------------------------------------------------------------------------------- /src/jebl/evolution/io/ImmediateSequenceImporter.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.io; 2 | 3 | import jebl.evolution.sequences.Sequence; 4 | import jebl.util.ProgressListener; 5 | 6 | import java.io.IOException; 7 | 8 | /** 9 | * 10 | * A sequence importer sending the sequences back one by one, which makes it 11 | * possible to import larger documents if handled wisely on the other side. 12 | * 13 | * @author Joseph Heled 14 | * @version $Id: ImmediateSequenceImporter.java 465 2006-10-04 04:24:20Z twobeers $ 15 | * 16 | */ 17 | public interface ImmediateSequenceImporter { 18 | public interface Callback { 19 | void add(Sequence seq); 20 | } 21 | 22 | void importSequences(Callback callback, ProgressListener progressListener) throws IOException, ImportException; 23 | } 24 | -------------------------------------------------------------------------------- /src/jebl/evolution/io/SequenceImporter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * SequenceImporter.java 3 | * 4 | * (c) 2002-2005 BEAST Development Core Team 5 | * 6 | * This package may be distributed under the 7 | * Lesser Gnu Public Licence (LGPL) 8 | */ 9 | 10 | package jebl.evolution.io; 11 | 12 | import jebl.evolution.sequences.Sequence; 13 | 14 | import java.io.IOException; 15 | import java.util.List; 16 | 17 | /** 18 | * Interface for importers that do sequences 19 | * 20 | * @author Andrew Rambaut 21 | * @author Alexei Drummond 22 | * 23 | * @version $Id: SequenceImporter.java 442 2006-09-05 21:59:20Z matt_kearse $ 24 | */ 25 | public interface SequenceImporter { 26 | 27 | /** 28 | * importSequences. 29 | */ 30 | List importSequences() throws IOException, ImportException; 31 | } 32 | -------------------------------------------------------------------------------- /src/jade/reconstruct/area/BayesChain.java: -------------------------------------------------------------------------------- 1 | package jade.reconstruct.area; 2 | 3 | import java.util.*; 4 | 5 | public class BayesChain { 6 | public BayesChain(double disp_sliding_window,double ext_sliding_window){ 7 | this.disp_sliding_window = disp_sliding_window; 8 | this.ext_sliding_window = ext_sliding_window; 9 | } 10 | public double score; 11 | public double vag; 12 | public double ext; 13 | public double ext_sliding_window; 14 | public double disp_sliding_window; 15 | public double next_ext(double cur){ 16 | return Math.abs(cur -(ext_sliding_window/2)+(ext_sliding_window*ran.nextDouble())); 17 | } 18 | public double next_disp(double cur){ 19 | return Math.abs(cur -(disp_sliding_window/2)+(disp_sliding_window*ran.nextDouble())); 20 | } 21 | private Random ran = new Random(); 22 | } 23 | -------------------------------------------------------------------------------- /src/jebl/evolution/io/TreeExporter.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.io; 2 | 3 | import jebl.evolution.alignments.Alignment; 4 | import jebl.evolution.trees.Tree; 5 | 6 | import java.io.IOException; 7 | import java.util.Collection; 8 | 9 | /** 10 | * @author Andrew Rambaut 11 | * @author Alexei Drummond 12 | * 13 | * @version $Id: TreeExporter.java 429 2006-08-26 18:17:39Z rambaut $ 14 | */ 15 | public interface TreeExporter { 16 | 17 | /** 18 | * Export a single tree 19 | * @param tree 20 | * @throws IOException 21 | */ 22 | void exportTree(Tree tree) throws IOException; 23 | 24 | /** 25 | * Export a collection of trees 26 | * @param trees 27 | * @throws IOException 28 | */ 29 | void exportTrees(Collection trees) throws IOException; 30 | } 31 | -------------------------------------------------------------------------------- /src/jade/reconstruct/area/P.java: -------------------------------------------------------------------------------- 1 | /* 2 | * P.java 3 | * 4 | * Created on April 11, 2005, 9:30 PM 5 | */ 6 | 7 | package jade.reconstruct.area; 8 | 9 | 10 | /** 11 | * 12 | * @author stephensmith 13 | */ 14 | public class P { 15 | 16 | /** Creates a new instance of P */ 17 | public P(Q qin) { 18 | q=qin; 19 | me = new MatrixExponential(q.getQ().length); 20 | me.updateByRelativeRates(q.getQ()); 21 | } 22 | 23 | public double getRateChangeProbability(int row, int column){ 24 | return me.getTransitionProbability(row,column); 25 | } 26 | 27 | public void setBL(double b){ 28 | me.setDistance(b); 29 | } 30 | 31 | //private double [][]arr; 32 | //private double bl; 33 | private Q q; 34 | private MatrixExponential me; 35 | } 36 | -------------------------------------------------------------------------------- /src/jebl/evolution/align/PairwiseAligner.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.align; 2 | 3 | import jebl.evolution.sequences.Sequence; 4 | import jebl.evolution.alignments.Alignment; 5 | import jebl.util.ProgressListener; 6 | 7 | /** 8 | * @author Joseph Heled 9 | * @version $Id: PairwiseAligner.java 315 2006-05-03 02:13:54Z alexeidrummond $ 10 | * 11 | */ 12 | public interface PairwiseAligner { 13 | 14 | public class Result { 15 | final public Alignment alignment; 16 | final public double score; 17 | 18 | Result(Alignment alignment, double score) { 19 | this.alignment = alignment; 20 | this.score = score; 21 | } 22 | } 23 | 24 | Result doAlignment(Sequence seq1, Sequence seq2, ProgressListener progress); 25 | 26 | double getScore(Sequence seq1, Sequence seq2); 27 | } 28 | -------------------------------------------------------------------------------- /src/jebl/evolution/sequences/TranslatedSequence.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.sequences; 2 | 3 | /** 4 | * @author rambaut 5 | * Date: Jul 27, 2005 6 | * Time: 12:48:31 AM 7 | */ 8 | public class TranslatedSequence extends FilteredSequence { 9 | 10 | public TranslatedSequence(Sequence source, GeneticCode geneticCode) { 11 | super(source); 12 | 13 | this.geneticCode = geneticCode; 14 | } 15 | 16 | protected State[] filterSequence(Sequence source) { 17 | return jebl.evolution.sequences.Utils.translate(source.getStates(), geneticCode); 18 | } 19 | 20 | /** 21 | * @return the type of symbols that this sequence is made up of. 22 | */ 23 | public SequenceType getSequenceType() { 24 | return SequenceType.AMINO_ACID; 25 | } 26 | 27 | private final GeneticCode geneticCode; 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/org/virion/jam/panels/StatusBar.java: -------------------------------------------------------------------------------- 1 | package org.virion.jam.panels; 2 | 3 | import javax.swing.*; 4 | import java.awt.*; 5 | 6 | /** 7 | * @author rambaut 8 | * Date: Oct 12, 2004 9 | * Time: 12:18:09 AM 10 | */ 11 | public class StatusBar extends StatusPanel { 12 | public StatusBar(String initialText) { 13 | super(initialText); 14 | 15 | setBorder(BorderFactory.createCompoundBorder( 16 | BorderFactory.createMatteBorder(0, 0, 1, 0, Color.gray), 17 | BorderFactory.createEmptyBorder(2, 12, 2, 12))); 18 | // panel.setBackground(new Color(0.0F, 0.0F, 0.0F, 0.05F)); 19 | 20 | } 21 | 22 | public void paintComponent(Graphics g) { 23 | super.paintComponent(g); 24 | g.setColor(new Color(0.0F, 0.0F, 0.0F, 0.05F)); 25 | g.fillRect(0, 0, getWidth(), getHeight()); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/jebl/evolution/sequences/CodonState.java: -------------------------------------------------------------------------------- 1 | /* 2 | * CodonState.java 3 | * 4 | * (c) 2002-2005 JEBL Development Core Team 5 | * 6 | * This package may be distributed under the 7 | * Lesser Gnu Public Licence (LGPL) 8 | */ 9 | package jebl.evolution.sequences; 10 | 11 | /** 12 | * @author Andrew Rambaut 13 | * @author Alexei Drummond 14 | * 15 | * @version $Id: CodonState.java 225 2006-02-16 14:50:36Z rambaut $ 16 | */ 17 | public final class CodonState extends State { 18 | 19 | CodonState(String name, String stateCode, int index) { 20 | super(name, stateCode, index); 21 | } 22 | 23 | CodonState(String name, String stateCode, int index, CodonState[] ambiguities) { 24 | super(name, stateCode, index, ambiguities); 25 | } 26 | 27 | public boolean isGap() { 28 | return this == Codons.GAP_STATE; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/jebl/evolution/aligners/Aligner.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.aligners; 2 | 3 | import jebl.evolution.alignments.Alignment; 4 | import jebl.evolution.sequences.Sequence; 5 | import jebl.util.ProgressListener; 6 | 7 | import java.util.Collection; 8 | 9 | /** 10 | * 11 | * As of 2006-12-06, this interface is not used anywhere in JEBL, and it doesn't have 12 | * any implementing classes. It is only a proposed future alternative to the existing 13 | * abstract class Align 14 | * 15 | * @author Andrew Rambaut 16 | * @author Alexei Drummond 17 | * @version $Id: Aligner.java 559 2006-12-06 22:20:38Z twobeers $ 18 | */ 19 | public interface Aligner { 20 | 21 | Alignment alignSequences(Collection sequences); 22 | 23 | void addProgressListener(ProgressListener listener); 24 | 25 | void removeProgressListener(ProgressListener listener); 26 | } 27 | -------------------------------------------------------------------------------- /src/jebl/gui/trees/treeviewer/painters/AbstractPainter.java: -------------------------------------------------------------------------------- 1 | package jebl.gui.trees.treeviewer.painters; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | /** 7 | * @author Andrew Rambaut 8 | * @version $Id: AbstractPainter.java 181 2006-01-23 17:31:10Z rambaut $ 9 | */ 10 | public abstract class AbstractPainter implements Painter { 11 | public void addPainterListener(PainterListener listener) { 12 | listeners.add(listener); 13 | } 14 | 15 | public void removePainterListener(PainterListener listener) { 16 | listeners.remove(listener); 17 | } 18 | 19 | public void firePainterChanged() { 20 | for (PainterListener listener : listeners) { 21 | listener.painterChanged(); 22 | } 23 | } 24 | private final List listeners = new ArrayList(); 25 | } 26 | -------------------------------------------------------------------------------- /src/org/virion/jam/panels/SearchPanelListener.java: -------------------------------------------------------------------------------- 1 | package org.virion.jam.panels; 2 | 3 | /** 4 | * An interface for listeners to the SearchPanel class. 5 | * @author Andrew Rambaut 6 | * Date: Jul 26, 2004 7 | * Time: 5:37:15 PM 8 | */ 9 | public interface SearchPanelListener { 10 | 11 | /** 12 | * Called when the user requests a search by pressing return having 13 | * typed a search string into the text field. If the continuousUpdate 14 | * flag is true then this method is called when the user types into 15 | * the text field. 16 | * @param searchString the user's search string 17 | */ 18 | void searchStarted(String searchString); 19 | 20 | /** 21 | * Called when the user presses the cancel search button or presses 22 | * escape while the search is in focus. 23 | */ 24 | void searchStopped(); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/jade/math/IncompleteGammaFunctionSeries.java: -------------------------------------------------------------------------------- 1 | /* 2 | * IncompleteGammaFunctionSeries.java 3 | * 4 | * Created on August 19, 2005, 11:21 AM 5 | * 6 | * author: Stephen A. Smith 7 | */ 8 | 9 | package jade.math; 10 | 11 | /** 12 | * 13 | * @author stephensmith 14 | */ 15 | public class IncompleteGammaFunctionSeries extends InfiniteSeries{ 16 | 17 | /** Creates a new instance of IncompleteGammaFunctionSeries */ 18 | public IncompleteGammaFunctionSeries(double x) { 19 | alpha = x; 20 | } 21 | 22 | protected void computeTermAt(int n){ 23 | sum += 1; 24 | lastTerm *= x/sum; 25 | return; 26 | } 27 | 28 | protected double initialValue(){ 29 | lastTerm = 1/alpha; 30 | sum = alpha; 31 | return lastTerm; 32 | } 33 | 34 | private double alpha; 35 | private double sum; 36 | } 37 | -------------------------------------------------------------------------------- /src/jade/simulate/ExtinctionFunction.java: -------------------------------------------------------------------------------- 1 | package jade.simulate; 2 | 3 | public class ExtinctionFunction { 4 | public ExtinctionFunction(double intime, double endtime, double value){ 5 | start = intime; 6 | end = endtime; 7 | this.value = value; 8 | } 9 | public double getStartTime(){return start;} 10 | public double getEndTime(){return end;} 11 | public double getFunction(){ 12 | return value; 13 | } 14 | public void setTimes(double intime, double endtime){ 15 | start = intime; 16 | end = endtime; 17 | } 18 | public String toString(){ 19 | String x = ""; 20 | x = "from "+start+" to "+end+" connection is 0 else extinction is "+value; 21 | return x; 22 | } 23 | //start time 24 | private double start; 25 | //end time 26 | private double end; 27 | //value 28 | private double value; 29 | } 30 | -------------------------------------------------------------------------------- /src/jade/math/IncompleteGammaFunctionFraction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * IncompleteGammaFunctionFraction.java 3 | * 4 | * Created on August 19, 2005, 12:27 PM 5 | * 6 | * author: Stephen A. Smith 7 | */ 8 | 9 | package jade.math; 10 | 11 | /** 12 | * 13 | * @author stephensmith 14 | */ 15 | public class IncompleteGammaFunctionFraction extends ContinuedFraction{ 16 | 17 | /** Creates a new instance of IncompleteGammaFunctionFraction */ 18 | public IncompleteGammaFunctionFraction(double a) { 19 | alpha = a; 20 | } 21 | 22 | protected void computeFactorsAt(int n){ 23 | sum+=2; 24 | factors[0] = (alpha-n)*n; 25 | factors[1] = sum; 26 | return; 27 | } 28 | 29 | protected double initialValue(){ 30 | sum = x-alpha+1; 31 | return sum; 32 | } 33 | 34 | private double alpha; 35 | private double sum; 36 | } 37 | -------------------------------------------------------------------------------- /src/org/virion/jam/demo/DemoMenuBarFactory.java: -------------------------------------------------------------------------------- 1 | package org.virion.jam.demo; 2 | 3 | import org.virion.jam.framework.*; 4 | import org.virion.jam.mac.*; 5 | import org.virion.jam.demo.menus.DemoMenuFactory; 6 | 7 | 8 | public class DemoMenuBarFactory extends DefaultMenuBarFactory { 9 | 10 | public DemoMenuBarFactory() { 11 | if (org.virion.jam.mac.Utils.isMacOSX()) { 12 | registerMenuFactory(new MacFileMenuFactory(true)); 13 | registerMenuFactory(new DefaultEditMenuFactory()); 14 | registerMenuFactory(new DemoMenuFactory()); 15 | registerMenuFactory(new MacWindowMenuFactory()); 16 | registerMenuFactory(new MacHelpMenuFactory()); 17 | } else { 18 | registerMenuFactory(new DefaultFileMenuFactory(true)); 19 | registerMenuFactory(new DefaultEditMenuFactory()); 20 | registerMenuFactory(new DemoMenuFactory()); 21 | registerMenuFactory(new DefaultHelpMenuFactory()); 22 | } 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /src/jebl/evolution/substmodel/AminoAcidModel.java: -------------------------------------------------------------------------------- 1 | // AminoAcidModel.java 2 | // 3 | // (c) 1999-2001 PAL Development Core Team 4 | // 5 | // This package may be distributed under the 6 | // terms of the Lesser GNU General Public License (LGPL) 7 | 8 | package jebl.evolution.substmodel; 9 | 10 | import jebl.evolution.sequences.SequenceType; 11 | 12 | 13 | /** 14 | * base class of rate matrices for amino acids 15 | * 16 | * @version $Id: AminoAcidModel.java 185 2006-01-23 23:03:18Z rambaut $ 17 | * 18 | * @author Korbinian Strimmer 19 | */ 20 | public abstract class AminoAcidModel extends AbstractRateMatrix 21 | { 22 | 23 | // 24 | // Protected stuff 25 | // 26 | 27 | // Constructor 28 | protected AminoAcidModel(double[] f) 29 | { 30 | // Dimension = 20 31 | super(20); 32 | 33 | setSequenceType(SequenceType.AMINO_ACID); 34 | setFrequencies(f); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/jebl/evolution/alignments/JackknifedAlignment.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.alignments; 2 | 3 | import jebl.math.Random; 4 | 5 | /** 6 | * Date: 17/01/2006 7 | * Time: 08:18:32 8 | * 9 | * @author Joseph Heled 10 | * @version $Id: JackknifedAlignment.java 482 2006-10-25 06:30:57Z twobeers $ 11 | * 12 | */ 13 | public class JackknifedAlignment extends ResampledAlignment { 14 | public JackknifedAlignment(Alignment srcAlignment, double percent) { 15 | final int nSites = srcAlignment.getSiteCount(); 16 | final int nNewSites = (int)Math.ceil(nSites * percent); 17 | int[] sites = new int[nSites]; 18 | 19 | for(int n = 0; n < nSites; ++n) { 20 | sites[n] = n; 21 | } 22 | 23 | Random.shuffle(sites); 24 | 25 | int[] newSites = new int[nNewSites]; 26 | System.arraycopy(sites, 0, newSites, 0, nNewSites); 27 | init(srcAlignment, newSites); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/org/virion/jam/framework/MultiDocMenuBarFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Biomatters LTD. All Rights Reserved. 3 | */ 4 | 5 | package org.virion.jam.framework; 6 | 7 | import org.virion.jam.mac.MacFileMenuFactory; 8 | import org.virion.jam.mac.MacHelpMenuFactory; 9 | import org.virion.jam.mac.MacWindowMenuFactory; 10 | 11 | 12 | public class MultiDocMenuBarFactory extends DefaultMenuBarFactory { 13 | 14 | 15 | public MultiDocMenuBarFactory() { 16 | if (org.virion.jam.mac.Utils.isMacOSX()) { 17 | registerMenuFactory(new MacFileMenuFactory(true)); 18 | registerMenuFactory(new DefaultEditMenuFactory()); 19 | registerMenuFactory(new MacHelpMenuFactory()); 20 | registerMenuFactory(new MacWindowMenuFactory()); 21 | } else { 22 | registerMenuFactory(new DefaultFileMenuFactory(true)); 23 | registerMenuFactory(new DefaultEditMenuFactory()); 24 | registerMenuFactory(new DefaultHelpMenuFactory()); 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /src/org/virion/jam/framework/SingleDocMenuBarFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Biomatters LTD. All Rights Reserved. 3 | */ 4 | 5 | package org.virion.jam.framework; 6 | 7 | import org.virion.jam.mac.MacFileMenuFactory; 8 | import org.virion.jam.mac.MacHelpMenuFactory; 9 | import org.virion.jam.mac.MacWindowMenuFactory; 10 | 11 | 12 | public class SingleDocMenuBarFactory extends DefaultMenuBarFactory { 13 | 14 | public SingleDocMenuBarFactory() { 15 | if (org.virion.jam.mac.Utils.isMacOSX()) { 16 | registerMenuFactory(new MacFileMenuFactory(false)); 17 | registerMenuFactory(new DefaultEditMenuFactory()); 18 | registerMenuFactory(new MacWindowMenuFactory()); 19 | registerMenuFactory(new MacHelpMenuFactory()); 20 | } else { 21 | registerMenuFactory(new DefaultFileMenuFactory(false)); 22 | registerMenuFactory(new DefaultEditMenuFactory()); 23 | registerMenuFactory(new DefaultHelpMenuFactory()); 24 | } 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /src/jebl/util/AttributableHelper.java: -------------------------------------------------------------------------------- 1 | package jebl.util; 2 | 3 | import java.util.Collections; 4 | import java.util.HashMap; 5 | import java.util.Map; 6 | import java.util.Set; 7 | 8 | /** 9 | * @author rambaut 10 | * Date: Nov 27, 2005 11 | * Time: 1:31:50 PM 12 | */ 13 | public class AttributableHelper implements Attributable { 14 | 15 | public void setAttribute(String name, Object value) { 16 | attributeMap.put(name, value); 17 | } 18 | 19 | public Object getAttribute(String name) { 20 | return attributeMap.get(name); 21 | } 22 | 23 | public void removeAttribute(String name) { 24 | attributeMap.remove(name); 25 | } 26 | 27 | public Set getAttributeNames() { 28 | return attributeMap.keySet(); 29 | } 30 | 31 | public Map getAttributeMap() { 32 | return Collections.unmodifiableMap(attributeMap); 33 | } 34 | 35 | Map attributeMap = new HashMap(); 36 | } 37 | 38 | -------------------------------------------------------------------------------- /src/jade/runners/ConcatMain.java: -------------------------------------------------------------------------------- 1 | package jade.runners; 2 | 3 | import java.util.*; 4 | 5 | import jade.data.*; 6 | 7 | public class ConcatMain { 8 | public ConcatMain(String [] args){ 9 | if(args.length<1){ 10 | printInfo(); 11 | System.exit(0); 12 | } 13 | else{ 14 | ArrayList files = new ArrayList(); 15 | for(int i=0;i 9 | * created on 04.12.2006 15:15:54 10 | */ 11 | public enum IllegalCharacterPolicy { 12 | abort("Abort"), 13 | strip("Strip offending characters"), 14 | askUser("Ask"); 15 | 16 | public final String description; 17 | IllegalCharacterPolicy(String description) { 18 | this.description = description; 19 | } 20 | 21 | public static IllegalCharacterPolicy instanceOf(String description) { 22 | for (IllegalCharacterPolicy p : values()) { 23 | if (p.description.equals(description)) { 24 | return p; 25 | } 26 | } 27 | return null; 28 | } 29 | 30 | public String toString() { 31 | return description; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/org/virion/jam/framework/MenuFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * MenuBarFactory.java 3 | */ 4 | 5 | package org.virion.jam.framework; 6 | 7 | import javax.swing.*; 8 | 9 | public interface MenuFactory { 10 | 11 | public final static int LEFT = 0; 12 | public final static int CENTER = 1; 13 | public final static int RIGHT = 2; 14 | 15 | /** 16 | * Give the name of this menu. If multiple MenuFactories are 17 | * registered with the same name, then these will be appended 18 | * into a single actual menu. 19 | */ 20 | String getMenuName(); 21 | 22 | /** 23 | * This method should populate the menu with menu items. Reference 24 | * can be made to the frame in order to get Actions. 25 | * @param menu 26 | * @param frame 27 | */ 28 | void populateMenu(JMenu menu, AbstractFrame frame); 29 | 30 | /** 31 | * Returns the preferred alignment of the menu in the menu bar. This 32 | * should be one of MenuFactory.LEFT, MenuFactory.CENTER or MenuFactory.RIGHT. 33 | * @return the alignment 34 | */ 35 | int getPreferredAlignment(); 36 | } -------------------------------------------------------------------------------- /src/org/virion/jam/util/SimpleLongTask.java: -------------------------------------------------------------------------------- 1 | package org.virion.jam.util; 2 | 3 | public abstract class SimpleLongTask extends LongTask { 4 | 5 | boolean background = false; 6 | private SwingWorker worker = null; 7 | public int current = 0; 8 | public int length = 1; 9 | public boolean pleaseStop = false; 10 | public String message = ""; 11 | public String description = ""; 12 | 13 | /** 14 | * Called to find out how much work needs 15 | * to be done. 16 | */ 17 | public int getLengthOfTask() { 18 | return length; 19 | } 20 | 21 | /** 22 | * Called to find out how much has been done. 23 | */ 24 | public int getCurrent() { 25 | return current; 26 | } 27 | 28 | /** 29 | * Called to stop task. 30 | */ 31 | public void stop() { 32 | pleaseStop = true; 33 | } 34 | 35 | public String getMessage() { 36 | return message; 37 | } 38 | 39 | public String getDescription() { 40 | return description; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/jebl/math/UnivariateFunction.java: -------------------------------------------------------------------------------- 1 | // UnivariateFunction.java 2 | // 3 | // (c) 2006- JEBL development team 4 | // 5 | // based on LGPL code from the Phylogenetic Analysis Library (PAL), 6 | // http://www.cebl.auckland.ac.nz/pal-project/ 7 | // which is (c) 1999-2001 PAL Development Core Team 8 | // 9 | // This package may be distributed under the 10 | // terms of the Lesser GNU General Public License (LGPL) 11 | 12 | 13 | package jebl.math; 14 | 15 | 16 | /** 17 | * interface for a function of one variable 18 | * 19 | * @author Korbinian Strimmer 20 | */ 21 | public interface UnivariateFunction 22 | { 23 | /** 24 | * compute function value 25 | * 26 | * @param argument function argument 27 | * 28 | * @return function value 29 | */ 30 | double evaluate(double argument); 31 | 32 | /** 33 | * get lower bound of argument 34 | * 35 | * @return lower bound 36 | */ 37 | double getLowerBound(); 38 | 39 | /** 40 | * get upper bound of argument 41 | * 42 | * @return upper bound 43 | */ 44 | double getUpperBound(); 45 | } 46 | -------------------------------------------------------------------------------- /src/jebl/gui/trees/treeviewer_dev/painters/AbstractPainter.java: -------------------------------------------------------------------------------- 1 | package jebl.gui.trees.treeviewer_dev.painters; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | /** 7 | * @author Andrew Rambaut 8 | * @version $Id: AbstractPainter.java 373 2006-07-01 15:18:27Z rambaut $ 9 | */ 10 | public abstract class AbstractPainter implements Painter { 11 | public void addPainterListener(PainterListener listener) { 12 | listeners.add(listener); 13 | } 14 | 15 | public void removePainterListener(PainterListener listener) { 16 | listeners.remove(listener); 17 | } 18 | 19 | public void firePainterChanged() { 20 | for (PainterListener listener : listeners) { 21 | listener.painterChanged(); 22 | } 23 | } 24 | 25 | public void firePainterSettingsChanged() { 26 | for (PainterListener listener : listeners) { 27 | listener.painterSettingsChanged(); 28 | } 29 | } 30 | 31 | private final List listeners = new ArrayList(); 32 | } 33 | -------------------------------------------------------------------------------- /src/org/virion/jam/html/SimpleLinkListener.java: -------------------------------------------------------------------------------- 1 | package org.virion.jam.html; 2 | 3 | 4 | import javax.swing.event.*; 5 | 6 | import org.virion.jam.util.BrowserLauncher; 7 | 8 | /** 9 | * iSeek prototype. Codename seekquence. 10 | * 11 | * This class listens to Hyperlink Events, and opens the url in a browser window. 12 | * 13 | * Open a browser from a Java application on Windows, Unix, or Macintosh. 14 | * see http://ostermiller.org/utils/Browser.html for more information 15 | * 16 | * @author Nasser 17 | * @version $Id: SimpleLinkListener.java 183 2006-01-23 21:29:48Z rambaut $ 18 | * Date: 26/01/2005 19 | * Time: 11:54:50 20 | */ 21 | public class SimpleLinkListener implements HyperlinkListener { 22 | 23 | public void hyperlinkUpdate(HyperlinkEvent he) { 24 | 25 | if (he.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { 26 | try{ 27 | BrowserLauncher.openURL(he.getDescription()); 28 | }catch(Exception ioe){ 29 | ioe.printStackTrace(); 30 | } 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/jade/math/InfiniteSeries.java: -------------------------------------------------------------------------------- 1 | /* 2 | * InfiniteSeries.java 3 | * 4 | * Created on August 19, 2005, 11:24 AM 5 | * 6 | * author: Stephen A. Smith 7 | */ 8 | 9 | package jade.math; 10 | 11 | /** 12 | * 13 | * @author stephensmith 14 | */ 15 | public abstract class InfiniteSeries extends IterativeProcess{ 16 | 17 | /** Creates a new instance of InfiniteSeries */ 18 | public InfiniteSeries() { 19 | } 20 | 21 | protected abstract void computeTermAt(int n); 22 | public double evaluateIteration(){ 23 | computeTermAt(getIterations()); 24 | result+=lastTerm; 25 | return relativePrecision(Math.abs(lastTerm), Math.abs(result)); 26 | } 27 | public double getResult(){ 28 | return result; 29 | } 30 | public void initializeIterations(){ 31 | result = initialValue(); 32 | } 33 | protected abstract double initialValue(); 34 | public void setArgument(double r){ 35 | x = r; 36 | return; 37 | } 38 | 39 | private double result; 40 | protected double x; 41 | protected double lastTerm; 42 | } 43 | -------------------------------------------------------------------------------- /src/jebl/evolution/alignments/Patterns.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Patterns.java 3 | * 4 | * (c) 2005 JEBL Development Team 5 | * 6 | * This package is distributed under the 7 | * Lesser Gnu Public Licence (LGPL) 8 | */ 9 | package jebl.evolution.alignments; 10 | 11 | import jebl.evolution.sequences.SequenceType; 12 | import jebl.evolution.taxa.Taxon; 13 | 14 | import java.util.List; 15 | 16 | /** 17 | * An interface representing a set of site patterns. 18 | * 19 | * @author Andrew Rambaut 20 | * @author Alexei Drummond 21 | * 22 | * @version $Id: Patterns.java 185 2006-01-23 23:03:18Z rambaut $ 23 | */ 24 | public interface Patterns { 25 | 26 | int getPatternCount(); 27 | 28 | int getPatternLength(); 29 | 30 | /** 31 | * Get a list of all the patterns 32 | * @return the list 33 | */ 34 | List getPatterns(); 35 | 36 | /** 37 | * @return the list of taxa that the state values correspond to. 38 | */ 39 | List getTaxa(); 40 | 41 | /** 42 | * @return the data type of the states in these site patterns. 43 | */ 44 | SequenceType getSequenceType(); 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/org/virion/jam/mac/MacWindowMenuFactory.java: -------------------------------------------------------------------------------- 1 | package org.virion.jam.mac; 2 | 3 | import org.virion.jam.framework.MenuFactory; 4 | import org.virion.jam.framework.AbstractFrame; 5 | import org.virion.jam.framework.Application; 6 | import org.virion.jam.framework.MenuBarFactory; 7 | 8 | import javax.swing.*; 9 | import java.awt.event.KeyEvent; 10 | 11 | /** 12 | * @author rambaut 13 | * Date: Dec 26, 2004 14 | * Time: 11:03:39 AM 15 | */ 16 | public class MacWindowMenuFactory implements MenuFactory { 17 | public String getMenuName() { 18 | return "Window"; 19 | } 20 | 21 | public void populateMenu(JMenu menu, AbstractFrame frame) { 22 | 23 | Application application = Application.getApplication(); 24 | 25 | JMenuItem item; 26 | 27 | item = new JMenuItem(frame.getZoomWindowAction()); 28 | menu.add(item); 29 | 30 | item = new JMenuItem(frame.getMinimizeWindowAction()); 31 | item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_M, MenuBarFactory.MENU_MASK)); 32 | menu.add(item); 33 | 34 | } 35 | 36 | public int getPreferredAlignment() { 37 | return RIGHT; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/jebl/evolution/treemetrics/BilleraMetric.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.treemetrics; 2 | 3 | import jebl.evolution.taxa.Taxon; 4 | import jebl.evolution.trees.RootedTree; 5 | import jebl.evolution.trees.TreeBiPartitionInfo; 6 | 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | 10 | /** 11 | * Billera tree distance - sum of change in branch lengths required to transform one tree to the second 12 | * 13 | * Note that this interface is not optimal for a large set where all pairs are required. 14 | * Creating TreeBiPartitionInfo's as a pre step is better unless memory is an issue. 15 | * 16 | * @author Joseph Heled 17 | * @version $Id$ 18 | */ 19 | public class BilleraMetric implements RootedTreeMetric { 20 | public double getMetric(RootedTree tree1, RootedTree tree2) { 21 | List taxa = new ArrayList(tree1.getTaxa()); 22 | TreeBiPartitionInfo p1 = new TreeBiPartitionInfo(tree1, taxa); 23 | TreeBiPartitionInfo p2 = new TreeBiPartitionInfo(tree2, taxa); 24 | return TreeBiPartitionInfo.distance(p1, p2, TreeBiPartitionInfo.DistanceNorm.NORM1); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/jade/math/NormalDistribution.java: -------------------------------------------------------------------------------- 1 | /* 2 | * NormalDistribution.java 3 | * 4 | * Created on August 9, 2005, 3:24 PM 5 | * 6 | * author: Stephen A. Smith 7 | */ 8 | 9 | package jade.math; 10 | 11 | import java.util.*; 12 | /** 13 | * 14 | * @author stephensmith 15 | */ 16 | public class NormalDistribution implements ProbDistribution{ 17 | 18 | /** Creates a new instance of NormalDistribution */ 19 | public NormalDistribution() { 20 | } 21 | 22 | public NormalDistribution(double mean, double stdev){ 23 | this.mean = mean; 24 | this.stdev = stdev; 25 | } 26 | 27 | public void setStDev(double stdev){ this.stdev = stdev; } 28 | 29 | public void setMean(double mean){ this.mean = mean; } 30 | 31 | public double getValue(){ 32 | return (r.nextGaussian()*stdev)+mean; 33 | } 34 | 35 | public double getPDF(double x){ 36 | //add error function 37 | return (x-mean)/stdev; 38 | } 39 | 40 | //private methods 41 | private double stdev; 42 | private double mean; 43 | private Random r = new Random(); 44 | } 45 | -------------------------------------------------------------------------------- /src/org/virion/jam/panels/RuleModel.java: -------------------------------------------------------------------------------- 1 | /** 2 | * RuleModel.java 3 | */ 4 | 5 | package org.virion.jam.panels; 6 | 7 | 8 | /** 9 | * RuleModel. 10 | * 11 | * @author Andrew Rambaut 12 | * @version $Id: RuleModel.java 182 2006-01-23 21:24:01Z rambaut $ 13 | */ 14 | 15 | 16 | public interface RuleModel { 17 | 18 | /** 19 | * Returns an array of strings to be presented as a combo box which 20 | * are available fields to define rules on. 21 | * 22 | * @return the field names 23 | */ 24 | Object[] getFields(); 25 | 26 | /** 27 | * Returns an array of strings to be presented as a combo box which 28 | * are possible rule conditions for the specified field. 29 | * 30 | * @return the condition names 31 | */ 32 | Object[] getConditions(Object field); 33 | 34 | /** 35 | * Returns an array of strings to be presented as a combo box which 36 | * are possible values for the field. Should return null if a text 37 | * box is required. 38 | * 39 | * @return the values 40 | */ 41 | Object[] getValues(Object field, Object condition); 42 | 43 | } -------------------------------------------------------------------------------- /src/org/virion/jam/console/ConsoleMenuBarFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * ConsoleMenuBarFactory.java 3 | */ 4 | 5 | package org.virion.jam.console; 6 | 7 | import org.virion.jam.framework.*; 8 | import org.virion.jam.mac.MacFileMenuFactory; 9 | import org.virion.jam.mac.MacHelpMenuFactory; 10 | import org.virion.jam.mac.MacWindowMenuFactory; 11 | 12 | public class ConsoleMenuBarFactory extends DefaultMenuBarFactory { 13 | 14 | public ConsoleMenuBarFactory() { 15 | // org.virion stuff shouldn't be called from here - it's a separate project! 16 | 17 | // no its not. This class is part of JAM. 18 | if (org.virion.jam.mac.Utils.isMacOSX()) { 19 | //if (System.getProperty("mrj.version") != null) { 20 | registerMenuFactory(new MacFileMenuFactory(false)); 21 | registerMenuFactory(new DefaultEditMenuFactory()); 22 | registerMenuFactory(new MacWindowMenuFactory()); 23 | registerMenuFactory(new MacHelpMenuFactory()); 24 | } else { 25 | registerMenuFactory(new DefaultFileMenuFactory(false)); 26 | registerMenuFactory(new DefaultEditMenuFactory()); 27 | registerMenuFactory(new DefaultHelpMenuFactory()); 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /src/jade/data/DataType.java: -------------------------------------------------------------------------------- 1 | package jade.data; 2 | 3 | public interface DataType { 4 | char UNKNOWN_CHARACTER = '?'; 5 | 6 | char DEFAULT_GAP_CHARACTER = '-'; 7 | 8 | /* 9 | * types of data 10 | */ 11 | int BINARYDATATYPE = 0; 12 | 13 | int NUCLEOTIDEDATATYPE = 1; 14 | 15 | int NUMERICDATATYPE = 2; 16 | 17 | int CONTDATATYPE = 3; 18 | 19 | int UNKNOWN = 666; 20 | 21 | char[] SUGGESTED_GAP_CHARACTERS = { DEFAULT_GAP_CHARACTER, '_', '.' }; 22 | 23 | int SUGGESTED_GAP_STATE = -2; 24 | 25 | int SUGGESTED_UNKNOWN_STATE = -1; 26 | 27 | String NUCLEOTIDE_DESCRIPTION = "nucleotide"; 28 | 29 | String BINARY_DESCRIPTION = "binary"; 30 | 31 | String GAP_BALANCED_DESCRIPTION = "gap balanced"; 32 | 33 | String getDescription(); 34 | 35 | int getState(char c); 36 | 37 | char getChar(int state); 38 | 39 | int getNumStates(); 40 | 41 | char getSuggestedChar(char c); 42 | 43 | int getTypeID(); 44 | 45 | boolean isUnknownState(int state); 46 | 47 | boolean isUnknownChar(char c); 48 | 49 | boolean hasGapCharacter(); 50 | 51 | boolean isGapChar(char c); 52 | 53 | boolean isGapState(int state); 54 | 55 | int getSuggestedGapState(); 56 | 57 | int getSuggestedUnknownState(); 58 | } 59 | -------------------------------------------------------------------------------- /src/jebl/gui/trees/treeviewer/decorators/AttributeBranchDecorator.java: -------------------------------------------------------------------------------- 1 | package jebl.gui.trees.treeviewer.decorators; 2 | 3 | import jebl.evolution.graphs.Node; 4 | import jebl.evolution.trees.Tree; 5 | 6 | import java.awt.*; 7 | import java.util.HashMap; 8 | import java.util.Map; 9 | 10 | /** 11 | * @author Andrew Rambaut 12 | * @version $Id: AttributeBranchDecorator.java 181 2006-01-23 17:31:10Z rambaut $ 13 | */ 14 | public class AttributeBranchDecorator implements BranchDecorator { 15 | public AttributeBranchDecorator(String attributeName, Map paintMap) { 16 | this.attributeName = attributeName; 17 | this.paintMap = paintMap; 18 | } 19 | 20 | public Paint getBranchPaint(Tree tree, Node node) { 21 | Paint paint = getPaint(node.getAttribute(attributeName)); 22 | if (paint == null) return Color.BLACK; 23 | return paint; 24 | } 25 | 26 | protected Paint getPaint(Object value) { 27 | if (value != null) { 28 | return paintMap.get(value); 29 | } 30 | return null; 31 | } 32 | 33 | protected final String attributeName; 34 | 35 | protected Map paintMap = new HashMap(); 36 | } 37 | -------------------------------------------------------------------------------- /src/org/virion/jam/table/AdvancedTableUI.java: -------------------------------------------------------------------------------- 1 | package org.virion.jam.table; 2 | 3 | import javax.swing.plaf.basic.BasicTableUI; 4 | import javax.swing.event.MouseInputListener; 5 | import javax.swing.*; 6 | import java.awt.event.MouseEvent; 7 | import java.awt.*; 8 | 9 | /** 10 | * @author rambaut 11 | * Date: Oct 20, 2004 12 | * Time: 10:16:52 PM 13 | */ 14 | public class AdvancedTableUI extends BasicTableUI { 15 | 16 | public void installUI(JComponent c) { 17 | super.installUI(c); 18 | 19 | if (org.virion.jam.mac.Utils.isMacOSX()) { 20 | c.setFont(new Font("Lucida Grande", Font.PLAIN, 9)); 21 | } 22 | } 23 | 24 | protected MouseInputListener createMouseInputListener() { 25 | return new AdvancedTableUI.AdvancedMouseInputHandler(); 26 | } 27 | 28 | class AdvancedMouseInputHandler extends MouseInputHandler { 29 | public void mousePressed(MouseEvent e) { 30 | Point origin = e.getPoint(); 31 | int row = table.rowAtPoint(origin); 32 | int column = table.columnAtPoint(origin); 33 | if (row != -1 && column != -1) { 34 | if (table.isCellSelected(row, column)) { 35 | e.consume(); 36 | } 37 | } 38 | 39 | super.mousePressed(e); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/jebl/evolution/graphs/Utils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Utils.java 3 | * 4 | * (c) 2005 JEBL Development Team 5 | * 6 | * This package is distributed under the 7 | * Lesser Gnu Public Licence (LGPL) 8 | */ 9 | package jebl.evolution.graphs; 10 | 11 | /** 12 | * A collection of utility functions for graphs. 13 | * 14 | * @author Andrew Rambaut 15 | * @author Alexei Drummond 16 | * 17 | * @version $Id: Utils.java 185 2006-01-23 23:03:18Z rambaut $ 18 | */ 19 | public class Utils { 20 | 21 | /** 22 | * @param graph 23 | * @return true if the given graph is acyclic. 24 | */ 25 | public boolean isAcyclical(Graph graph) { 26 | throw new UnsupportedOperationException("Not implemented yet"); 27 | } 28 | 29 | /** 30 | * @param graph 31 | * @return true if the given graph is fully connected. 32 | */ 33 | public boolean isConnected(Graph graph) { 34 | throw new UnsupportedOperationException("Not implemented yet"); 35 | } 36 | 37 | /** 38 | * @param graph 39 | * @return true if the given graph is a tree, i.e. is acyclic 40 | * and fully connected. 41 | */ 42 | public final boolean isTree(Graph graph) { 43 | return isAcyclical(graph) && isConnected(graph); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/org/virion/jam/toolbar/ToolbarAction.java: -------------------------------------------------------------------------------- 1 | package org.virion.jam.toolbar; 2 | 3 | import javax.swing.*; 4 | 5 | /** 6 | * @author rambaut 7 | * Date: Oct 18, 2005 8 | * Time: 10:10:52 PM 9 | */ 10 | public abstract class ToolbarAction extends AbstractAction { 11 | 12 | protected ToolbarAction(String label, String toolTipText, Icon icon) { 13 | this(label, toolTipText, icon, null, null); 14 | } 15 | 16 | protected ToolbarAction(String label, String toolTipText, Icon icon, Icon disabledIcon, Icon pressedIcon) { 17 | super(label, icon); 18 | 19 | this.label = label; 20 | this.toolTipText = toolTipText; 21 | this.icon = icon; 22 | this.disabledIcon = disabledIcon; 23 | this.pressedIcon = pressedIcon; 24 | } 25 | 26 | public String getLabel() { 27 | return label; 28 | } 29 | 30 | public Icon getIcon() { 31 | return icon; 32 | } 33 | 34 | public Icon getDisabledIcon() { 35 | return disabledIcon; 36 | } 37 | 38 | public Icon getPressedIcon() { 39 | return pressedIcon; 40 | } 41 | 42 | public String getToolTipText() { 43 | return toolTipText; 44 | } 45 | 46 | private String label; 47 | private String toolTipText; 48 | private Icon icon; 49 | private Icon disabledIcon; 50 | private Icon pressedIcon; 51 | } 52 | -------------------------------------------------------------------------------- /src/jebl/gui/trees/treeviewer/painters/Painter.java: -------------------------------------------------------------------------------- 1 | package jebl.gui.trees.treeviewer.painters; 2 | 3 | import org.virion.jam.controlpanels.ControlsProvider; 4 | 5 | import java.awt.*; 6 | import java.awt.geom.Rectangle2D; 7 | 8 | 9 | /** 10 | * A painter draws a particular decoration onto the tree within a 11 | * rectangle. 12 | * @author Andrew Rambaut 13 | * @version $Id: Painter.java 595 2006-12-27 20:21:41Z pepster $ 14 | */ 15 | public interface Painter extends ControlsProvider { 16 | 17 | public enum Orientation { 18 | TOP, 19 | LEFT, 20 | BOTTOM, 21 | RIGHT 22 | } 23 | 24 | public enum Justification { 25 | FLUSH, 26 | LEFT, 27 | RIGHT, 28 | CENTER 29 | } 30 | 31 | boolean isVisible(); 32 | 33 | //void calibrate(Graphics2D g2, T item); 34 | 35 | void calibrate(Graphics2D g2); 36 | 37 | // May change paint and stroke 38 | void paint(Graphics2D g2, T item, Justification justification, Rectangle2D bounds); 39 | 40 | double getWidth(Graphics2D g2, T item); 41 | double getPreferredHeight(); 42 | double getHeightBound(); 43 | 44 | void addPainterListener(PainterListener listener); 45 | void removePainterListener(PainterListener listener); 46 | } 47 | -------------------------------------------------------------------------------- /src/org/virion/jam/controlpalettes/AbstractController.java: -------------------------------------------------------------------------------- 1 | package org.virion.jam.controlpalettes; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | /** 7 | * @author Andrew Rambaut 8 | * @author Alexei Drummond 9 | * @version $Id: AbstractController.java 363 2006-06-27 16:26:09Z rambaut $ 10 | */ 11 | public abstract class AbstractController implements Controller { 12 | /** 13 | * Add a ControllerListener to this controllers list of listeners 14 | * The main listener will be the ControlPalette itself which will use 15 | * this to resize the panels if the components changed 16 | * 17 | * @param listener 18 | */ 19 | public void addControllerListener(ControllerListener listener) { 20 | listeners.add(listener); 21 | } 22 | 23 | /** 24 | * Remove a listener 25 | * 26 | * @param listener 27 | */ 28 | public void removeControllerListener(ControllerListener listener) { 29 | listeners.remove(listener); 30 | } 31 | 32 | public void fireControllerChanged() { 33 | for (ControllerListener listener : listeners) { 34 | listener.controlsChanged(); 35 | } 36 | } 37 | 38 | private final List listeners = new ArrayList(); 39 | } 40 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | phyutility 2 | ========== 3 | Phyutility (fyoo-til-i-te) is a command line program that performs simple analyses or modifications on both trees and data matrices. Makes use of JADE (PEBLS) and JEBL libraries. Please see the [NEWS] page for info concerning updates, etc. 4 | 5 | See [NEWS] and download the new release for amino acid acceptance in the concatenate and cleaning functions (use the -aa argument in -clean and -concat functions). 6 | 7 | *Please use this citation when using Phyutility* [http://bioinformatics.oxfordjournals.org/cgi/content/short/24/5/715 Smith, S. A. and Dunn, C. W. (2008) Phyutility: a phyloinformatics tool for trees, alignments, and molecular data. Bioinformatics. 24: 715-716] 8 | 9 | Currently it performs the following functions (to suggest another feature, submit an Issue and use the label Type-Enhancement) : 10 | 11 | *Trees* 12 | 13 | * rerooting 14 | * pruning 15 | * type conversion 16 | * consensus 17 | * leaf stability 18 | * lineage movement 19 | * tree support 20 | 21 | *Data Matrices* 22 | 23 | * concatenate alignments 24 | * genbank parsing 25 | * trimming alignments 26 | * search NCBI 27 | * fetch NCBI 28 | 29 | *please reroot your trees before performing the leaf stability, lineage movement, or consensus functions -- unrooted functions for these will be incorporated ASAP* 30 | 31 | -------------------------------------------------------------------------------- /src/jebl/gui/trees/treecomponent/RootedTreePainter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * RootedTreePainter.java 3 | * 4 | * (c) 2005 JEBL Development Team 5 | * 6 | * This package is distributed under the 7 | * Lesser Gnu Public Licence (LGPL) 8 | */ 9 | package jebl.gui.trees.treecomponent; 10 | 11 | import jebl.evolution.graphs.Node; 12 | import jebl.evolution.trees.RootedTree; 13 | 14 | import java.awt.*; 15 | import java.awt.geom.Point2D; 16 | 17 | /** 18 | * @author Alexei Drummond 19 | * 20 | * @version $Id: RootedTreePainter.java 309 2006-05-02 08:22:06Z rambaut $ 21 | */ 22 | public interface RootedTreePainter { 23 | 24 | /** 25 | * Set line style 26 | */ 27 | void setLineStyle(Stroke lineStroke, Paint linePaint); 28 | 29 | /** 30 | * Set hilight style 31 | */ 32 | void setHilightStyle(Stroke hilightStroke, Paint hilightPaint); 33 | 34 | /** 35 | * Set label style. 36 | */ 37 | void setLabelStyle(Font labelFont, Paint labelPaint); 38 | 39 | /** 40 | * Set hilight label style. 41 | */ 42 | void setHilightLabelStyle(Font hilightLabelFont, Paint hilightLabelPaint); 43 | 44 | /** 45 | * Do the actual painting. 46 | */ 47 | void paintTree(Graphics2D g, Dimension size, RootedTree tree); 48 | 49 | /** 50 | * Find the node under point. Returns -1 if not found. 51 | */ 52 | public Node findNodeAtPoint(Point2D point); 53 | 54 | } 55 | -------------------------------------------------------------------------------- /src/jebl/evolution/align/AlignLinearSpace.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.align; 2 | 3 | import jebl.evolution.align.scores.Scores; 4 | 5 | abstract class AlignLinearSpace extends AlignSimple { 6 | 7 | float[][] F = null; // the matrices used to compute the alignment 8 | 9 | public AlignLinearSpace(Scores sub, float d) { 10 | super(sub, d); 11 | } 12 | 13 | /** 14 | * Performs the alignment. Abstract. 15 | * 16 | * @param seq1 17 | * @param seq2 18 | */ 19 | public abstract void doAlignment(String seq1, String seq2); 20 | 21 | public void prepareAlignment(String sq1, String sq2) { 22 | this.n = sq1.length(); this.m = sq2.length(); 23 | this.seq1 = strip(sq1); this.seq2 = strip(sq2); 24 | F = new float[2][m+1]; 25 | } 26 | 27 | /** 28 | * Print matrix used to calculate this alignment. 29 | * 30 | * @param out Output to print to. 31 | */ 32 | public void printf(Output out) { 33 | for (int j=0; j<=m; j++) { 34 | for (int i = 0; i < F.length; i++) { 35 | float[] f = F[i]; 36 | out.print(padLeft(formatScore(f[j]), 5)); 37 | } 38 | out.println(); 39 | } 40 | } 41 | 42 | static void swap01(Object[] A) { 43 | Object tmp = A[1]; A[1] = A[0]; A[0] = tmp; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/org/virion/jam/toolbar/GenericToolbarItem.java: -------------------------------------------------------------------------------- 1 | package org.virion.jam.toolbar; 2 | 3 | import javax.swing.*; 4 | import java.awt.*; 5 | 6 | /** 7 | * @author rambaut 8 | * Date: Oct 18, 2005 9 | * Time: 10:09:21 PM 10 | */ 11 | public class GenericToolbarItem extends JPanel implements ToolbarItem { 12 | 13 | public GenericToolbarItem(String title, String toolTipText, JComponent component) { 14 | setLayout(new BorderLayout()); 15 | add(component, BorderLayout.NORTH); 16 | 17 | label = new JLabel(title); 18 | label.setHorizontalAlignment(SwingConstants.CENTER); 19 | add(label, BorderLayout.SOUTH); 20 | setToolTipText(toolTipText); 21 | } 22 | 23 | public void setToolbarOptions(ToolbarOptions options) { 24 | switch (options.getDisplay()) { 25 | case ToolbarOptions.ICON_AND_TEXT: 26 | case ToolbarOptions.TEXT_ONLY: 27 | label.setVisible(true); 28 | break; 29 | case ToolbarOptions.ICON_ONLY: 30 | label.setVisible(false); 31 | break; 32 | } 33 | } 34 | 35 | public void setAction(Action action) { 36 | throw new UnsupportedOperationException("Method setAction() not supported in GenericToolBarItem"); 37 | } 38 | 39 | private JLabel label; 40 | } 41 | -------------------------------------------------------------------------------- /src/jade/lib/jade_reconstruct_area_PJNI.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "jade_reconstruct_area_PJNI.h" 3 | #include 4 | #include 5 | 6 | JNIEXPORT jdoubleArray JNICALL Java_jade_reconstruct_area_PJNI_matrixExp 7 | (JNIEnv *jenv, jobject obj, jdoubleArray arr,jint size){ 8 | jdoubleArray ret = (*jenv)->NewDoubleArray(jenv,(jint)( size * size)); 9 | double *OutData = (*jenv)->GetDoubleArrayElements(jenv,ret,JNI_FALSE); 10 | //double OutData [size*size]; 11 | jdouble * at_data = (*jenv)->GetDoubleArrayElements(jenv, arr, NULL); 12 | int i,j; 13 | double a_data [size*size]; 14 | for (i = 0; i < size*size; i++){ 15 | a_data[i] = (double)at_data[i]; 16 | } 17 | gsl_matrix_view m = gsl_matrix_view_array (a_data, (int)size, (int)size); 18 | gsl_mode_t mt = 0; 19 | gsl_matrix *ma = gsl_matrix_alloc (size,size); 20 | gsl_linalg_exponential_ss(&m.matrix, ma, mt);//m input, ma output 21 | 22 | int x = 0; 23 | for(i = 0; i < size; i++){ 24 | for(j=0;jSetDoubleArrayRegion(jenv,ret,(jsize)0,(jsize)size*size,OutData); 31 | (*jenv)->ReleaseDoubleArrayElements(jenv,ret,OutData,0); 32 | (*jenv)->ReleaseDoubleArrayElements(jenv,arr,at_data,0); 33 | gsl_matrix_free (ma); 34 | return ret; 35 | } 36 | -------------------------------------------------------------------------------- /src/jebl/evolution/align/scores/SubstScoreMatrix.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.align.scores; 2 | 3 | import jebl.evolution.sequences.SequenceType; 4 | import jebl.evolution.substmodel.RateMatrix; 5 | 6 | /** 7 | * @author Alexei Drummond 8 | * 9 | * @version $Id: SubstScoreMatrix.java 360 2006-06-22 07:42:48Z pepster $ 10 | */ 11 | public class SubstScoreMatrix extends Scores { 12 | 13 | SequenceType sequenceType; 14 | String alphabet; 15 | 16 | public SubstScoreMatrix(RateMatrix rateMatrix) { 17 | 18 | alphabet = SequenceType.Utils.getAlphabet(sequenceType); 19 | 20 | int m = alphabet.length(); 21 | 22 | double[][] transProbs = new double[m][m]; 23 | rateMatrix.getTransitionProbabilities(transProbs); 24 | 25 | buildScores(log(transProbs)); 26 | } 27 | 28 | private float[][] log(double[][] values) { 29 | 30 | float[][] logValues = new float[values.length][values[0].length]; 31 | 32 | for (int i = 0; i < values.length; i++) { 33 | for (int j = 0; j < values[i].length; j++) { 34 | logValues[i][j] = (float)Math.log(values[i][j]); 35 | } 36 | } 37 | 38 | return logValues; 39 | } 40 | 41 | public String getName() { 42 | return toString(); 43 | } 44 | 45 | public String getAlphabet() { 46 | return alphabet; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/jebl/evolution/align/AlignmentResult.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.align; 2 | 3 | /** 4 | * @author Matt Kearse 5 | * @version $Id: AlignmentResult.java 650 2007-03-12 20:09:10Z twobeers $ 6 | * 7 | * Used for representing the results of a sequence alignment. Basically just stores 8 | * an array representing whether or not each position in the alignment is a gap or not. 9 | */ 10 | class AlignmentResult { 11 | int size; 12 | boolean values[]; 13 | // true represents a character from the original sequence, and false represents a gap 14 | // for example: 15 | // original sequence: abcd 16 | // values: true, false, false, true, true, false, true 17 | // then the resulting alignment is: a--bc-d 18 | 19 | public AlignmentResult(int size) { 20 | this.size = 0; 21 | // TT: Wouldn't a BitSet be better? 22 | values =new boolean[size]; 23 | } 24 | 25 | public void append(String result) { 26 | for (char character : result.toCharArray()) { 27 | if(character =='-') 28 | values [ size ++ ]= false; 29 | else 30 | values [ size ++ ] = true; 31 | } 32 | } 33 | 34 | public void print() { 35 | for (int i = 0; i < size; i++) { 36 | System.out.print(values[i] ? "X" : "-"); 37 | 38 | } 39 | System.out.println (); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/org/virion/jam/mac/MacHelpMenuFactory.java: -------------------------------------------------------------------------------- 1 | package org.virion.jam.mac; 2 | 3 | import org.virion.jam.framework.MenuFactory; 4 | import org.virion.jam.framework.AbstractFrame; 5 | import org.virion.jam.framework.Application; 6 | import org.virion.jam.framework.MenuBarFactory; 7 | 8 | import javax.swing.*; 9 | import java.awt.event.KeyEvent; 10 | 11 | /** 12 | * @author rambaut 13 | * Date: Dec 26, 2004 14 | * Time: 11:04:02 AM 15 | */ 16 | public class MacHelpMenuFactory implements MenuFactory { 17 | public String getMenuName() { 18 | return "Help"; 19 | } 20 | 21 | public void populateMenu(JMenu menu, AbstractFrame frame) { 22 | 23 | JMenuItem item; 24 | 25 | Application application = Application.getApplication(); 26 | 27 | if (frame.getHelpAction() != null) { 28 | item = new JMenuItem(frame.getHelpAction()); 29 | item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_SLASH, MenuBarFactory.MENU_MASK)); 30 | menu.add(item); 31 | 32 | menu.addSeparator(); 33 | } 34 | 35 | if (application.getHelpAction() != null) { 36 | item = new JMenuItem(application.getHelpAction()); 37 | menu.add(item); 38 | 39 | menu.addSeparator(); 40 | } 41 | 42 | if (application.getWebsiteAction() != null) { 43 | item = new JMenuItem("Website"); 44 | } 45 | } 46 | 47 | public int getPreferredAlignment() { 48 | return RIGHT; 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /src/org/virion/jam/controlpanels/ControlsProvider.java: -------------------------------------------------------------------------------- 1 | package org.virion.jam.controlpanels; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * @author Andrew Rambaut 7 | * @version $Id: ControlsProvider.java 548 2006-11-30 01:43:31Z pepster $ 8 | */ 9 | public interface ControlsProvider { 10 | /** 11 | * Give the controls provider with a handle for the controlPalette object. 12 | * 13 | * @param controlPalette 14 | */ 15 | void setControlPalette(ControlPalette controlPalette); 16 | 17 | /** 18 | * Get a list of Controls handled by this provider. 19 | * 20 | * @param detachPrimaryCheckbox When false, do nothing. When true, if controls have a "main" on/off switch 21 | * (implemented as a JCheckBox), that checkbox should not be included in the controls 22 | * panel but returned in {@link Controls#getPrimaryCheckbox} 23 | * @return A list of Controls 24 | */ 25 | List getControls(boolean detachPrimaryCheckbox); 26 | 27 | /** 28 | * Give the provider some settings. 29 | * 30 | * @param settings 31 | */ 32 | void setSettings(ControlsSettings settings); 33 | 34 | /** 35 | * Get the settings for a given Controls object. 36 | * 37 | * @param settings 38 | */ 39 | void getSettings(ControlsSettings settings); 40 | } 41 | -------------------------------------------------------------------------------- /src/org/virion/jam/framework/DefaultHelpMenuFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Biomatters LTD. All Rights Reserved. 3 | */ 4 | package org.virion.jam.framework; 5 | 6 | import javax.swing.*; 7 | import java.awt.event.KeyEvent; 8 | 9 | /** 10 | * @author rambaut 11 | * Date: Dec 26, 2004 12 | * Time: 11:02:20 AM 13 | */ 14 | public class DefaultHelpMenuFactory implements MenuFactory { 15 | public String getMenuName() { 16 | return "Help"; 17 | } 18 | 19 | public void populateMenu(JMenu menu, AbstractFrame frame) { 20 | 21 | menu.setMnemonic('H'); 22 | 23 | JMenuItem item; 24 | 25 | Application application = Application.getApplication(); 26 | 27 | item = new JMenuItem(application.getAboutAction()); 28 | menu.add(item); 29 | 30 | if (frame.getHelpAction() != null) { 31 | item = new JMenuItem(frame.getHelpAction()); 32 | item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_SLASH, MenuBarFactory.MENU_MASK)); 33 | menu.add(item); 34 | 35 | menu.addSeparator(); 36 | } 37 | 38 | if (application.getHelpAction() != null) { 39 | item = new JMenuItem(application.getHelpAction()); 40 | menu.add(item); 41 | 42 | menu.addSeparator(); 43 | } 44 | 45 | if (application.getWebsiteAction() != null) { 46 | item = new JMenuItem("Website"); 47 | } 48 | } 49 | 50 | public int getPreferredAlignment() { 51 | return RIGHT; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/jade/math/fRan.java: -------------------------------------------------------------------------------- 1 | package jade.math; 2 | 3 | import java.util.Random; 4 | 5 | public class fRan { 6 | public static double fRan(double d){ 7 | int RAN_IA = 16807; 8 | int RAN_IM = 2147483647; 9 | double RAN_AM = (1.0/RAN_IM); 10 | int RAN_IQ = 127773; 11 | int RAN_IR = 2836; 12 | int RAN_NTAB =32; 13 | int RAN_NDIV =(1+(RAN_IM-1)/RAN_NTAB); 14 | double RAN_EPS = 1.2e-7; 15 | double RAN_RNMX =(1.0-RAN_EPS); 16 | long seed = (new Random()).nextLong(); 17 | 18 | double temp; 19 | int j; 20 | long k; 21 | long iy = 0; 22 | long [] iv = new long[RAN_NTAB]; 23 | 24 | if (seed <= 0 || iy == 0) { 25 | if (-(seed) < 1) 26 | seed = 1; 27 | else 28 | seed = -(seed); 29 | for (j = RAN_NTAB+7; j >= 0; j--) { 30 | k = (seed)/RAN_IQ; 31 | seed = RAN_IA*(seed-k*RAN_IQ)-RAN_IR*k; 32 | if (seed < 0) 33 | seed += RAN_IM; 34 | if (j < RAN_NTAB) 35 | iv[j] = seed; 36 | } 37 | iy = iv[0]; 38 | } 39 | k = (seed)/RAN_IQ; 40 | seed = RAN_IA*(seed-k*RAN_IQ)-RAN_IR*k; 41 | if (seed < 0) 42 | seed += RAN_IM; 43 | j = (int)iy/RAN_NDIV;//(int) 44 | iy = iv[j]; 45 | iv[j] = seed; 46 | if ((temp=RAN_AM*iy) > RAN_RNMX) 47 | return d*RAN_RNMX; 48 | else 49 | return d*temp; 50 | } 51 | public static void main(String [] args){ 52 | for(int i=0;i<1000;i++){ 53 | System.out.println((fRan.fRan(0.1))); 54 | } 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /src/org/virion/jam/demo/menus/DemoMenuFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Your Corporation. All Rights Reserved. 3 | */ 4 | package org.virion.jam.demo.menus; 5 | 6 | import org.virion.jam.framework.MenuFactory; 7 | import org.virion.jam.framework.AbstractFrame; 8 | 9 | import javax.swing.*; 10 | 11 | /** 12 | * @author rambaut 13 | * Date: Feb 24, 2005 14 | * Time: 5:12:11 PM 15 | */ 16 | public class DemoMenuFactory implements MenuFactory { 17 | 18 | public static final String FIRST = "First"; 19 | public static final String SECOND = "Second"; 20 | 21 | public String getMenuName() { 22 | return "Demo"; 23 | } 24 | 25 | public void populateMenu(JMenu menu, AbstractFrame frame) { 26 | JMenuItem item; 27 | 28 | if (frame instanceof DemoMenuHandler) { 29 | item = new JMenuItem(((DemoMenuHandler)frame).getFirstAction()); 30 | menu.add(item); 31 | 32 | item = new JMenuItem(((DemoMenuHandler)frame).getSecondAction()); 33 | menu.add(item); 34 | } else { 35 | item = new JMenuItem(FIRST); 36 | item.setEnabled(false); 37 | menu.add(item); 38 | 39 | item = new JMenuItem(SECOND); 40 | item.setEnabled(false); 41 | menu.add(item); 42 | } 43 | 44 | } 45 | 46 | public int getPreferredAlignment() { 47 | return LEFT; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/org/virion/jam/util/SimpleListenerManager.java: -------------------------------------------------------------------------------- 1 | package org.virion.jam.util; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | /** 7 | * @author Richard Moir 8 | * @version $Id: SimpleListenerManager.java 636 2007-01-31 03:15:55Z matt_kearse $ 9 | */ 10 | public class SimpleListenerManager { 11 | 12 | private List listeners = new ArrayList(); 13 | 14 | public SimpleListenerManager(SimpleListenerManager manager) { 15 | this.listeners = new ArrayList(manager.listeners); 16 | } 17 | 18 | public SimpleListenerManager() { 19 | } 20 | 21 | public synchronized void add(SimpleListener listener) { 22 | listeners.add(listener); 23 | } 24 | 25 | public synchronized void remove(SimpleListener listener) { 26 | listeners.remove(listener); 27 | } 28 | 29 | 30 | /** 31 | * calls {@link org.virion.jam.util.SimpleListener#objectChanged()} on all listeners added using 32 | * {@link #add(SimpleListener)} . 33 | */ 34 | public synchronized void fire() { 35 | for (SimpleListener simpleListener : listeners) { 36 | simpleListener.objectChanged(); 37 | } 38 | } 39 | 40 | /** 41 | * Get the number of listeners (those added, but not yet removed) 42 | * @return 43 | */ 44 | public synchronized int size () { 45 | return listeners.size (); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/jade/math/BetaDistribution.java: -------------------------------------------------------------------------------- 1 | /* 2 | * BetaDistribution.java 3 | * 4 | * Created on August 9, 2005, 3:58 PM 5 | * 6 | * author: Stephen A. Smith 7 | */ 8 | 9 | package jade.math; 10 | 11 | /** 12 | * 13 | * @author stephensmith 14 | */ 15 | public class BetaDistribution implements ProbDistribution{ 16 | 17 | /** Creates a new instance of BetaDistribution */ 18 | public BetaDistribution( double shape1, double shape2) { 19 | alpha1 = shape1; 20 | alpha2 = shape2; 21 | norm = GammaFunction.logBeta(alpha1, alpha2); 22 | gamma1 = new GammaDistribution( alpha1, 1.0 ); 23 | gamma2 = new GammaDistribution( alpha2, 1.0 ); 24 | } 25 | 26 | public void setShape1(double shape1){ 27 | alpha1 = shape1; 28 | } 29 | public void setShape2(double shape2){ 30 | alpha2 = shape2; 31 | } 32 | public double getShape1(){ return alpha1; } 33 | public double getShape2(){ return alpha2; } 34 | public double getValue(){ 35 | double y1 = gamma1.getValue(); 36 | double y2 = gamma2.getValue(); 37 | return y1 / (y1 + y2); 38 | } 39 | 40 | public double getPDF(double x){ 41 | return x; 42 | } 43 | 44 | //private methods 45 | private double alpha1; 46 | private double alpha2; 47 | private double norm; 48 | private GammaDistribution gamma1; 49 | private GammaDistribution gamma2; 50 | 51 | } 52 | -------------------------------------------------------------------------------- /src/jade/math/ExponentialDistribution.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ExponentialDistribution.java 3 | * 4 | * Created on August 9, 2005, 3:24 PM 5 | * 6 | * author: Stephen A. Smith 7 | */ 8 | 9 | package jade.math; 10 | 11 | import java.util.*; 12 | /** 13 | * 14 | * @author stephensmith 15 | */ 16 | public class ExponentialDistribution implements ProbDistribution{ 17 | 18 | /** Creates a new instance of ExponentialDistribution */ 19 | public ExponentialDistribution() { 20 | } 21 | public ExponentialDistribution( double beta ){ 22 | if(beta<=0) 23 | throw new IllegalArgumentException(" Exponential fall-off must be positive ( function was sent a negative value ) "); 24 | else 25 | this.beta = beta; 26 | } 27 | /** 28 | *@param beta the falloff value for the exponential distribution 29 | */ 30 | public void setFallOff( double beta ){ 31 | this.beta = beta; 32 | } 33 | 34 | public double getFallOff(){ return beta; } 35 | 36 | public double getValue(){ 37 | return -beta * Math.log(r.nextDouble()); 38 | } 39 | 40 | // 41 | //probability of finding something smaller than x 42 | //@return the intregral of the probability distribution function from 0 to x 43 | public double getPDF(double x){ 44 | return (1/beta)*Math.exp(-(1/beta)*x); 45 | } 46 | private double beta; 47 | private Random r = new Random(); 48 | } 49 | -------------------------------------------------------------------------------- /src/jebl/evolution/sequences/Sequence.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Sequence.java 3 | * 4 | * (c) 2002-2005 JEBL Development Core Team 5 | * 6 | * This package may be distributed under the 7 | * Lesser Gnu Public Licence (LGPL) 8 | */ 9 | package jebl.evolution.sequences; 10 | 11 | import jebl.evolution.taxa.Taxon; 12 | import jebl.util.Attributable; 13 | 14 | /** 15 | * A biomolecular sequence. 16 | * 17 | * @author Andrew Rambaut 18 | * @author Alexei Drummond 19 | * 20 | * @version $Id: Sequence.java 365 2006-06-28 07:34:56Z pepster $ 21 | */ 22 | public interface Sequence extends Attributable, Comparable { 23 | 24 | /** 25 | * @return the taxon that this sequence represents (primarily used to match sequences with tree nodes) 26 | */ 27 | Taxon getTaxon(); 28 | 29 | /** 30 | * @return the type of symbols that this sequence is made up of. 31 | */ 32 | SequenceType getSequenceType(); 33 | 34 | /** 35 | * @return a string representing the sequence of symbols. 36 | */ 37 | String getString(); 38 | 39 | /** 40 | * @return an array of state objects. 41 | */ 42 | State[] getStates(); 43 | 44 | /** 45 | * @return an array of state indices. 46 | */ 47 | byte[] getStateIndices(); 48 | 49 | /** 50 | * @return the state at site. 51 | */ 52 | State getState(int site); 53 | 54 | /** 55 | * Get the length of the sequence 56 | * @return the length 57 | */ 58 | int getLength(); 59 | } 60 | -------------------------------------------------------------------------------- /src/jebl/evolution/align/AlignLinearSpaceAffine.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.align; 2 | 3 | import jebl.evolution.align.scores.Scores; 4 | 5 | // Alignment with affine gap costs; smart linear-space algorithm 6 | 7 | abstract class AlignLinearSpaceAffine extends AlignAffine { 8 | 9 | float[][][] F; // the matrices used to compute the alignment 10 | 11 | public AlignLinearSpaceAffine(Scores sub, float openGapPenalty, float extendGapPenalty) { 12 | super(sub, openGapPenalty, extendGapPenalty); 13 | } 14 | 15 | /** 16 | * Performs the alignment. Abstract. 17 | * 18 | * @param sq1 19 | * @param sq2 20 | */ 21 | public abstract void doAlignment(String sq1, String sq2); 22 | 23 | public void prepareAlignment(String sq1, String sq2) { 24 | this.n = sq1.length(); this.m = sq2.length(); 25 | this.seq1 = sq1; 26 | this.seq2 = sq2; 27 | F = new float[3][2][m+1]; 28 | } 29 | 30 | /** 31 | * Print matrix used to calculate this alignment. 32 | * 33 | * @param out Output to print to. 34 | */ 35 | public void printf(Output out) { 36 | for (int k=0; k<3; k++) { 37 | out.println("F[" + k + "]:"); 38 | for (int j=0; j<=m; j++) { 39 | for (int i=0; i { 26 | 27 | /** 28 | * This can be used to read one tree at a time in a loop: 29 | * 30 | * List trees = new ArrayList(); 31 | * while (hasTree()) { 32 | * trees.add(importNextTree()); 33 | * } 34 | * 35 | * return whether another tree is available. 36 | */ 37 | boolean hasTree() throws IOException, ImportException; 38 | 39 | /** 40 | * Import a single tree 41 | * @return the tree 42 | * @throws IOException 43 | * @throws ImportException 44 | */ 45 | Tree importNextTree() throws IOException, ImportException; 46 | 47 | /** 48 | * Import all the trees 49 | * @return the list of trees 50 | * @throws IOException 51 | * @throws ImportException 52 | * Any type of tree is fine. 53 | */ 54 | List importTrees() throws IOException, ImportException; 55 | } 56 | -------------------------------------------------------------------------------- /src/jebl/evolution/sequences/NucleotideState.java: -------------------------------------------------------------------------------- 1 | /* 2 | * NucleotideState.java 3 | * 4 | * (c) 2002-2005 JEBL Development Core Team 5 | * 6 | * This package may be distributed under the 7 | * Lesser Gnu Public Licence (LGPL) 8 | */ 9 | package jebl.evolution.sequences; 10 | 11 | /** 12 | * @author Andrew Rambaut 13 | * @author Alexei Drummond 14 | * 15 | * @version $Id: NucleotideState.java 267 2006-03-21 02:36:55Z twobeers $ 16 | */ 17 | public final class NucleotideState extends State { 18 | 19 | NucleotideState(String name, String stateCode, int index) { 20 | super(name, stateCode, index); 21 | } 22 | 23 | NucleotideState(String name, String stateCode, int index, NucleotideState[] ambiguities) { 24 | super(name, stateCode, index, ambiguities); 25 | } 26 | 27 | public int compareTo(Object o) { 28 | // throws ClassCastException on across-class comparison 29 | NucleotideState that = (NucleotideState) o; 30 | return super.compareTo(that); 31 | } 32 | 33 | // we do not need to override equals because there is only one 34 | // unique instance of each nucleotide state - i.e. we can use == 35 | /* 36 | public boolean equals(Object o) { 37 | if (!(o instanceof NucleotideState)) 38 | return false; 39 | return super.equals(o); 40 | } */ 41 | 42 | public int hashCode() { 43 | return 23 * super.hashCode() + 17; 44 | } 45 | 46 | public boolean isGap() { 47 | return this == Nucleotides.GAP_STATE; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/jebl/evolution/io/FastaExporter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 JEBL Development team. All Rights Reserved. 3 | */ 4 | 5 | package jebl.evolution.io; 6 | 7 | import jebl.evolution.sequences.Sequence; 8 | import jebl.evolution.taxa.Taxon; 9 | 10 | import java.io.IOException; 11 | import java.io.PrintWriter; 12 | import java.io.Writer; 13 | import java.util.List; 14 | import java.util.Collection; 15 | 16 | /** 17 | * Class for exporting a fasta file format. 18 | * 19 | * @author Andrew Rambaut 20 | * @author Alexei Drummond 21 | * @version $Id: FastaExporter.java 442 2006-09-05 21:59:20Z matt_kearse $ 22 | */ 23 | public class FastaExporter implements SequenceExporter { 24 | 25 | /** 26 | * Constructor 27 | */ 28 | public FastaExporter(Writer writer) { 29 | this.writer = new PrintWriter(writer); 30 | } 31 | 32 | /** 33 | * export alignment or set of sequences. 34 | */ 35 | public void exportSequences(Collection sequences) throws IOException { 36 | for (Sequence sequence : sequences) { 37 | final Taxon taxon = sequence.getTaxon(); 38 | String desc = (String) sequence.getAttribute(FastaImporter.descriptionPropertyName); 39 | if(desc== null) desc = (String) taxon.getAttribute(FastaImporter.descriptionPropertyName); 40 | writer.println(">" + taxon.getName().replace(' ','_') + ((desc != null) ? (" " + desc) : "")); 41 | writer.println(sequence.getString()); 42 | } 43 | } 44 | 45 | private final PrintWriter writer; 46 | } 47 | -------------------------------------------------------------------------------- /src/org/virion/jam/table/WholeNumberCellEditor.java: -------------------------------------------------------------------------------- 1 | package org.virion.jam.table; 2 | 3 | import org.virion.jam.components.WholeNumberField; 4 | 5 | import javax.swing.*; 6 | import java.awt.*; 7 | import java.awt.event.ActionEvent; 8 | import java.awt.event.ActionListener; 9 | 10 | 11 | public class WholeNumberCellEditor extends DefaultCellEditor { 12 | 13 | private WholeNumberField editor; 14 | 15 | public WholeNumberCellEditor(int minValue, int maxValue) { 16 | super(new WholeNumberField(minValue, maxValue)); 17 | 18 | editor = (WholeNumberField) getComponent(); 19 | 20 | setClickCountToStart(2); //This is usually 1 or 2. 21 | 22 | // Must do this so that editing stops when appropriate. 23 | editor.addActionListener(new ActionListener() { 24 | public void actionPerformed(ActionEvent e) { 25 | fireEditingStopped(); 26 | } 27 | }); 28 | } 29 | 30 | protected void fireEditingStopped() { 31 | super.fireEditingStopped(); 32 | } 33 | 34 | public Object getCellEditorValue() { 35 | return editor.getValue(); 36 | } 37 | 38 | public Component getTableCellEditorComponent(JTable table, 39 | Object value, 40 | boolean isSelected, 41 | int row, 42 | int column) { 43 | editor.setValue(((Integer) value).intValue()); 44 | return editor; 45 | } 46 | } -------------------------------------------------------------------------------- /src/jebl/math/MultivariateFunction.java: -------------------------------------------------------------------------------- 1 | // MultivariateFunction.java 2 | // 3 | // (c) 2006- JEBL development team 4 | // 5 | // based on LGPL code from the Phylogenetic Analysis Library (PAL), 6 | // http://www.cebl.auckland.ac.nz/pal-project/ 7 | // which is (c) 1999-2001 PAL Development Core Team 8 | // 9 | // This package may be distributed under the 10 | // terms of the Lesser GNU General Public License (LGPL) 11 | 12 | package jebl.math; 13 | 14 | 15 | /** 16 | * interface for a function of several variables 17 | * 18 | * @author Korbinian Strimmer 19 | */ 20 | public interface MultivariateFunction 21 | { 22 | /** 23 | * compute function value 24 | * 25 | * @param argument function argument (vector) 26 | * 27 | * @return function value 28 | */ 29 | double evaluate(double[] argument); 30 | 31 | 32 | /** 33 | * get number of arguments 34 | * 35 | * @return number of arguments 36 | */ 37 | int getNumArguments(); 38 | 39 | /** 40 | * get lower bound of argument n 41 | * 42 | * @param n argument number 43 | * 44 | * @return lower bound 45 | */ 46 | double getLowerBound(int n); 47 | 48 | /** 49 | * get upper bound of argument n 50 | * 51 | * @param n argument number 52 | * 53 | * @return upper bound 54 | */ 55 | double getUpperBound(int n); 56 | 57 | /** 58 | * @return an Orthogonal Hints object that can be used by Orthogonal based optimisers 59 | * to get information about the function 60 | * @return if no such information just return null! 61 | */ 62 | OrthogonalHints getOrthogonalHints(); 63 | 64 | 65 | } 66 | -------------------------------------------------------------------------------- /src/org/virion/jam/table/RealNumberCellEditor.java: -------------------------------------------------------------------------------- 1 | package org.virion.jam.table; 2 | 3 | import org.virion.jam.components.RealNumberField; 4 | 5 | import javax.swing.*; 6 | import java.awt.*; 7 | import java.awt.event.ActionEvent; 8 | import java.awt.event.ActionListener; 9 | 10 | 11 | public class RealNumberCellEditor extends DefaultCellEditor { 12 | 13 | private RealNumberField editor; 14 | 15 | public RealNumberCellEditor(double minValue, double maxValue) { 16 | super(new RealNumberField(minValue, maxValue)); 17 | 18 | editor = (RealNumberField) getComponent(); 19 | 20 | setClickCountToStart(2); //This is usually 1 or 2. 21 | 22 | // Must do this so that editing stops when appropriate. 23 | editor.addActionListener(new ActionListener() { 24 | public void actionPerformed(ActionEvent e) { 25 | fireEditingStopped(); 26 | } 27 | }); 28 | } 29 | 30 | protected void fireEditingStopped() { 31 | super.fireEditingStopped(); 32 | } 33 | 34 | public Object getCellEditorValue() { 35 | return editor.getValue(); 36 | } 37 | 38 | public Component getTableCellEditorComponent(JTable table, 39 | Object value, 40 | boolean isSelected, 41 | int row, 42 | int column) { 43 | editor.setValue(((Double) value).doubleValue()); 44 | return editor; 45 | } 46 | } -------------------------------------------------------------------------------- /src/jebl/evolution/align/scores/Pam100.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.align.scores; 2 | 3 | public class Pam100 extends AminoAcidScores { 4 | 5 | private final float[][] residueScores = { 6 | 7 | /* A R N D C Q E G H I L K M F P S T W Y V */ 8 | { 4}, 9 | { -3, 7}, 10 | { -1, -2, 5}, 11 | { -1, -4, 3, 5}, 12 | { -3, -5, -5, -7, 9}, 13 | { -2, 1, -1, 0, -8, 6}, 14 | { 0, -3, 1, 4, -8, 2, 5}, 15 | { 1, -5, -1, -1, -5, -3, -1, 5}, 16 | { -3, 1, 2, -1, -4, 3, -1, -4, 7}, 17 | { -2, -3, -3, -4, -3, -4, -3, -5, -4, 6}, 18 | { -3, -5, -4, -6, -8, -2, -5, -6, -3, 1, 6}, 19 | { -3, 2, 1, -1, -8, 0, -1, -3, -2, -3, -4, 5}, 20 | { -2, -1, -4, -5, -7, -2, -4, -4, -4, 1, 3, 0, 9}, 21 | { -5, -6, -5, -8, -7, -7, -8, -6, -3, 0, 0, -7, -1, 8}, 22 | { 1, -1, -2, -3, -4, -1, -2, -2, -1, -4, -4, -3, -4, -6, 7}, 23 | { 1, -1, 1, -1, -1, -2, -1, 0, -2, -3, -4, -1, -3, -4, 0, 4}, 24 | { 1, -3, 0, -2, -4, -2, -2, -2, -3, 0, -3, -1, -1, -5, -1, 2, 5}, 25 | { -7, 1, -5, -9, -9, -7, -9, -9, -4, -7, -3, -6, -6, -1, -7, -3, -7, 12}, 26 | { -4, -6, -2, -6, -1, -6, -5, -7, -1, -3, -3, -6, -5, 4, -7, -4, -4, -2, 9}, 27 | { 0, -4, -3, -4, -3, -3, -3, -3, -3, 3, 0, -4, 1, -3, -3, -2, 0, -9, -4, 5}}; 28 | 29 | public Pam100() { buildScores(residueScores); } 30 | } 31 | -------------------------------------------------------------------------------- /src/jebl/evolution/align/scores/Pam110.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.align.scores; 2 | 3 | public class Pam110 extends AminoAcidScores { 4 | 5 | private final float[][] residueScores = { 6 | 7 | /* A R N D C Q E G H I L K M F P S T W Y V */ 8 | { 3}, 9 | { -3, 7}, 10 | { -1, -1, 4}, 11 | { -1, -4, 2, 5}, 12 | { -3, -4, -5, -7, 9}, 13 | { -1, 1, 0, 1, -7, 6}, 14 | { 0, -3, 1, 4, -7, 2, 5}, 15 | { 1, -4, 0, 0, -5, -3, -1, 5}, 16 | { -3, 1, 2, 0, -4, 3, -1, -4, 7}, 17 | { -1, -3, -2, -3, -3, -3, -3, -4, -4, 6}, 18 | { -3, -4, -4, -6, -8, -2, -5, -6, -3, 1, 6}, 19 | { -3, 2, 1, -1, -7, 0, -1, -3, -2, -3, -4, 5}, 20 | { -2, -1, -3, -5, -7, -1, -3, -4, -4, 1, 3, 0, 8}, 21 | { -4, -5, -4, -7, -6, -6, -7, -5, -3, 0, 0, -7, -1, 8}, 22 | { 1, -1, -2, -3, -4, 0, -2, -2, -1, -4, -4, -3, -4, -6, 6}, 23 | { 1, -1, 1, -1, -1, -2, -1, 0, -2, -3, -4, -1, -2, -4, 0, 3}, 24 | { 1, -2, 0, -1, -3, -2, -2, -2, -3, 0, -3, -1, -1, -4, -1, 2, 5}, 25 | { -7, 1, -5, -8, -9, -6, -9, -8, -4, -7, -3, -5, -6, -1, -7, -3, -6, 12}, 26 | { -4, -5, -2, -5, -1, -6, -5, -7, -1, -2, -3, -5, -5, 4, -7, -3, -3, -2, 8}, 27 | { 0, -4, -3, -4, -3, -3, -3, -2, -3, 3, 1, -4, 1, -3, -2, -2, 0, -8, -4, 5}}; 28 | 29 | public Pam110() { buildScores(residueScores); } 30 | } 31 | -------------------------------------------------------------------------------- /src/jebl/evolution/align/scores/Pam120.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.align.scores; 2 | 3 | public class Pam120 extends AminoAcidScores { 4 | 5 | private final float[][] residueScores = { 6 | 7 | /* A R N D C Q E G H I L K M F P S T W Y V */ 8 | { 3}, 9 | { -3, 6}, 10 | { -1, -1, 4}, 11 | { 0, -3, 2, 5}, 12 | { -3, -4, -5, -7, 9}, 13 | { -1, 1, 0, 1, -7, 6}, 14 | { 0, -3, 1, 3, -7, 2, 5}, 15 | { 1, -4, 0, 0, -4, -3, -1, 5}, 16 | { -3, 1, 2, 0, -4, 3, -1, -4, 7}, 17 | { -1, -2, -2, -3, -3, -3, -3, -4, -4, 6}, 18 | { -3, -4, -4, -5, -7, -2, -4, -5, -3, 1, 5}, 19 | { -2, 2, 1, -1, -7, 0, -1, -3, -2, -3, -4, 5}, 20 | { -2, -1, -3, -4, -6, -1, -3, -4, -4, 1, 3, 0, 8}, 21 | { -4, -5, -4, -7, -6, -6, -7, -5, -3, 0, 0, -7, -1, 8}, 22 | { 1, -1, -2, -3, -4, 0, -2, -2, -1, -3, -3, -2, -3, -5, 6}, 23 | { 1, -1, 1, 0, 0, -2, -1, 1, -2, -2, -4, -1, -2, -3, 1, 3}, 24 | { 1, -2, 0, -1, -3, -2, -2, -1, -3, 0, -3, -1, -1, -4, -1, 2, 4}, 25 | { -7, 1, -4, -8, -8, -6, -8, -8, -3, -6, -3, -5, -6, -1, -7, -2, -6, 12}, 26 | { -4, -5, -2, -5, -1, -5, -5, -6, -1, -2, -2, -5, -4, 4, -6, -3, -3, -2, 8}, 27 | { 0, -3, -3, -3, -3, -3, -3, -2, -3, 3, 1, -4, 1, -3, -2, -2, 0, -8, -3, 5}}; 28 | 29 | public Pam120() { buildScores(residueScores); } 30 | } 31 | -------------------------------------------------------------------------------- /src/jebl/evolution/align/scores/Pam130.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.align.scores; 2 | 3 | public class Pam130 extends AminoAcidScores { 4 | 5 | private final float[][] residueScores = { 6 | 7 | /* A R N D C Q E G H I L K M F P S T W Y V */ 8 | { 3}, 9 | { -3, 6}, 10 | { 0, -1, 4}, 11 | { 0, -3, 2, 5}, 12 | { -3, -4, -4, -6, 9}, 13 | { -1, 1, 0, 1, -6, 5}, 14 | { 0, -3, 1, 3, -6, 2, 5}, 15 | { 1, -4, 0, 0, -4, -2, -1, 5}, 16 | { -2, 1, 2, 0, -4, 3, 0, -3, 7}, 17 | { -1, -2, -2, -3, -3, -3, -2, -4, -3, 5}, 18 | { -3, -4, -3, -5, -7, -2, -4, -5, -3, 1, 5}, 19 | { -2, 2, 1, -1, -6, 0, -1, -3, -1, -2, -4, 5}, 20 | { -2, -1, -3, -4, -6, -1, -3, -4, -3, 2, 3, 0, 8}, 21 | { -4, -5, -4, -7, -5, -6, -6, -5, -2, 0, 1, -6, -1, 7}, 22 | { 1, -1, -1, -2, -3, 0, -2, -2, -1, -3, -3, -2, -3, -5, 6}, 23 | { 1, -1, 1, 0, 0, -1, -1, 1, -2, -2, -4, -1, -2, -3, 1, 3}, 24 | { 1, -2, 0, -1, -3, -2, -1, -1, -2, 0, -2, 0, -1, -4, -1, 2, 4}, 25 | { -6, 1, -4, -7, -8, -6, -8, -7, -3, -6, -2, -5, -5, -1, -6, -2, -6, 12}, 26 | { -4, -5, -2, -5, -1, -5, -5, -6, 0, -2, -2, -5, -4, 4, -6, -3, -3, -1, 8}, 27 | { 0, -3, -3, -3, -2, -3, -3, -2, -3, 3, 1, -4, 1, -2, -2, -2, 0, -7, -3, 5}}; 28 | 29 | public Pam130() { buildScores(residueScores); } 30 | } 31 | -------------------------------------------------------------------------------- /src/jebl/evolution/align/scores/Pam140.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.align.scores; 2 | 3 | public class Pam140 extends AminoAcidScores { 4 | 5 | private final float[][] residueScores = { 6 | 7 | /* A R N D C Q E G H I L K M F P S T W Y V */ 8 | { 3}, 9 | { -2, 6}, 10 | { 0, -1, 3}, 11 | { 0, -3, 2, 4}, 12 | { -2, -4, -4, -6, 9}, 13 | { -1, 1, 0, 1, -6, 5}, 14 | { 0, -2, 1, 3, -6, 2, 4}, 15 | { 1, -4, 0, 0, -4, -2, -1, 5}, 16 | { -2, 1, 2, 0, -4, 3, 0, -3, 6}, 17 | { -1, -2, -2, -3, -3, -3, -2, -4, -3, 5}, 18 | { -2, -4, -3, -5, -7, -2, -4, -5, -2, 1, 5}, 19 | { -2, 3, 1, -1, -6, 0, -1, -3, -1, -2, -3, 5}, 20 | { -2, -1, -2, -4, -6, -1, -3, -3, -3, 2, 3, 0, 7}, 21 | { -4, -5, -4, -6, -5, -5, -6, -5, -2, 0, 1, -6, -1, 7}, 22 | { 1, -1, -1, -2, -3, 0, -1, -1, -1, -3, -3, -2, -3, -5, 6}, 23 | { 1, -1, 1, 0, 0, -1, -1, 1, -1, -2, -3, -1, -2, -3, 1, 3}, 24 | { 1, -2, 0, -1, -3, -2, -1, -1, -2, 0, -2, 0, -1, -4, 0, 2, 4}, 25 | { -6, 1, -4, -7, -8, -5, -8, -7, -3, -6, -2, -4, -5, -1, -6, -2, -5, 12}, 26 | { -4, -5, -2, -5, -1, -5, -4, -6, 0, -2, -2, -5, -4, 4, -6, -3, -3, -1, 8}, 27 | { 0, -3, -2, -3, -2, -2, -2, -2, -3, 3, 1, -3, 1, -2, -2, -2, 0, -7, -3, 5}}; 28 | 29 | public Pam140() { buildScores(residueScores); } 30 | } 31 | -------------------------------------------------------------------------------- /src/jebl/evolution/align/scores/Pam150.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.align.scores; 2 | 3 | public class Pam150 extends AminoAcidScores { 4 | 5 | private final float[][] residueScores = { 6 | 7 | /* A R N D C Q E G H I L K M F P S T W Y V */ 8 | { 3}, 9 | { -2, 6}, 10 | { 0, -1, 3}, 11 | { 0, -2, 2, 4}, 12 | { -2, -4, -4, -6, 9}, 13 | { -1, 1, 0, 1, -6, 5}, 14 | { 0, -2, 1, 3, -6, 2, 4}, 15 | { 1, -3, 0, 0, -4, -2, -1, 4}, 16 | { -2, 1, 2, 0, -3, 3, 0, -3, 6}, 17 | { -1, -2, -2, -3, -2, -3, -2, -3, -3, 5}, 18 | { -2, -3, -3, -5, -6, -2, -4, -4, -2, 1, 5}, 19 | { -2, 3, 1, -1, -6, 0, -1, -2, -1, -2, -3, 4}, 20 | { -1, -1, -2, -3, -5, -1, -2, -3, -3, 2, 3, 0, 7}, 21 | { -4, -4, -4, -6, -5, -5, -6, -5, -2, 0, 1, -6, -1, 7}, 22 | { 1, -1, -1, -2, -3, 0, -1, -1, -1, -3, -3, -2, -3, -5, 6}, 23 | { 1, -1, 1, 0, 0, -1, -1, 1, -1, -2, -3, -1, -2, -3, 1, 2}, 24 | { 1, -2, 0, -1, -3, -1, -1, -1, -2, 0, -2, 0, -1, -3, 0, 1, 4}, 25 | { -6, 1, -4, -7, -7, -5, -7, -7, -3, -5, -2, -4, -5, -1, -6, -2, -5, 12}, 26 | { -3, -4, -2, -4, 0, -4, -4, -5, 0, -2, -2, -4, -3, 5, -5, -3, -3, -1, 8}, 27 | { 0, -3, -2, -3, -2, -2, -2, -2, -3, 3, 1, -3, 1, -2, -2, -1, 0, -6, -3, 4}}; 28 | 29 | public Pam150() { buildScores(residueScores); } 30 | } 31 | -------------------------------------------------------------------------------- /src/jebl/evolution/align/scores/Pam160.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.align.scores; 2 | 3 | public class Pam160 extends AminoAcidScores { 4 | 5 | private final float[][] residueScores = { 6 | 7 | /* A R N D C Q E G H I L K M F P S T W Y V */ 8 | { 2}, 9 | { -2, 6}, 10 | { 0, -1, 3}, 11 | { 0, -2, 2, 4}, 12 | { -2, -3, -4, -5, 9}, 13 | { -1, 1, 0, 1, -5, 5}, 14 | { 0, -2, 1, 3, -5, 2, 4}, 15 | { 1, -3, 0, 0, -3, -2, 0, 4}, 16 | { -2, 1, 2, 0, -3, 2, 0, -3, 6}, 17 | { -1, -2, -2, -3, -2, -2, -2, -3, -3, 5}, 18 | { -2, -3, -3, -4, -6, -2, -3, -4, -2, 2, 5}, 19 | { -2, 3, 1, 0, -5, 0, -1, -2, -1, -2, -3, 4}, 20 | { -1, -1, -2, -3, -5, -1, -2, -3, -3, 2, 3, 0, 7}, 21 | { -3, -4, -3, -6, -5, -5, -5, -4, -2, 0, 1, -5, 0, 7}, 22 | { 1, -1, -1, -2, -3, 0, -1, -1, -1, -2, -3, -2, -2, -4, 5}, 23 | { 1, -1, 1, 0, 0, -1, 0, 1, -1, -2, -3, -1, -2, -3, 1, 2}, 24 | { 1, -1, 0, -1, -2, -1, -1, -1, -2, 0, -2, 0, -1, -3, 0, 1, 3}, 25 | { -5, 1, -4, -6, -7, -5, -7, -7, -3, -5, -2, -4, -4, -1, -5, -2, -5, 12}, 26 | { -3, -4, -2, -4, 0, -4, -4, -5, 0, -2, -2, -4, -3, 5, -5, -3, -3, -1, 8}, 27 | { 0, -3, -2, -3, -2, -2, -2, -2, -2, 3, 1, -3, 1, -2, -2, -1, 0, -6, -3, 4}}; 28 | 29 | public Pam160() { buildScores(residueScores); } 30 | } 31 | -------------------------------------------------------------------------------- /src/jebl/evolution/align/scores/Pam170.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.align.scores; 2 | 3 | public class Pam170 extends AminoAcidScores { 4 | 5 | private final float[][] residueScores = { 6 | 7 | /* A R N D C Q E G H I L K M F P S T W Y V */ 8 | { 3}, 9 | { -3, 8}, 10 | { 0, -1, 4}, 11 | { 0, -3, 3, 6}, 12 | { -3, -5, -5, -7, 13}, 13 | { -1, 1, 0, 2, -8, 6}, 14 | { 0, -2, 2, 5, -8, 3, 6}, 15 | { 1, -4, 0, 0, -5, -2, 0, 6}, 16 | { -3, 2, 2, 0, -5, 4, 0, -4, 9}, 17 | { -1, -3, -3, -4, -3, -3, -3, -4, -4, 7}, 18 | { -3, -4, -4, -6, -9, -2, -5, -6, -3, 2, 7}, 19 | { -2, 4, 1, -1, -8, 0, -1, -3, -1, -3, -4, 6}, 20 | { -2, -1, -3, -4, -7, -1, -3, -4, -4, 2, 4, 1, 10}, 21 | { -5, -6, -5, -8, -6, -7, -8, -6, -3, 1, 1, -8, 0, 10}, 22 | { 1, -1, -1, -2, -4, 0, -1, -2, -1, -3, -4, -2, -3, -6, 8}, 23 | { 2, -1, 1, 0, 0, -1, -1, 1, -2, -2, -4, -1, -2, -4, 1, 3}, 24 | { 2, -2, 0, -1, -3, -2, -1, -1, -2, 0, -3, 0, -1, -5, 0, 2, 5}, 25 | { -8, 2, -5, -9,-10, -7,-10, -9, -4, -7, -3, -5, -6, -1, -8, -3, -7, 18}, 26 | { -5, -6, -3, -6, 0, -6, -6, -7, 0, -2, -2, -6, -4, 7, -7, -4, -4, -1, 12}, 27 | { 0, -4, -3, -4, -3, -3, -3, -2, -3, 5, 2, -4, 2, -2, -2, -2, 0, -9, -4, 6}}; 28 | 29 | public Pam170() { buildScores(residueScores); } 30 | } 31 | -------------------------------------------------------------------------------- /src/jebl/evolution/align/scores/Pam180.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.align.scores; 2 | 3 | public class Pam180 extends AminoAcidScores { 4 | 5 | private final float[][] residueScores = { 6 | 7 | /* A R N D C Q E G H I L K M F P S T W Y V */ 8 | { 3}, 9 | { -3, 8}, 10 | { 0, -1, 4}, 11 | { 0, -3, 3, 5}, 12 | { -3, -5, -5, -7, 13}, 13 | { -1, 1, 0, 2, -7, 6}, 14 | { 0, -2, 2, 4, -7, 3, 5}, 15 | { 1, -4, 0, 0, -5, -2, 0, 6}, 16 | { -2, 2, 2, 0, -4, 4, 0, -3, 8}, 17 | { -1, -3, -3, -3, -3, -3, -3, -4, -4, 6}, 18 | { -3, -4, -4, -6, -8, -2, -5, -6, -3, 2, 7}, 19 | { -2, 4, 1, 0, -7, 0, -1, -3, -1, -3, -4, 6}, 20 | { -2, -1, -3, -4, -7, -1, -3, -4, -3, 2, 4, 1, 9}, 21 | { -5, -6, -5, -8, -6, -6, -7, -6, -3, 1, 1, -7, 0, 10}, 22 | { 1, -1, -1, -2, -4, 0, -1, -1, -1, -3, -4, -2, -3, -6, 8}, 23 | { 1, -1, 1, 0, 0, -1, -1, 1, -2, -2, -4, -1, -2, -4, 1, 3}, 24 | { 2, -2, 0, -1, -3, -2, -1, -1, -2, 0, -3, 0, -1, -4, 0, 2, 4}, 25 | { -8, 2, -5, -9,-10, -6, -9, -9, -4, -7, -3, -5, -6, 0, -7, -3, -7, 18}, 26 | { -5, -6, -2, -6, 0, -6, -6, -7, 0, -2, -2, -6, -4, 7, -7, -4, -4, -1, 11}, 27 | { 0, -4, -3, -3, -3, -3, -3, -2, -3, 5, 2, -4, 2, -2, -2, -2, 0, -8, -4, 6}}; 28 | 29 | public Pam180() { buildScores(residueScores); } 30 | } 31 | -------------------------------------------------------------------------------- /src/jebl/evolution/align/scores/Pam190.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.align.scores; 2 | 3 | public class Pam190 extends AminoAcidScores { 4 | 5 | private final float[][] residueScores = { 6 | 7 | /* A R N D C Q E G H I L K M F P S T W Y V */ 8 | { 3}, 9 | { -2, 8}, 10 | { 0, -1, 3}, 11 | { 0, -2, 3, 5}, 12 | { -3, -5, -5, -7, 13}, 13 | { -1, 1, 1, 2, -7, 6}, 14 | { 0, -2, 2, 4, -7, 3, 5}, 15 | { 1, -4, 0, 0, -4, -2, 0, 6}, 16 | { -2, 2, 2, 0, -4, 3, 0, -3, 8}, 17 | { -1, -3, -2, -3, -3, -3, -3, -4, -3, 6}, 18 | { -3, -4, -4, -5, -8, -2, -4, -5, -3, 2, 7}, 19 | { -2, 4, 1, 0, -7, 1, -1, -3, -1, -3, -4, 6}, 20 | { -2, -1, -3, -4, -7, -1, -3, -4, -3, 2, 4, 1, 9}, 21 | { -5, -6, -4, -7, -6, -6, -7, -6, -2, 1, 2, -7, 0, 10}, 22 | { 1, 0, -1, -2, -4, 0, -1, -1, -1, -3, -3, -2, -3, -6, 7}, 23 | { 1, -1, 1, 0, 0, -1, 0, 1, -1, -2, -4, 0, -2, -4, 1, 3}, 24 | { 2, -2, 0, -1, -3, -1, -1, -1, -2, 0, -2, 0, -1, -4, 0, 2, 4}, 25 | { -7, 2, -5, -8, -9, -6, -9, -9, -3, -7, -3, -5, -6, 0, -7, -3, -6, 18}, 26 | { -4, -5, -2, -5, 0, -5, -5, -7, 0, -2, -2, -6, -4, 7, -6, -4, -3, -1, 11}, 27 | { 0, -3, -3, -3, -3, -3, -3, -2, -3, 4, 2, -3, 2, -2, -2, -2, 0, -8, -3, 6}}; 28 | 29 | public Pam190() { buildScores(residueScores); } 30 | } 31 | -------------------------------------------------------------------------------- /src/jebl/evolution/align/scores/Pam200.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.align.scores; 2 | 3 | public class Pam200 extends AminoAcidScores { 4 | 5 | private final float[][] residueScores = { 6 | 7 | /* A R N D C Q E G H I L K M F P S T W Y V */ 8 | { 3}, 9 | { -2, 7}, 10 | { 0, 0, 3}, 11 | { 0, -2, 3, 5}, 12 | { -3, -4, -5, -6, 12}, 13 | { -1, 1, 1, 2, -7, 5}, 14 | { 0, -2, 2, 4, -7, 3, 5}, 15 | { 1, -4, 0, 0, -4, -2, 0, 6}, 16 | { -2, 2, 2, 0, -4, 3, 0, -3, 8}, 17 | { -1, -2, -2, -3, -3, -3, -3, -3, -3, 6}, 18 | { -2, -4, -4, -5, -7, -2, -4, -5, -3, 2, 7}, 19 | { -2, 4, 1, 0, -7, 1, 0, -2, -1, -2, -4, 6}, 20 | { -2, -1, -2, -4, -6, -1, -3, -4, -3, 2, 4, 1, 8}, 21 | { -4, -5, -4, -7, -6, -6, -7, -6, -2, 1, 2, -7, 0, 10}, 22 | { 1, 0, -1, -2, -4, 0, -1, -1, -1, -3, -3, -2, -3, -6, 7}, 23 | { 1, -1, 1, 0, 0, -1, 0, 1, -1, -2, -4, 0, -2, -4, 1, 2}, 24 | { 1, -1, 0, 0, -3, -1, -1, 0, -2, 0, -2, 0, -1, -4, 0, 2, 4}, 25 | { -7, 2, -5, -8, -9, -6, -9, -8, -3, -6, -2, -4, -5, 0, -7, -3, -6, 18}, 26 | { -4, -5, -2, -5, 0, -5, -5, -6, 0, -2, -2, -5, -3, 7, -6, -3, -3, -1, 11}, 27 | { 0, -3, -2, -3, -2, -3, -2, -2, -3, 4, 2, -3, 2, -2, -2, -1, 0, -8, -3, 5}}; 28 | 29 | public Pam200() { buildScores(residueScores); } 30 | } 31 | -------------------------------------------------------------------------------- /src/jebl/evolution/align/scores/Pam210.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.align.scores; 2 | 3 | public class Pam210 extends AminoAcidScores { 4 | 5 | private final float[][] residueScores = { 6 | 7 | /* A R N D C Q E G H I L K M F P S T W Y V */ 8 | { 2}, 9 | { -2, 7}, 10 | { 0, 0, 3}, 11 | { 0, -2, 2, 5}, 12 | { -2, -4, -4, -6, 12}, 13 | { -1, 1, 1, 2, -6, 5}, 14 | { 0, -2, 2, 4, -6, 3, 5}, 15 | { 1, -3, 0, 0, -4, -2, 0, 5}, 16 | { -2, 2, 2, 1, -4, 3, 0, -3, 8}, 17 | { -1, -2, -2, -3, -3, -3, -2, -3, -3, 5}, 18 | { -2, -4, -3, -5, -7, -2, -4, -5, -2, 2, 7}, 19 | { -2, 4, 1, 0, -6, 1, 0, -2, 0, -2, -3, 5}, 20 | { -1, -1, -2, -3, -6, -1, -3, -3, -3, 2, 4, 1, 8}, 21 | { -4, -5, -4, -7, -5, -6, -6, -5, -2, 1, 2, -6, 0, 10}, 22 | { 1, 0, -1, -1, -3, 0, -1, -1, 0, -3, -3, -2, -3, -5, 7}, 23 | { 1, 0, 1, 0, 0, -1, 0, 1, -1, -2, -3, 0, -2, -4, 1, 2}, 24 | { 1, -1, 0, 0, -3, -1, -1, 0, -2, 0, -2, 0, -1, -4, 0, 2, 3}, 25 | { -7, 2, -5, -8, -9, -6, -8, -8, -3, -6, -2, -4, -5, 0, -7, -3, -6, 18}, 26 | { -4, -5, -2, -5, 0, -5, -5, -6, 0, -1, -1, -5, -3, 7, -6, -3, -3, -1, 11}, 27 | { 0, -3, -2, -3, -2, -2, -2, -2, -3, 4, 2, -3, 2, -2, -2, -1, 0, -7, -3, 5}}; 28 | 29 | public Pam210() { buildScores(residueScores); } 30 | } 31 | -------------------------------------------------------------------------------- /src/jebl/evolution/align/scores/Pam220.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.align.scores; 2 | 3 | public class Pam220 extends AminoAcidScores { 4 | 5 | private final float[][] residueScores = { 6 | 7 | /* A R N D C Q E G H I L K M F P S T W Y V */ 8 | { 2}, 9 | { -2, 7}, 10 | { 0, 0, 3}, 11 | { 0, -2, 2, 4}, 12 | { -2, -4, -4, -6, 12}, 13 | { -1, 1, 1, 2, -6, 5}, 14 | { 0, -1, 2, 4, -6, 3, 4}, 15 | { 1, -3, 0, 0, -4, -2, 0, 5}, 16 | { -2, 2, 2, 1, -4, 3, 1, -3, 7}, 17 | { -1, -2, -2, -3, -3, -2, -2, -3, -3, 5}, 18 | { -2, -3, -3, -5, -7, -2, -4, -5, -2, 2, 6}, 19 | { -1, 4, 1, 0, -6, 1, 0, -2, 0, -2, -3, 5}, 20 | { -1, -1, -2, -3, -6, -1, -2, -3, -3, 2, 4, 1, 8}, 21 | { -4, -5, -4, -6, -5, -5, -6, -5, -2, 1, 2, -6, 0, 10}, 22 | { 1, 0, -1, -1, -3, 0, -1, -1, 0, -2, -3, -1, -2, -5, 7}, 23 | { 1, 0, 1, 0, 0, -1, 0, 1, -1, -2, -3, 0, -2, -4, 1, 2}, 24 | { 1, -1, 0, 0, -3, -1, -1, 0, -2, 0, -2, 0, -1, -4, 0, 2, 3}, 25 | { -6, 2, -4, -8, -8, -5, -8, -8, -3, -6, -2, -4, -5, 0, -6, -3, -6, 17}, 26 | { -4, -5, -2, -5, 0, -5, -5, -6, 0, -1, -1, -5, -3, 7, -6, -3, -3, 0, 11}, 27 | { 0, -3, -2, -3, -2, -2, -2, -2, -3, 4, 2, -3, 2, -2, -1, -1, 0, -7, -3, 5}}; 28 | 29 | public Pam220() { buildScores(residueScores); } 30 | } 31 | -------------------------------------------------------------------------------- /src/jebl/evolution/align/scores/Pam230.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.align.scores; 2 | 3 | public class Pam230 extends AminoAcidScores { 4 | 5 | private final float[][] residueScores = { 6 | 7 | /* A R N D C Q E G H I L K M F P S T W Y V */ 8 | { 2}, 9 | { -2, 7}, 10 | { 0, 0, 2}, 11 | { 0, -2, 2, 4}, 12 | { -2, -4, -4, -6, 12}, 13 | { -1, 1, 1, 2, -6, 5}, 14 | { 0, -1, 1, 4, -6, 3, 4}, 15 | { 1, -3, 0, 1, -4, -1, 0, 5}, 16 | { -2, 2, 2, 1, -4, 3, 1, -2, 7}, 17 | { -1, -2, -2, -3, -2, -2, -2, -3, -3, 5}, 18 | { -2, -3, -3, -4, -7, -2, -4, -4, -2, 2, 6}, 19 | { -1, 4, 1, 0, -6, 1, 0, -2, 0, -2, -3, 5}, 20 | { -1, -1, -2, -3, -6, -1, -2, -3, -2, 2, 4, 0, 7}, 21 | { -4, -5, -4, -6, -5, -5, -6, -5, -2, 1, 2, -6, 0, 9}, 22 | { 1, 0, -1, -1, -3, 0, -1, -1, 0, -2, -3, -1, -2, -5, 6}, 23 | { 1, 0, 1, 0, 0, -1, 0, 1, -1, -2, -3, 0, -2, -3, 1, 2}, 24 | { 1, -1, 0, 0, -2, -1, -1, 0, -2, 0, -2, 0, -1, -3, 0, 2, 3}, 25 | { -6, 2, -4, -7, -8, -5, -8, -7, -3, -6, -2, -4, -5, 0, -6, -3, -6, 17}, 26 | { -4, -5, -2, -5, 0, -4, -5, -6, 0, -1, -1, -5, -3, 7, -5, -3, -3, 0, 10}, 27 | { 0, -3, -2, -2, -2, -2, -2, -2, -2, 4, 2, -3, 2, -1, -1, -1, 0, -7, -3, 5}}; 28 | 29 | public Pam230() { buildScores(residueScores); } 30 | } 31 | -------------------------------------------------------------------------------- /src/jebl/evolution/align/scores/Pam240.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.align.scores; 2 | 3 | public class Pam240 extends AminoAcidScores { 4 | 5 | private final float[][] residueScores = { 6 | 7 | /* A R N D C Q E G H I L K M F P S T W Y V */ 8 | { 2}, 9 | { -2, 6}, 10 | { 0, 0, 2}, 11 | { 0, -1, 2, 4}, 12 | { -2, -4, -4, -5, 12}, 13 | { 0, 1, 1, 2, -6, 4}, 14 | { 0, -1, 1, 4, -6, 3, 4}, 15 | { 1, -3, 0, 1, -4, -1, 0, 5}, 16 | { -1, 2, 2, 1, -4, 3, 1, -2, 7}, 17 | { -1, -2, -2, -2, -2, -2, -2, -3, -3, 5}, 18 | { -2, -3, -3, -4, -6, -2, -3, -4, -2, 2, 6}, 19 | { -1, 3, 1, 0, -6, 1, 0, -2, 0, -2, -3, 5}, 20 | { -1, 0, -2, -3, -5, -1, -2, -3, -2, 2, 4, 0, 7}, 21 | { -4, -5, -4, -6, -5, -5, -6, -5, -2, 1, 2, -5, 0, 9}, 22 | { 1, 0, -1, -1, -3, 0, -1, -1, 0, -2, -3, -1, -2, -5, 6}, 23 | { 1, 0, 1, 0, 0, -1, 0, 1, -1, -1, -3, 0, -2, -3, 1, 2}, 24 | { 1, -1, 0, 0, -2, -1, 0, 0, -1, 0, -2, 0, -1, -3, 0, 1, 3}, 25 | { -6, 2, -4, -7, -8, -5, -7, -7, -3, -5, -2, -4, -4, 0, -6, -3, -5, 17}, 26 | { -4, -4, -2, -4, 0, -4, -4, -5, 0, -1, -1, -5, -3, 7, -5, -3, -3, 0, 10}, 27 | { 0, -3, -2, -2, -2, -2, -2, -1, -2, 4, 2, -3, 2, -1, -1, -1, 0, -6, -3, 4}}; 28 | 29 | public Pam240() { buildScores(residueScores); } 30 | } 31 | -------------------------------------------------------------------------------- /src/jebl/evolution/align/scores/Pam250.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.align.scores; 2 | 3 | public class Pam250 extends AminoAcidScores { 4 | 5 | private final float[][] residueScores = { 6 | 7 | /* A R N D C Q E G H I L K M F P S T W Y V */ 8 | { 2}, 9 | { -2, 6}, 10 | { 0, 0, 2}, 11 | { 0, -1, 2, 4}, 12 | { -2, -4, -4, -5, 12}, 13 | { 0, 1, 1, 2, -5, 4}, 14 | { 0, -1, 1, 3, -5, 2, 4}, 15 | { 1, -3, 0, 1, -3, -1, 0, 5}, 16 | { -1, 2, 2, 1, -3, 3, 1, -2, 6}, 17 | { -1, -2, -2, -2, -2, -2, -2, -3, -2, 5}, 18 | { -2, -3, -3, -4, -6, -2, -3, -4, -2, 2, 6}, 19 | { -1, 3, 1, 0, -5, 1, 0, -2, 0, -2, -3, 5}, 20 | { -1, 0, -2, -3, -5, -1, -2, -3, -2, 2, 4, 0, 6}, 21 | { -3, -4, -3, -6, -4, -5, -5, -5, -2, 1, 2, -5, 0, 9}, 22 | { 1, 0, 0, -1, -3, 0, -1, 0, 0, -2, -3, -1, -2, -5, 6}, 23 | { 1, 0, 1, 0, 0, -1, 0, 1, -1, -1, -3, 0, -2, -3, 1, 2}, 24 | { 1, -1, 0, 0, -2, -1, 0, 0, -1, 0, -2, 0, -1, -3, 0, 1, 3}, 25 | { -6, 2, -4, -7, -8, -5, -7, -7, -3, -5, -2, -3, -4, 0, -6, -2, -5, 17}, 26 | { -3, -4, -2, -4, 0, -4, -4, -5, 0, -1, -1, -4, -2, 7, -5, -3, -3, 0, 10}, 27 | { 0, -2, -2, -2, -2, -2, -2, -1, -2, 4, 2, -2, 2, -1, -1, -1, 0, -6, -2, 4}}; 28 | 29 | public Pam250() { buildScores(residueScores); } 30 | } 31 | -------------------------------------------------------------------------------- /src/jebl/evolution/align/scores/Blosum55.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.align.scores; 2 | 3 | public class Blosum55 extends AminoAcidScores { 4 | 5 | private final float[][] residueScores = { 6 | 7 | /* A R N D C Q E G H I L K M F P S T W Y V */ 8 | { 5}, 9 | { -2, 8}, 10 | { -2, -1, 8}, 11 | { -2, -2, 2, 8}, 12 | { 0, -4, -3, -4, 13}, 13 | { -1, 1, 0, 0, -4, 7}, 14 | { -1, 0, 0, 2, -4, 2, 7}, 15 | { 0, -3, 0, -2, -3, -2, -3, 8}, 16 | { -2, 0, 1, -1, -4, 1, -1, -2, 11}, 17 | { -2, -4, -4, -4, -2, -4, -4, -5, -4, 6}, 18 | { -2, -3, -4, -5, -2, -3, -4, -5, -3, 2, 6}, 19 | { -1, 3, 0, -1, -4, 2, 1, -2, 0, -4, -3, 6}, 20 | { -1, -2, -3, -4, -2, 0, -3, -3, -2, 2, 3, -2, 8}, 21 | { -3, -3, -4, -5, -3, -4, -4, -4, -1, 0, 1, -4, 0, 9}, 22 | { -1, -3, -2, -2, -3, -1, -1, -3, -3, -3, -4, -1, -3, -5, 10}, 23 | { 2, -1, 1, 0, -1, 0, 0, 0, -1, -3, -3, 0, -2, -3, -1, 5}, 24 | { 0, -1, 0, -1, -1, -1, -1, -2, -2, -1, -2, -1, -1, -3, -1, 2, 6}, 25 | { -4, -3, -5, -5, -4, -2, -3, -3, -3, -3, -3, -4, -2, 2, -5, -4, -3, 15}, 26 | { -2, -2, -2, -3, -3, -1, -2, -4, 2, -1, -1, -2, -1, 4, -4, -2, -2, 3, 9}, 27 | { 0, -3, -4, -4, -1, -3, -3, -4, -4, 4, 1, -3, 1, -1, -3, -2, 0, -4, -2, 5}}; 28 | 29 | public Blosum55() { buildScores(residueScores); } 30 | } 31 | -------------------------------------------------------------------------------- /src/jebl/evolution/align/scores/Blosum60.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.align.scores; 2 | 3 | public class Blosum60 extends AminoAcidScores { 4 | 5 | private final float[][] residueScores = { 6 | 7 | /* A R N D C Q E G H I L K M F P S T W Y V */ 8 | { 4}, 9 | { -1, 5}, 10 | { -1, 0, 6}, 11 | { -2, -1, 1, 6}, 12 | { 0, -3, -2, -3, 9}, 13 | { -1, 1, 0, 0, -3, 5}, 14 | { -1, 0, 0, 2, -3, 2, 5}, 15 | { 0, -2, 0, -1, -2, -2, -2, 6}, 16 | { -2, 0, 1, -1, -3, 1, 0, -2, 7}, 17 | { -1, -3, -3, -3, -1, -3, -3, -3, -3, 4}, 18 | { -1, -2, -3, -3, -1, -2, -3, -4, -3, 2, 4}, 19 | { -1, 2, 0, -1, -3, 1, 1, -1, -1, -3, -2, 4}, 20 | { -1, -1, -2, -3, -1, 0, -2, -2, -1, 1, 2, -1, 5}, 21 | { -2, -3, -3, -3, -2, -3, -3, -3, -1, 0, 0, -3, 0, 6}, 22 | { -1, -2, -2, -1, -3, -1, -1, -2, -2, -3, -3, -1, -2, -4, 7}, 23 | { 1, -1, 1, 0, -1, 0, 0, 0, -1, -2, -2, 0, -1, -2, -1, 4}, 24 | { 0, -1, 0, -1, -1, -1, -1, -2, -2, -1, -1, -1, -1, -2, -1, 1, 4}, 25 | { -3, -3, -4, -4, -2, -2, -3, -2, -2, -2, -2, -3, -1, 1, -4, -3, -2, 10}, 26 | { -2, -2, -2, -3, -2, -1, -2, -3, 2, -1, -1, -2, -1, 3, -3, -2, -2, 2, 6}, 27 | { 0, -2, -3, -3, -1, -2, -2, -3, -3, 3, 1, -2, 1, -1, -2, -2, 0, -3, -1, 4}}; 28 | 29 | public Blosum60() { buildScores(residueScores); } 30 | } 31 | -------------------------------------------------------------------------------- /src/jebl/evolution/align/scores/Blosum62.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.align.scores; 2 | 3 | public class Blosum62 extends AminoAcidScores { 4 | 5 | private final float[][] residueScores = { 6 | 7 | /* A R N D C Q E G H I L K M F P S T W Y V */ 8 | { 4}, 9 | { -1, 5}, 10 | { -2, 0, 6}, 11 | { -2, -2, 1, 6}, 12 | { 0, -3, -3, -3, 9}, 13 | { -1, 1, 0, 0, -3, 5}, 14 | { -1, 0, 0, 2, -4, 2, 5}, 15 | { 0, -2, 0, -1, -3, -2, -2, 6}, 16 | { -2, 0, 1, -1, -3, 0, 0, -2, 8}, 17 | { -1, -3, -3, -3, -1, -3, -3, -4, -3, 4}, 18 | { -1, -2, -3, -4, -1, -2, -3, -4, -3, 2, 4}, 19 | { -1, 2, 0, -1, -3, 1, 1, -2, -1, -3, -2, 5}, 20 | { -1, -1, -2, -3, -1, 0, -2, -3, -2, 1, 2, -1, 5}, 21 | { -2, -3, -3, -3, -2, -3, -3, -3, -1, 0, 0, -3, 0, 6}, 22 | { -1, -2, -2, -1, -3, -1, -1, -2, -2, -3, -3, -1, -2, -4, 7}, 23 | { 1, -1, 1, 0, -1, 0, 0, 0, -1, -2, -2, 0, -1, -2, -1, 4}, 24 | { 0, -1, 0, -1, -1, -1, -1, -2, -2, -1, -1, -1, -1, -2, -1, 1, 5}, 25 | { -3, -3, -4, -4, -2, -2, -3, -2, -2, -3, -2, -3, -1, 1, -4, -3, -2, 11}, 26 | { -2, -2, -2, -3, -2, -1, -2, -3, 2, -1, -1, -2, -1, 3, -3, -2, -2, 2, 7}, 27 | { 0, -3, -3, -3, -1, -2, -2, -3, -3, 3, 1, -2, 1, -1, -2, -2, 0, -3, -1, 4}}; 28 | 29 | public Blosum62() { buildScores(residueScores); } 30 | } 31 | -------------------------------------------------------------------------------- /src/jebl/evolution/align/scores/Blosum65.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.align.scores; 2 | 3 | public class Blosum65 extends AminoAcidScores { 4 | 5 | private final float[][] residueScores = { 6 | 7 | /* A R N D C Q E G H I L K M F P S T W Y V */ 8 | { 4}, 9 | { -1, 6}, 10 | { -2, 0, 6}, 11 | { -2, -2, 1, 6}, 12 | { 0, -4, -3, -4, 9}, 13 | { -1, 1, 0, 0, -3, 6}, 14 | { -1, 0, 0, 2, -4, 2, 5}, 15 | { 0, -2, -1, -1, -3, -2, -2, 6}, 16 | { -2, 0, 1, -1, -3, 1, 0, -2, 8}, 17 | { -1, -3, -3, -3, -1, -3, -3, -4, -3, 4}, 18 | { -2, -2, -4, -4, -1, -2, -3, -4, -3, 2, 4}, 19 | { -1, 2, 0, -1, -3, 1, 1, -2, -1, -3, -3, 5}, 20 | { -1, -2, -2, -3, -2, 0, -2, -3, -2, 1, 2, -2, 6}, 21 | { -2, -3, -3, -4, -2, -3, -3, -3, -1, 0, 0, -3, 0, 6}, 22 | { -1, -2, -2, -2, -3, -1, -1, -2, -2, -3, -3, -1, -3, -4, 8}, 23 | { 1, -1, 1, 0, -1, 0, 0, 0, -1, -2, -3, 0, -2, -2, -1, 4}, 24 | { 0, -1, 0, -1, -1, -1, -1, -2, -2, -1, -1, -1, -1, -2, -1, 1, 5}, 25 | { -3, -3, -4, -5, -2, -2, -3, -3, -2, -2, -2, -3, -2, 1, -4, -3, -3, 10}, 26 | { -2, -2, -2, -3, -2, -2, -2, -3, 2, -1, -1, -2, -1, 3, -3, -2, -2, 2, 7}, 27 | { 0, -3, -3, -3, -1, -2, -3, -3, -3, 3, 1, -2, 1, -1, -2, -2, 0, -3, -1, 4}}; 28 | 29 | public Blosum65() { buildScores(residueScores); } 30 | } 31 | -------------------------------------------------------------------------------- /src/jebl/evolution/align/scores/Blosum70.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.align.scores; 2 | 3 | public class Blosum70 extends AminoAcidScores { 4 | 5 | private final float[][] residueScores = { 6 | 7 | /* A R N D C Q E G H I L K M F P S T W Y V */ 8 | { 4}, 9 | { -2, 6}, 10 | { -2, -1, 6}, 11 | { -2, -2, 1, 6}, 12 | { -1, -4, -3, -4, 9}, 13 | { -1, 1, 0, -1, -3, 6}, 14 | { -1, 0, 0, 1, -4, 2, 5}, 15 | { 0, -3, -1, -2, -3, -2, -2, 6}, 16 | { -2, 0, 0, -1, -4, 1, 0, -2, 8}, 17 | { -2, -3, -4, -4, -1, -3, -4, -4, -4, 4}, 18 | { -2, -3, -4, -4, -2, -2, -3, -4, -3, 2, 4}, 19 | { -1, 2, 0, -1, -4, 1, 1, -2, -1, -3, -3, 5}, 20 | { -1, -2, -2, -3, -2, 0, -2, -3, -2, 1, 2, -2, 6}, 21 | { -2, -3, -3, -4, -2, -3, -4, -4, -1, 0, 0, -3, 0, 6}, 22 | { -1, -2, -2, -2, -3, -2, -1, -3, -2, -3, -3, -1, -3, -4, 8}, 23 | { 1, -1, 0, 0, -1, 0, 0, -1, -1, -3, -3, 0, -2, -3, -1, 4}, 24 | { 0, -1, 0, -1, -1, -1, -1, -2, -2, -1, -2, -1, -1, -2, -1, 1, 5}, 25 | { -3, -3, -4, -5, -3, -2, -4, -3, -2, -3, -2, -3, -2, 1, -4, -3, -3, 11}, 26 | { -2, -2, -2, -4, -3, -2, -3, -4, 2, -1, -1, -2, -1, 3, -3, -2, -2, 2, 7}, 27 | { 0, -3, -3, -4, -1, -2, -3, -4, -3, 3, 1, -3, 1, -1, -3, -2, 0, -3, -2, 4}}; 28 | 29 | public Blosum70() { buildScores(residueScores); } 30 | } 31 | -------------------------------------------------------------------------------- /src/jebl/evolution/align/scores/Blosum75.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.align.scores; 2 | 3 | public class Blosum75 extends AminoAcidScores { 4 | 5 | private final float[][] residueScores = { 6 | 7 | /* A R N D C Q E G H I L K M F P S T W Y V */ 8 | { 4}, 9 | { -2, 6}, 10 | { -2, -1, 6}, 11 | { -2, -2, 1, 6}, 12 | { -1, -4, -3, -4, 9}, 13 | { -1, 1, 0, -1, -3, 6}, 14 | { -1, 0, -1, 1, -5, 2, 5}, 15 | { 0, -3, -1, -2, -3, -2, -3, 6}, 16 | { -2, 0, 0, -1, -4, 1, 0, -2, 8}, 17 | { -2, -3, -4, -4, -1, -3, -4, -5, -4, 4}, 18 | { -2, -3, -4, -4, -2, -3, -4, -4, -3, 1, 4}, 19 | { -1, 2, 0, -1, -4, 1, 1, -2, -1, -3, -3, 5}, 20 | { -1, -2, -3, -4, -2, 0, -2, -3, -2, 1, 2, -2, 6}, 21 | { -3, -3, -4, -4, -2, -4, -4, -4, -2, 0, 0, -4, 0, 6}, 22 | { -1, -2, -3, -2, -4, -2, -1, -3, -2, -3, -3, -1, -3, -4, 8}, 23 | { 1, -1, 0, -1, -1, 0, 0, -1, -1, -3, -3, 0, -2, -3, -1, 5}, 24 | { 0, -1, 0, -1, -1, -1, -1, -2, -2, -1, -2, -1, -1, -2, -1, 1, 5}, 25 | { -3, -3, -4, -5, -3, -2, -4, -3, -2, -3, -2, -4, -2, 1, -5, -3, -3, 11}, 26 | { -2, -2, -3, -4, -3, -2, -3, -4, 2, -2, -1, -2, -2, 3, -4, -2, -2, 2, 7}, 27 | { 0, -3, -3, -4, -1, -2, -3, -4, -4, 3, 1, -3, 1, -1, -3, -2, 0, -3, -2, 4}}; 28 | 29 | public Blosum75() { buildScores(residueScores); } 30 | } 31 | -------------------------------------------------------------------------------- /src/jebl/evolution/align/scores/Blosum80.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.align.scores; 2 | 3 | public class Blosum80 extends AminoAcidScores { 4 | 5 | private final float[][] residueScores = { 6 | 7 | /* A R N D C Q E G H I L K M F P S T W Y V */ 8 | { 7}, 9 | { -3, 9}, 10 | { -3, -1, 9}, 11 | { -3, -3, 2, 10}, 12 | { -1, -6, -5, -7, 13}, 13 | { -2, 1, 0, -1, -5, 9}, 14 | { -2, -1, -1, 2, -7, 3, 8}, 15 | { 0, -4, -1, -3, -6, -4, -4, 9}, 16 | { -3, 0, 1, -2, -7, 1, 0, -4, 12}, 17 | { -3, -5, -6, -7, -2, -5, -6, -7, -6, 7}, 18 | { -3, -4, -6, -7, -3, -4, -6, -7, -5, 2, 6}, 19 | { -1, 3, 0, -2, -6, 2, 1, -3, -1, -5, -4, 8}, 20 | { -2, -3, -4, -6, -3, -1, -4, -5, -4, 2, 3, -3, 9}, 21 | { -4, -5, -6, -6, -4, -5, -6, -6, -2, -1, 0, -5, 0, 10}, 22 | { -1, -3, -4, -3, -6, -3, -2, -5, -4, -5, -5, -2, -4, -6, 12}, 23 | { 2, -2, 1, -1, -2, -1, -1, -1, -2, -4, -4, -1, -3, -4, -2, 7}, 24 | { 0, -2, 0, -2, -2, -1, -2, -3, -3, -2, -3, -1, -1, -4, -3, 2, 8}, 25 | { -5, -5, -7, -8, -5, -4, -6, -6, -4, -5, -4, -6, -3, 0, -7, -6, -5, 16}, 26 | { -4, -4, -4, -6, -5, -3, -5, -6, 3, -3, -2, -4, -3, 4, -6, -3, -3, 3, 11}, 27 | { -1, -4, -5, -6, -2, -4, -4, -6, -5, 4, 1, -4, 1, -2, -4, -3, 0, -5, -3, 7}}; 28 | 29 | public Blosum80() { buildScores(residueScores); } 30 | } 31 | -------------------------------------------------------------------------------- /src/jebl/evolution/align/scores/Blosum85.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.align.scores; 2 | 3 | public class Blosum85 extends AminoAcidScores { 4 | 5 | private final float[][] residueScores = { 6 | 7 | /* A R N D C Q E G H I L K M F P S T W Y V */ 8 | { 5}, 9 | { -2, 6}, 10 | { -2, -1, 7}, 11 | { -2, -2, 1, 7}, 12 | { -1, -4, -4, -5, 9}, 13 | { -1, 1, 0, -1, -4, 6}, 14 | { -1, -1, -1, 1, -5, 2, 6}, 15 | { 0, -3, -1, -2, -4, -3, -3, 6}, 16 | { -2, 0, 0, -2, -5, 1, -1, -3, 8}, 17 | { -2, -4, -4, -5, -2, -4, -4, -5, -4, 5}, 18 | { -2, -3, -4, -5, -2, -3, -4, -5, -3, 1, 4}, 19 | { -1, 2, 0, -1, -4, 1, 0, -2, -1, -3, -3, 6}, 20 | { -2, -2, -3, -4, -2, 0, -3, -4, -3, 1, 2, -2, 7}, 21 | { -3, -4, -4, -4, -3, -4, -4, -4, -2, -1, 0, -4, -1, 7}, 22 | { -1, -2, -3, -2, -4, -2, -2, -3, -3, -4, -4, -2, -3, -4, 8}, 23 | { 1, -1, 0, -1, -2, -1, -1, -1, -1, -3, -3, -1, -2, -3, -1, 5}, 24 | { 0, -2, 0, -2, -2, -1, -1, -2, -2, -1, -2, -1, -1, -3, -2, 1, 5}, 25 | { -3, -4, -5, -6, -4, -3, -4, -4, -3, -3, -3, -5, -2, 0, -5, -4, -4, 11}, 26 | { -3, -3, -3, -4, -3, -2, -4, -5, 2, -2, -2, -3, -2, 3, -4, -2, -2, 2, 7}, 27 | { -1, -3, -4, -4, -1, -3, -3, -4, -4, 3, 0, -3, 0, -1, -3, -2, 0, -3, -2, 5}}; 28 | 29 | public Blosum85() { buildScores(residueScores); } 30 | } 31 | -------------------------------------------------------------------------------- /src/jebl/evolution/align/scores/Blosum90.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.align.scores; 2 | 3 | public class Blosum90 extends AminoAcidScores { 4 | 5 | private final float[][] residueScores = { 6 | 7 | /* A R N D C Q E G H I L K M F P S T W Y V */ 8 | { 5}, 9 | { -2, 6}, 10 | { -2, -1, 7}, 11 | { -3, -3, 1, 7}, 12 | { -1, -5, -4, -5, 9}, 13 | { -1, 1, 0, -1, -4, 7}, 14 | { -1, -1, -1, 1, -6, 2, 6}, 15 | { 0, -3, -1, -2, -4, -3, -3, 6}, 16 | { -2, 0, 0, -2, -5, 1, -1, -3, 8}, 17 | { -2, -4, -4, -5, -2, -4, -4, -5, -4, 5}, 18 | { -2, -3, -4, -5, -2, -3, -4, -5, -4, 1, 5}, 19 | { -1, 2, 0, -1, -4, 1, 0, -2, -1, -4, -3, 6}, 20 | { -2, -2, -3, -4, -2, 0, -3, -4, -3, 1, 2, -2, 7}, 21 | { -3, -4, -4, -5, -3, -4, -5, -5, -2, -1, 0, -4, -1, 7}, 22 | { -1, -3, -3, -3, -4, -2, -2, -3, -3, -4, -4, -2, -3, -4, 8}, 23 | { 1, -1, 0, -1, -2, -1, -1, -1, -2, -3, -3, -1, -2, -3, -2, 5}, 24 | { 0, -2, 0, -2, -2, -1, -1, -3, -2, -1, -2, -1, -1, -3, -2, 1, 6}, 25 | { -4, -4, -5, -6, -4, -3, -5, -4, -3, -4, -3, -5, -2, 0, -5, -4, -4, 11}, 26 | { -3, -3, -3, -4, -4, -3, -4, -5, 1, -2, -2, -3, -2, 3, -4, -3, -2, 2, 8}, 27 | { -1, -3, -4, -5, -2, -3, -3, -5, -4, 3, 0, -3, 0, -2, -3, -2, -1, -3, -3, 5}}; 28 | 29 | public Blosum90() { buildScores(residueScores); } 30 | } 31 | -------------------------------------------------------------------------------- /src/jade/math/PrecisionCalculator.java: -------------------------------------------------------------------------------- 1 | package jade.math; 2 | 3 | public final class PrecisionCalculator { 4 | 5 | /** Radix used by floating-point numbers. */ 6 | private final static int radix = computeRadix(); 7 | 8 | /** Largest positive value which, when added to 1.0, yields 0 */ 9 | private final static double machinePrecision = computeMachinePrecision(); 10 | 11 | /** Typical meaningful precision for numerical calculations. */ 12 | private final static double defaultNumericalPrecision = Math 13 | .sqrt(machinePrecision); 14 | 15 | private static int computeRadix() { 16 | int radix = 0; 17 | double a = 1.0d; 18 | double tmp1, tmp2; 19 | do { 20 | a += a; 21 | tmp1 = a + 1.0d; 22 | tmp2 = tmp1 - a; 23 | } while (tmp2 - 1.0d != 0.0d); 24 | double b = 1.0d; 25 | while (radix == 0) { 26 | b += b; 27 | tmp1 = a + b; 28 | radix = (int) (tmp1 - a); 29 | } 30 | return radix; 31 | } 32 | 33 | private static double computeMachinePrecision() { 34 | double floatingRadix = getRadix(); 35 | double inverseRadix = 1.0d / floatingRadix; 36 | double machinePrecision = 1.0d; 37 | double tmp = 1.0d + machinePrecision; 38 | while (tmp - 1.0d != 0.0d) { 39 | machinePrecision *= inverseRadix; 40 | tmp = 1.0d + machinePrecision; 41 | } 42 | return machinePrecision; 43 | } 44 | 45 | public static int getRadix() { 46 | return radix; 47 | } 48 | 49 | public static double getMachinePrecision() { 50 | return machinePrecision; 51 | } 52 | 53 | public static double defaultNumericalPrecision() { 54 | return defaultNumericalPrecision; 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /src/jebl/evolution/distances/DistanceMatrix.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.distances; 2 | 3 | import jebl.evolution.taxa.Taxon; 4 | 5 | import java.util.Collection; 6 | import java.util.List; 7 | 8 | /** 9 | * @author Andrew Rambaut 10 | * @author Alexei Drummond 11 | * @version $Id: DistanceMatrix.java 186 2006-01-24 00:41:22Z pepster $ 12 | */ 13 | public interface DistanceMatrix { 14 | 15 | /** 16 | * Gets the size of the matrix (which is square), i.e., number of rows or columns. 17 | * @return the size 18 | */ 19 | int getSize(); 20 | 21 | /** 22 | * @return the list of taxa that the state values correspond to. 23 | */ 24 | List getTaxa(); 25 | 26 | /** 27 | * Gets the distance at a particular row and column 28 | * @param row the row index 29 | * @param column the column index 30 | * @return the distance 31 | */ 32 | double getDistance(int row, int column); 33 | 34 | /** 35 | * Gets the distance between 2 taxa 36 | * @param taxonRow 37 | * @param taxonColumn 38 | * @return the distance 39 | */ 40 | double getDistance(Taxon taxonRow, Taxon taxonColumn); 41 | 42 | /** 43 | * Gets a sub-matrix for only those taxa in the collection (all 44 | * of which should be present in this matrix). 45 | * @param taxa 46 | * @return the new submatrix 47 | */ 48 | DistanceMatrix getSubmatrix(Collection taxa); 49 | 50 | /** 51 | * Gets a 2-dimensional array containing the distances 52 | * @return the distances 53 | */ 54 | double[][] getDistances(); 55 | } -------------------------------------------------------------------------------- /src/jebl/evolution/io/NewickExporter.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.io; 2 | 3 | import jebl.evolution.trees.Tree; 4 | import jebl.evolution.trees.Utils; 5 | import jebl.evolution.trees.RootedTree; 6 | 7 | import java.io.Writer; 8 | import java.io.IOException; 9 | import java.io.BufferedWriter; 10 | import java.util.Collection; 11 | 12 | /** 13 | * @author Andrew Rambaut 14 | * @author Alexei Drummond 15 | * @version $Id: NewickExporter.java 429 2006-08-26 18:17:39Z rambaut $ 16 | */ 17 | public class NewickExporter implements TreeExporter { 18 | public NewickExporter(Writer writer) { 19 | this.writer = writer; 20 | } 21 | 22 | /** 23 | * Export a single tree 24 | * 25 | * @param tree 26 | * @throws java.io.IOException 27 | */ 28 | public void exportTree(Tree tree) throws IOException { 29 | writeTree(tree); 30 | } 31 | 32 | /** 33 | * Export a collection of trees 34 | * 35 | * @param trees 36 | * @throws java.io.IOException 37 | */ 38 | public void exportTrees(Collection trees) throws IOException { 39 | for (Tree tree : trees) { 40 | writeTreeMine(tree); 41 | } 42 | } 43 | 44 | private void writeTree(Tree tree) throws IOException { 45 | writer.write(Utils.toNewick(Utils.rootTheTree(tree))); 46 | } 47 | 48 | /* 49 | * edit for FileWriter 50 | */ 51 | private void writeTreeMine(Tree tree) throws IOException { 52 | writer.write(Utils.toNewick(Utils.rootTheTree(tree))+";\n"); 53 | } 54 | 55 | private final Writer writer; 56 | } 57 | -------------------------------------------------------------------------------- /src/jebl/evolution/characters/Character.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.characters; 2 | 3 | import jebl.evolution.taxa.*; 4 | import java.util.*; 5 | 6 | /** 7 | * @author Stephen A. Smith 8 | * 9 | */ 10 | public interface Character{ 11 | 12 | /** 13 | * set the name of the character 14 | * @param name the name of the character 15 | */ 16 | public void setName(String name); 17 | 18 | /** 19 | * return the name of the character 20 | * @return the name of the character 21 | */ 22 | public String getName(); 23 | 24 | /** 25 | * set the description of the character 26 | * @param desc the description of the character 27 | */ 28 | public void setDesc(String desc); 29 | 30 | /** 31 | * return the description of the character 32 | * @return the description of the character 33 | */ 34 | public String getDesc(); 35 | 36 | /** 37 | * return the CharacterType of the character 38 | * @return the CharacterType of the character 39 | */ 40 | public CharacterType getType(); 41 | 42 | /** 43 | * add a taxon with this character 44 | * @param taxon the taxon to add containing the character 45 | */ 46 | public void addTaxon(Taxon taxon); 47 | 48 | /** 49 | * get a value for a taxon containing the character 50 | * @param taxon the taxon to get the value for 51 | * @return the Object value of the character for the given taxon 52 | */ 53 | public Object getValue(Taxon taxon); 54 | 55 | /** 56 | * get a Set of all the taxa for this character 57 | * @return a Set containing all of the taxa for this character 58 | */ 59 | public Set getTaxa(); 60 | } 61 | -------------------------------------------------------------------------------- /src/jebl/evolution/sequences/AminoAcidState.java: -------------------------------------------------------------------------------- 1 | /* 2 | * AminoAcidState.java 3 | * 4 | * (c) 2002-2005 JEBL Development Core Team 5 | * 6 | * This package may be distributed under the 7 | * Lesser Gnu Public Licence (LGPL) 8 | */ 9 | package jebl.evolution.sequences; 10 | 11 | /** 12 | * @author Andrew Rambaut 13 | * @author Alexei Drummond 14 | * 15 | * @version $Id: AminoAcidState.java 267 2006-03-21 02:36:55Z twobeers $ 16 | */ 17 | public final class AminoAcidState extends State { 18 | 19 | AminoAcidState(String name, String stateCode, int index) { 20 | super(name, stateCode, index); 21 | } 22 | 23 | AminoAcidState(String name, String stateCode, int index, AminoAcidState[] ambiguities) { 24 | super(name, stateCode, index, ambiguities); 25 | } 26 | 27 | public int compareTo(Object o) { 28 | // throws ClassCastException on across-class comparison 29 | AminoAcidState that = (AminoAcidState) o; 30 | return super.compareTo(that); 31 | } 32 | 33 | // we do not need to override equals because there is only one 34 | // unique instance of each nucleotide state - i.e. we can use == 35 | /* 36 | public boolean equals(Object o) { 37 | if (!(o instanceof AminoAcidState)) 38 | return false; 39 | return super.equals(o); 40 | }*/ 41 | 42 | public int hashCode() { 43 | return 7 * super.hashCode() + 23; 44 | } 45 | 46 | public boolean isGap() { 47 | return this == AminoAcids.GAP_STATE; 48 | } 49 | 50 | public boolean isStop() { 51 | return this == AminoAcids.STOP_STATE; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/jebl/evolution/trees/BaseNode.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.trees; 2 | 3 | import jebl.evolution.graphs.Node; 4 | import jebl.util.AttributableHelper; 5 | 6 | import java.util.Collections; 7 | import java.util.Map; 8 | import java.util.Set; 9 | 10 | /** 11 | * Common implementation of Attributable interface used by Nodes. 12 | * 13 | * @author Joseph Heled 14 | * @version $Id: BaseNode.java 295 2006-04-14 14:59:10Z rambaut $ 15 | * 16 | */ 17 | 18 | abstract class BaseNode implements Node { 19 | // Attributable IMPLEMENTATION 20 | 21 | public void setAttribute(String name, Object value) { 22 | if (helper == null) { 23 | helper = new AttributableHelper(); 24 | } 25 | helper.setAttribute(name, value); 26 | } 27 | 28 | public Object getAttribute(String name) { 29 | if (helper == null) { 30 | return null; 31 | } 32 | return helper.getAttribute(name); 33 | } 34 | 35 | public void removeAttribute(String name) { 36 | if( helper != null ) { 37 | helper.removeAttribute(name); 38 | } 39 | } 40 | 41 | public Set getAttributeNames() { 42 | if (helper == null) { 43 | return Collections.emptySet(); 44 | } 45 | return helper.getAttributeNames(); 46 | } 47 | 48 | public Map getAttributeMap() { 49 | if (helper == null) { 50 | return Collections.emptyMap(); 51 | } 52 | return helper.getAttributeMap(); 53 | } 54 | 55 | // PRIVATE members 56 | 57 | private AttributableHelper helper = null; 58 | } -------------------------------------------------------------------------------- /src/org/xml/sax/SAXNotRecognizedException.java: -------------------------------------------------------------------------------- 1 | // SAXNotRecognizedException.java - unrecognized feature or value. 2 | // http://www.saxproject.org 3 | // Written by David Megginson 4 | // NO WARRANTY! This class is in the Public Domain. 5 | // $Id: SAXNotRecognizedException.java,v 1.7 2002/01/30 21:13:48 dbrownell Exp $ 6 | 7 | package org.xml.sax; 8 | 9 | 10 | /** 11 | * Exception class for an unrecognized identifier. 12 | * 13 | *

14 | * This module, both source code and documentation, is in the 15 | * Public Domain, and comes with NO WARRANTY. 16 | * See http://www.saxproject.org 17 | * for further information. 18 | *
19 | * 20 | *

An XMLReader will throw this exception when it finds an 21 | * unrecognized feature or property identifier; SAX applications and 22 | * extensions may use this class for other, similar purposes.

23 | * 24 | * @since SAX 2.0 25 | * @author David Megginson 26 | * @version 2.0.1 (sax2r2) 27 | * @see org.xml.sax.SAXNotSupportedException 28 | */ 29 | public class SAXNotRecognizedException extends SAXException 30 | { 31 | 32 | /** 33 | * Default constructor. 34 | */ 35 | public SAXNotRecognizedException () 36 | { 37 | super(); 38 | } 39 | 40 | 41 | /** 42 | * Construct a new exception with the given message. 43 | * 44 | * @param message The text message of the exception. 45 | */ 46 | public SAXNotRecognizedException (String message) 47 | { 48 | super(message); 49 | } 50 | 51 | } 52 | 53 | // end of SAXNotRecognizedException.java 54 | -------------------------------------------------------------------------------- /src/org/virion/jam/framework/AuxilaryFrame.java: -------------------------------------------------------------------------------- 1 | /** 2 | * AuxilaryFrame.java 3 | */ 4 | 5 | package org.virion.jam.framework; 6 | 7 | import javax.swing.*; 8 | 9 | public class AuxilaryFrame extends AbstractFrame { 10 | 11 | private DocumentFrame documentFrame; 12 | private JPanel contentsPanel; 13 | 14 | public AuxilaryFrame(DocumentFrame documentFrame) { 15 | super(); 16 | 17 | this.documentFrame = documentFrame; 18 | this.contentsPanel = null; 19 | } 20 | 21 | public AuxilaryFrame(DocumentFrame documentFrame, 22 | JPanel contentsPanel) { 23 | super(); 24 | 25 | this.documentFrame = documentFrame; 26 | setContentsPanel(contentsPanel); 27 | } 28 | 29 | public void setContentsPanel(JPanel contentsPanel) { 30 | this.contentsPanel = contentsPanel; 31 | getContentPane().add(contentsPanel); 32 | pack(); 33 | } 34 | 35 | public DocumentFrame getDocumentFrame() { 36 | return documentFrame; 37 | } 38 | 39 | protected void initializeComponents() { 40 | } 41 | 42 | public boolean requestClose() { 43 | return true; 44 | } 45 | 46 | public JComponent getExportableComponent() { 47 | return contentsPanel; 48 | } 49 | 50 | @SuppressWarnings({"deprecation"}) 51 | public void doCloseWindow() { 52 | hide(); 53 | } 54 | 55 | public Action getSaveAction() { 56 | return documentFrame.getSaveAction(); 57 | } 58 | 59 | public Action getSaveAsAction() { 60 | return documentFrame.getSaveAsAction(); 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /src/jebl/evolution/align/scores/Blosum45.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.align.scores; 2 | 3 | public class Blosum45 extends AminoAcidScores { 4 | 5 | private final float[][] residueScores = { 6 | 7 | /* A R N D C Q E G H I L K M F P S T W Y V */ 8 | { 5}, 9 | { -2, 7}, 10 | { -1, 0, 6}, 11 | { -2, -1, 2, 7}, 12 | { -1, -3, -2, -3, 12}, 13 | { -1, 1, 0, 0, -3, 6}, 14 | { -1, 0, 0, 2, -3, 2, 6}, 15 | { 0, -2, 0, -1, -3, -2, -2, 7}, 16 | { -2, 0, 1, 0, -3, 1, 0, -2, 10}, 17 | { -1, -3, -2, -4, -3, -2, -3, -4, -3, 5}, 18 | { -1, -2, -3, -3, -2, -2, -2, -3, -2, 2, 5}, 19 | { -1, 3, 0, 0, -3, 1, 1, -2, -1, -3, -3, 5}, 20 | { -1, -1, -2, -3, -2, 0, -2, -2, 0, 2, 2, -1, 6}, 21 | { -2, -2, -2, -4, -2, -4, -3, -3, -2, 0, 1, -3, 0, 8}, 22 | { -1, -2, -2, -1, -4, -1, 0, -2, -2, -2, -3, -1, -2, -3, 9}, 23 | { 1, -1, 1, 0, -1, 0, 0, 0, -1, -2, -3, -1, -2, -2, -1, 4}, 24 | { 0, -1, 0, -1, -1, -1, -1, -2, -2, -1, -1, -1, -1, -1, -1, 2, 5}, 25 | { -2, -2, -4, -4, -5, -2, -3, -2, -3, -2, -2, -2, -2, 1, -3, -4, -3, 15}, 26 | { -2, -1, -2, -2, -3, -1, -2, -3, 2, 0, 0, -1, 0, 3, -3, -2, -1, 3, 8}, 27 | { 0, -2, -3, -3, -1, -3, -3, -3, -3, 3, 1, -2, 1, 0, -3, -1, 0, -3, -1, 5}}; 28 | 29 | public Blosum45() { buildScores(residueScores); } 30 | 31 | public String getName() { return "Blosum45"; } 32 | } 33 | -------------------------------------------------------------------------------- /src/jebl/evolution/trees/BaseEdge.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.trees; 2 | 3 | import jebl.evolution.graphs.Node; 4 | import jebl.evolution.graphs.Edge; 5 | import jebl.util.AttributableHelper; 6 | 7 | import java.util.Set; 8 | import java.util.Collections; 9 | import java.util.Map; 10 | 11 | /** 12 | * Common implementation of Attributable interface used by Nodes. 13 | * 14 | * @author Joseph Heled 15 | * @version $Id: BaseEdge.java 295 2006-04-14 14:59:10Z rambaut $ 16 | * 17 | */ 18 | 19 | abstract class BaseEdge implements Edge { 20 | // Attributable IMPLEMENTATION 21 | 22 | public void setAttribute(String name, Object value) { 23 | if (helper == null) { 24 | helper = new AttributableHelper(); 25 | } 26 | helper.setAttribute(name, value); 27 | } 28 | 29 | public Object getAttribute(String name) { 30 | if (helper == null) { 31 | return null; 32 | } 33 | return helper.getAttribute(name); 34 | } 35 | 36 | public void removeAttribute(String name) { 37 | if( helper != null ) { 38 | helper.removeAttribute(name); 39 | } 40 | } 41 | 42 | public Set getAttributeNames() { 43 | if (helper == null) { 44 | return Collections.emptySet(); 45 | } 46 | return helper.getAttributeNames(); 47 | } 48 | 49 | public Map getAttributeMap() { 50 | if (helper == null) { 51 | return Collections.emptyMap(); 52 | } 53 | return helper.getAttributeMap(); 54 | } 55 | 56 | // PRIVATE members 57 | 58 | private AttributableHelper helper = null; 59 | } 60 | -------------------------------------------------------------------------------- /src/jade/reconstruct/discrete/P.java: -------------------------------------------------------------------------------- 1 | package jade.reconstruct.discrete; 2 | 3 | /* 4 | * currently does not take into account assymetrical rates 5 | * to do so, just need to do something with b 6 | */ 7 | 8 | public class P { 9 | public P(int size) { 10 | this.size = size; 11 | this.a = 0.1; 12 | this.b = 0.1; 13 | 14 | } 15 | 16 | public P(int size, double a, double b) { 17 | this.size = size; 18 | this.a = a; 19 | this.b = b; 20 | System.out.println(size); 21 | } 22 | 23 | public double[][] getP(double time) { 24 | double[][] p = new double[2][2]; 25 | p = new double[size][size]; 26 | for (int i = 0; i < size; i++) { 27 | for (int j = 0; j < size; j++) { 28 | if (i == j) { 29 | p[i][j] = (1.0 / size) 30 | + ((size - 1) / Double.valueOf(size)) 31 | * (Math.exp(-(size * a * time))); 32 | } else { 33 | p[i][j] = (1.0 / size) - (1.0 / size) 34 | * (Math.exp(-(size * a * time))); 35 | } 36 | } 37 | } 38 | P = p; 39 | return p; 40 | } 41 | 42 | public void setRates(double a) { 43 | this.a = a; 44 | this.b = a; 45 | } 46 | 47 | public void setRates(double a, double b) { 48 | this.a = a; 49 | this.b = b; 50 | } 51 | 52 | public void printP() { 53 | for (int i = 0; i < size; i++) { 54 | for (int j = 0; j < size; j++) { 55 | System.out.print(P[i][j] + "\t"); 56 | } 57 | System.out.println(); 58 | } 59 | 60 | } 61 | 62 | public static void main(String[] args) { 63 | P p = new P(2); 64 | p.getP(1); 65 | p.printP(); 66 | } 67 | 68 | private double[][] P; 69 | 70 | private double a; 71 | 72 | private double b; 73 | 74 | private int size; 75 | } 76 | -------------------------------------------------------------------------------- /src/jade/math/ContinuedFraction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ContinuedFraction.java 3 | * 4 | * Created on August 19, 2005, 12:31 PM 5 | * 6 | * author: Stephen A. Smith 7 | */ 8 | 9 | package jade.math; 10 | 11 | /** 12 | * 13 | * @author stephensmith 14 | */ 15 | public abstract class ContinuedFraction extends IterativeProcess{ 16 | 17 | /** Creates a new instance of ContinuedFraction */ 18 | public ContinuedFraction() { 19 | } 20 | 21 | protected abstract void computeFactorsAt(int n); 22 | 23 | public double evaluateIteration(){ 24 | computeFactorsAt(getIterations()); 25 | denominator = 1/limitedSmallValue(factors[0]*denominator+factors[1]); 26 | numerator = limitedSmallValue(factors[0]/numerator+factors[1]); 27 | double delta = numerator * denominator; 28 | result *=delta; 29 | return Math.abs(delta-1); 30 | } 31 | 32 | public double getResult(){ return result; } 33 | 34 | public void initializeIterations(){ 35 | numerator = limitedSmallValue(initialValue()); 36 | denominator = 0; 37 | result = numerator; 38 | return; 39 | } 40 | 41 | protected abstract double initialValue(); 42 | 43 | private double limitedSmallValue(double r){ 44 | return Math.abs(r) 13 | * This module, both source code and documentation, is in the 14 | * Public Domain, and comes with NO WARRANTY. 15 | * See http://www.saxproject.org 16 | * for further information. 17 | * 18 | * 19 | *

An XMLReader will throw this exception when it recognizes a 20 | * feature or property identifier, but cannot perform the requested 21 | * operation (setting a state or value). Other SAX2 applications and 22 | * extensions may use this class for similar purposes.

23 | * 24 | * @since SAX 2.0 25 | * @author David Megginson 26 | * @version 2.0.1 (sax2r2) 27 | * @see org.xml.sax.SAXNotRecognizedException 28 | */ 29 | public class SAXNotSupportedException extends SAXException 30 | { 31 | 32 | /** 33 | * Construct a new exception with no message. 34 | */ 35 | public SAXNotSupportedException () 36 | { 37 | super(); 38 | } 39 | 40 | 41 | /** 42 | * Construct a new exception with the given message. 43 | * 44 | * @param message The text message of the exception. 45 | */ 46 | public SAXNotSupportedException (String message) 47 | { 48 | super(message); 49 | } 50 | 51 | } 52 | 53 | // end of SAXNotSupportedException.java 54 | -------------------------------------------------------------------------------- /src/jebl/evolution/align/MaximalSegmentPair.java: -------------------------------------------------------------------------------- 1 | package jebl.evolution.align; 2 | 3 | import jebl.evolution.align.scores.Scores; 4 | 5 | /** 6 | * @author Alexei Drummond 7 | * 8 | * @version $Id: MaximalSegmentPair.java 185 2006-01-23 23:03:18Z rambaut $ 9 | */ 10 | public class MaximalSegmentPair extends AlignSimple { 11 | 12 | public MaximalSegmentPair(Scores sub) { 13 | super(sub, Integer.MAX_VALUE); 14 | } 15 | 16 | /** 17 | * @param sq1 18 | * @param sq2 19 | */ 20 | public final void doAlignment(String sq1, String sq2) { 21 | 22 | super.prepareAlignment(sq1, sq2); 23 | 24 | int n = this.n, m = this.m; 25 | float[][] score = sub.score; 26 | int maxi = n, maxj = m; 27 | float maxval = Float.NEGATIVE_INFINITY; 28 | float val; 29 | for (int i=1; i<=n; i++) { 30 | for (int j=1; j<=m; j++) { 31 | float s = score[seq1.charAt(i-1)][seq2.charAt(j-1)]; 32 | val = max(0.0f, F[i-1][j-1]+s); 33 | F[i][j] = val; 34 | if (val == 0.0f) { 35 | B[i][j].setTraceback(-1,-1); 36 | } else { 37 | B[i][j].setTraceback(i-1, j-1); 38 | } 39 | if (val > maxval) { 40 | maxval = val; 41 | maxi = i; maxj = j; 42 | } 43 | } 44 | } 45 | B0 = new TracebackSimple(maxi, maxj); 46 | } 47 | 48 | public final Traceback next(Traceback tb) { 49 | 50 | Traceback next = super.next(tb); 51 | if (next != null) { 52 | if (next.i - tb.i != next.j - tb.j) return null; 53 | } 54 | return next; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/org/virion/jam/controlpanels/Controls.java: -------------------------------------------------------------------------------- 1 | package org.virion.jam.controlpanels; 2 | 3 | import javax.swing.*; 4 | 5 | /** 6 | * @author Andrew Rambaut 7 | * @version $Id: Controls.java 276 2006-03-23 00:37:40Z pepster $ 8 | */ 9 | public class Controls { 10 | 11 | 12 | public Controls(String title, JPanel panel, boolean isVisible) { 13 | this(title, panel, isVisible, false, null); 14 | } 15 | 16 | /** 17 | * @param title 18 | * @param panel 19 | * @param isVisible 20 | * @param isPinned 21 | * @param primaryCheckbox the "main" on/off toggle, if any. 22 | */ 23 | public Controls(String title, JPanel panel, boolean isVisible, boolean isPinned, JCheckBox primaryCheckbox) { 24 | this.title = title; 25 | this.panel = panel; 26 | this.isVisible = isVisible; 27 | this.isPinned = isPinned; 28 | this.primaryCheckbox = primaryCheckbox; 29 | } 30 | 31 | public String getTitle() { 32 | return title; 33 | } 34 | 35 | public JPanel getPanel() { 36 | return panel; 37 | } 38 | 39 | public boolean isVisible() { 40 | return isVisible; 41 | } 42 | 43 | public void setVisible(boolean visible) { 44 | isVisible = visible; 45 | } 46 | 47 | public boolean isPinned() { 48 | return isPinned; 49 | } 50 | 51 | public void setPinned(boolean pinned) { 52 | isPinned = pinned; 53 | } 54 | 55 | public JCheckBox getPrimaryCheckbox() { 56 | return primaryCheckbox; 57 | } 58 | 59 | private String title; 60 | private JPanel panel; 61 | private JCheckBox primaryCheckbox; 62 | private boolean isVisible; 63 | 64 | private boolean isPinned; 65 | } 66 | -------------------------------------------------------------------------------- /src/org/virion/jam/framework/DefaultEditMenuFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Biomatters LTD. All Rights Reserved. 3 | */ 4 | package org.virion.jam.framework; 5 | 6 | import javax.swing.*; 7 | import java.awt.event.KeyEvent; 8 | 9 | /** 10 | * @author rambaut 11 | * Date: Dec 26, 2004 12 | * Time: 11:01:40 AM 13 | * 14 | * @version $Id: DefaultEditMenuFactory.java 183 2006-01-23 21:29:48Z rambaut $ 15 | */ 16 | public class DefaultEditMenuFactory implements MenuFactory { 17 | public String getMenuName() { 18 | return "Edit"; 19 | } 20 | 21 | public void populateMenu(JMenu menu, AbstractFrame frame) { 22 | 23 | JMenuItem item; 24 | 25 | menu.setMnemonic('E'); 26 | 27 | item = new JMenuItem(frame.getCutAction()); 28 | item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, MenuBarFactory.MENU_MASK)); 29 | menu.add(item); 30 | 31 | item = new JMenuItem(frame.getCopyAction()); 32 | item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, MenuBarFactory.MENU_MASK)); 33 | menu.add(item); 34 | 35 | item = new JMenuItem(frame.getPasteAction()); 36 | item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, MenuBarFactory.MENU_MASK)); 37 | menu.add(item); 38 | 39 | item = new JMenuItem(frame.getDeleteAction()); 40 | menu.add(item); 41 | 42 | item = new JMenuItem(frame.getSelectAllAction()); 43 | item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_A, MenuBarFactory.MENU_MASK)); 44 | menu.add(item); 45 | 46 | menu.addSeparator(); 47 | 48 | item = new JMenuItem(frame.getFindAction()); 49 | item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F, MenuBarFactory.MENU_MASK)); 50 | menu.add(item); 51 | 52 | } 53 | 54 | public int getPreferredAlignment() { 55 | return LEFT; 56 | } 57 | } 58 | --------------------------------------------------------------------------------