X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FPileUpfile.java;h=a1ba8d9f7aaf0d17194b1f239160b0451d3cc4cf;hb=db93a1adcbe0a4eaaf06e0a70ade0d6c5c1961c3;hp=39f367b4f7f112af406238eebb5a07bb522e2601;hpb=2bd43f464e725844b02a106c2d2f187c2c3655a6;p=jalview.git diff --git a/src/jalview/io/PileUpfile.java b/src/jalview/io/PileUpfile.java index 39f367b..a1ba8d9 100755 --- a/src/jalview/io/PileUpfile.java +++ b/src/jalview/io/PileUpfile.java @@ -1,19 +1,22 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8) - * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b2) + * Copyright (C) 2015 The Jalview Authors * * This file is part of Jalview. * * 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. + * as published by the Free Software Foundation, either version 3 + * of the License, or (at your option) any later version. * * 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 . + * You should have received a copy of the GNU General Public License + * along with Jalview. If not, see . + * The Jalview Authors are detailed in the 'AUTHORS' file. */ package jalview.io; @@ -32,10 +35,10 @@ package jalview.io; * found in Emboss (thanks David Martin!) * */ -import java.io.*; +import jalview.datamodel.SequenceI; +import jalview.util.Format; -import jalview.datamodel.*; -import jalview.util.*; +import java.io.IOException; public class PileUpfile extends MSFfile { @@ -57,7 +60,6 @@ public class PileUpfile extends MSFfile * * @throws IOException * DOCUMENT ME! - */ public PileUpfile(String inFile, String type) throws IOException { @@ -74,11 +76,13 @@ public class PileUpfile extends MSFfile * * @return DOCUMENT ME! */ + @Override public String print() { return print(getSeqsAsArray()); } + @Override public String print(SequenceI[] s) { StringBuffer out = new StringBuffer("PileUp"); @@ -139,12 +143,7 @@ public class PileUpfile extends MSFfile int len = 50; - int nochunks = (max / len) + 1; - - if ((max % len) == 0) - { - nochunks--; - } + int nochunks = (max / len) + (max % len > 0 ? 1 : 0); for (i = 0; i < nochunks; i++) {