/* Jalview - a java multiple alignment editor * Copyright (C) 1998 Michele Clamp * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ package jalview.io; import jalview.datamodel.*; import java.io.*; import java.util.*; import java.net.*; import java.awt.Font; public class BLCFile extends AlignFile { Vector titles; public BLCFile() {} public BLCFile(String inStr) { super(inStr); } public void initData() { super.initData(); titles = new Vector(); } public BLCFile(String inFile, String type) throws IOException { super(inFile,type); } public void parse() { boolean idsFound=false; Vector ids = new Vector(); StringBuffer seqstrings []; Vector starts = new Vector(); Vector ends = new Vector(); String line=null; try{ do{ line = nextLine(); // seek end of ids if (line.indexOf("*") > -1) { idsFound=true; break; } if (line.indexOf(">") > -1) { if(line.indexOf(" ")>-1 ) { //>54402046 0 1 137 137: immunog ids.addElement(line.substring(1, line.indexOf(" "))); // remove p Value line = line.substring(line.indexOf(" ") + 1); line = line.trim(); line = line.substring(line.indexOf(" ") + 1); line = line.trim(); starts.addElement(line.substring(0, line.indexOf(" "))); line = line.substring(line.indexOf(" ") + 1); line = line.trim(); ends.addElement(line.substring(0, line.indexOf(" "))); } else { ids.addElement( line.substring(line.indexOf(">") + 1, line.indexOf("/"))); line = line.substring(line.indexOf("/") + 1); starts.addElement(line.substring(0, line.indexOf("-"))); ends.addElement(line.substring(line.indexOf("-")+1)); } } }while(!idsFound); int starCol = line.indexOf("*"); seqstrings = new StringBuffer[ids.size()]; for(int i=0; i" + s[i].getName() + "/" + s[i].getStart() + "-" + s[i].getEnd() + "\n"); if (s[i].getSequence().length() > max) { max = s[i].getSequence().length();} i++; } out.append("* iteration 1\n"); for (int j = 0; j < max; j++) { i=0; while (i < s.length && s[i] != null) { if(s[i].getSequence().length()>j ) out.append(s[i].getSequence().substring(j,j+1)); else out.append("-"); i++; } out.append("\n"); } out.append("*\n"); return out.toString(); } }