From 7aa2563168935732ea6d59a3f1c6cd8bf9a4ad61 Mon Sep 17 00:00:00 2001 From: "cmzmasek@gmail.com" Date: Fri, 25 Jan 2013 19:41:39 +0000 Subject: [PATCH] inprogress --- .../src/org/forester/archaeopteryx/Configuration.java | 3 +++ .../java/src/org/forester/archaeopteryx/Constants.java | 4 ++-- .../java/src/org/forester/archaeopteryx/ControlPanel.java | 3 +++ .../java/src/org/forester/archaeopteryx/TreePanel.java | 13 ++++++++----- .../java/src/org/forester/io/writers/SequenceWriter.java | 4 ++-- 5 files changed, 18 insertions(+), 9 deletions(-) diff --git a/forester/java/src/org/forester/archaeopteryx/Configuration.java b/forester/java/src/org/forester/archaeopteryx/Configuration.java index 5d354cc..c563795 100644 --- a/forester/java/src/org/forester/archaeopteryx/Configuration.java +++ b/forester/java/src/org/forester/archaeopteryx/Configuration.java @@ -1448,6 +1448,9 @@ public final class Configuration { else if ( s.equalsIgnoreCase( "sequence_acc" ) ) { setExtDescNodeDataToReturn( NODE_DATA.SEQUENCE_ACC ); } + else if ( s.equalsIgnoreCase( "sequence_mol_seq_fasta" ) ) { + setExtDescNodeDataToReturn( NODE_DATA.SEQUENCE_MOL_SEQ_FASTA ); + } else if ( s.equalsIgnoreCase( "sequence_mol_seq" ) ) { setExtDescNodeDataToReturn( NODE_DATA.SEQUENCE_MOL_SEQ ); } diff --git a/forester/java/src/org/forester/archaeopteryx/Constants.java b/forester/java/src/org/forester/archaeopteryx/Constants.java index 258e926..874cf3d 100644 --- a/forester/java/src/org/forester/archaeopteryx/Constants.java +++ b/forester/java/src/org/forester/archaeopteryx/Constants.java @@ -42,8 +42,8 @@ public final class Constants { public final static boolean __SYNTH_LF = false; // TODO remove me public final static boolean ALLOW_DDBJ_BLAST = false; public final static String PRG_NAME = "Archaeopteryx"; - final static String VERSION = "0.9800"; - final static String PRG_DATE = "130108"; + final static String VERSION = "0.9801"; + final static String PRG_DATE = "130125"; final static String DEFAULT_CONFIGURATION_FILE_NAME = "_aptx_configuration_file"; final static String[] DEFAULT_FONT_CHOICES = { "Verdana", "Tahoma", "Arial", "Helvetica", "Dialog", "Lucida Sans", "SansSerif", "Sans-serif", "Sans" }; diff --git a/forester/java/src/org/forester/archaeopteryx/ControlPanel.java b/forester/java/src/org/forester/archaeopteryx/ControlPanel.java index 0703f63..8c80f0c 100644 --- a/forester/java/src/org/forester/archaeopteryx/ControlPanel.java +++ b/forester/java/src/org/forester/archaeopteryx/ControlPanel.java @@ -1746,6 +1746,9 @@ final class ControlPanel extends JPanel implements ActionListener { case SEQUENCE_MOL_SEQ: s = "Molecular Sequence"; break; + case SEQUENCE_MOL_SEQ_FASTA: + s = "Molecular Sequence (Fasta)"; + break; case SEQUENCE_NAME: s = "Sequence Names"; break; diff --git a/forester/java/src/org/forester/archaeopteryx/TreePanel.java b/forester/java/src/org/forester/archaeopteryx/TreePanel.java index 18128a0..8f8baa4 100644 --- a/forester/java/src/org/forester/archaeopteryx/TreePanel.java +++ b/forester/java/src/org/forester/archaeopteryx/TreePanel.java @@ -3228,6 +3228,8 @@ public final class TreePanel extends JPanel implements ActionListener, MouseWhee return "Sequence Symbols"; case SEQUENCE_MOL_SEQ: return "Molecular Sequences"; + case SEQUENCE_MOL_SEQ_FASTA: + return "Molecular Sequences (Fasta)"; case SEQUENCE_ACC: return "Sequence Accessors"; case TAXONOMY_SCIENTIFIC_NAME: @@ -5062,17 +5064,18 @@ public final class TreePanel extends JPanel implements ActionListener, MouseWhee } break; case SEQUENCE_MOL_SEQ_FASTA: - StringBuilder sb = new StringBuilder(); + final StringBuilder sb = new StringBuilder(); if ( n.getNodeData().isHasSequence() && !ForesterUtil.isEmpty( n.getNodeData().getSequence().getMolecularSequence() ) ) { if ( !ForesterUtil.isEmpty( n.getNodeData().getSequence().getName() ) ) { - sb.append( SequenceWriter.toFasta( n.getNodeData().getSequence().getName(), n.getNodeData().getSequence().getMolecularSequence(), 60 ) ); + sb.append( SequenceWriter.toFasta( n.getNodeData().getSequence().getName(), n.getNodeData() + .getSequence().getMolecularSequence(), 60 ) ); } else { - sb.append( SequenceWriter.toFasta( n.getName(), n.getNodeData().getSequence().getMolecularSequence(), 60 ) ); - + sb.append( SequenceWriter.toFasta( n.getName(), n.getNodeData().getSequence() + .getMolecularSequence(), 60 ) ); } - data.add( sb.toString() + "\n" ); + data.add( sb.toString() ); } break; case SEQUENCE_ACC: diff --git a/forester/java/src/org/forester/io/writers/SequenceWriter.java b/forester/java/src/org/forester/io/writers/SequenceWriter.java index 0477cd2..b8e80d2 100644 --- a/forester/java/src/org/forester/io/writers/SequenceWriter.java +++ b/forester/java/src/org/forester/io/writers/SequenceWriter.java @@ -38,7 +38,7 @@ public class SequenceWriter { } return sb; } - + public static StringBuilder toFasta( final String name, final String mol_seq, final int width ) { final StringBuilder sb = new StringBuilder(); sb.append( ">" ); @@ -49,7 +49,7 @@ public class SequenceWriter { } else { final int lines = mol_seq.length() / width; - final int rest =mol_seq.length() - ( lines * width ); + final int rest = mol_seq.length() - ( lines * width ); for( int i = 0; i < lines; ++i ) { sb.append( mol_seq, i * width, width ); if ( i < ( lines - 1 ) ) { -- 1.7.10.2