X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FStockholmFile.java;h=34ce3bf99db93a2bdc75743c6ef4c5da66361096;hb=caf13e6a9dc82023cd8648420201e5ad60ce0393;hp=2183f2d58f5cbfa18b647cf77b09cd3c4f0df3b9;hpb=506d60f0e188723ddc91c26824b41ac7034df3fe;p=jalview.git diff --git a/src/jalview/io/StockholmFile.java b/src/jalview/io/StockholmFile.java index 2183f2d..34ce3bf 100644 --- a/src/jalview/io/StockholmFile.java +++ b/src/jalview/io/StockholmFile.java @@ -1,20 +1,19 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4) - * Copyright (C) 2008 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6) + * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle * - * 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 file is part of Jalview. * - * 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. + * Jalview 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 3 of the License, or (at your option) any later version. * - * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Jalview 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 Jalview. If not, see . */ /* * This extension was written by Benjamin Schuster-Boeckler at sanger.ac.uk @@ -69,7 +68,7 @@ public class StockholmFile extends AlignFile * be passed at construction time * * @throws IOException - * If there is an error with the input file + * If there is an error with the input file */ public void parse() throws IOException { @@ -99,7 +98,7 @@ public class StockholmFile extends AlignFile } // We define some Regexes here that will be used regularily later - rend = new Regex("\\/\\/"); // Find the end of an alignment + rend = new Regex("^\\s*\\/\\/"); // Find the end of an alignment p = new Regex("(\\S+)\\/(\\d+)\\-(\\d+)"); // split sequence id in // id/from/to s = new Regex("(\\S+)\\s+(\\S*)\\s+(.*)"); // Parses annotation subtype @@ -207,14 +206,14 @@ public class StockholmFile extends AlignFile { char c = byChar[k]; if (!(c == ' ' || c == '_' || c == '-' || c == '.')) // PFAM - // uses - // '.' - // for - // feature - // background + // uses + // '.' + // for + // feature + // background { int new_pos = posmap[k]; // look up nearest seqeunce - // position to this column + // position to this column SequenceFeature feat = new SequenceFeature(type, desc, new_pos, new_pos, 0f, null); @@ -364,8 +363,8 @@ public class StockholmFile extends AlignFile if (x.search(annContent)) { // parse out and create alignment annotation directly. - parseAnnotationRow(annotations, x.stringMatched(1), x - .stringMatched(2)); + parseAnnotationRow(annotations, x.stringMatched(1), + x.stringMatched(2)); } } else if (annType.equals("GR")) @@ -493,7 +492,7 @@ public class StockholmFile extends AlignFile String pos = annots.substring(i, i + 1); Annotation ann; ann = new Annotation(pos, "", ' ', 0f); // 0f is 'valid' null - will not - // be written out + // be written out if (ss) { ann.secondaryStructure = jalview.schemes.ResidueProperties