From 371c9b1f7571fc7cf9deb28d0120ba341d0b7f3d Mon Sep 17 00:00:00 2001 From: jprocter Date: Thu, 31 Mar 2005 09:54:19 +0000 Subject: [PATCH] Added a flag to control if the "/-" field of SequenceI.Name is included in fastA format files. This is used in the Jemboss client. --- src/jalview/io/FastaFile.java | 9 +++++++-- src/jalview/ws/Jemboss.java | 8 ++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/jalview/io/FastaFile.java b/src/jalview/io/FastaFile.java index 9a6e060..586ede6 100755 --- a/src/jalview/io/FastaFile.java +++ b/src/jalview/io/FastaFile.java @@ -98,7 +98,12 @@ public class FastaFile extends AlignFile { public static String print(SequenceI[] s, int len) { return print(s,len,true); } + public static String print(SequenceI[] s, int len,boolean gaps) { + return print(s,len,gaps,true); + } + + public static String print(SequenceI[] s, int len,boolean gaps, boolean displayId) { StringBuffer out = new StringBuffer(); int i = 0; while (i < s.length && s[i] != null) { @@ -108,8 +113,8 @@ public class FastaFile extends AlignFile { } else { seq = AlignSeq.extractGaps("-. ",s[i].getSequence()); } - - out.append(">" + s[i].getName() + "/" + s[i].getStart() + "-" + s[i].getEnd() + "\n"); + // used to always put this here: + "/" + s[i].getStart() + "-" + s[i].getEnd() + + out.append(">" + ((displayId) ? s[i].getDisplayId() : s[i].getName())+"\n"); int nochunks = seq.length() / len + 1; diff --git a/src/jalview/ws/Jemboss.java b/src/jalview/ws/Jemboss.java index 336be27..a8bf163 100755 --- a/src/jalview/ws/Jemboss.java +++ b/src/jalview/ws/Jemboss.java @@ -134,12 +134,12 @@ public class Jemboss for (int i=0; i