X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FEMBLLikeFlatFile.java;fp=src%2Fjalview%2Fio%2FEMBLLikeFlatFile.java;h=f6f53a6994aeecbc4579fe42d7e7f2eac975d43b;hb=9c98d4bd666346f6ad3892c5394b7da3be82d93e;hp=e8ce34b619ed7d926aab5e1cf1fc225160d36398;hpb=c7b2143c9cf7c5e05ad63251f7d3910751b16d20;p=jalview.git diff --git a/src/jalview/io/EMBLLikeFlatFile.java b/src/jalview/io/EMBLLikeFlatFile.java index e8ce34b..f6f53a6 100644 --- a/src/jalview/io/EMBLLikeFlatFile.java +++ b/src/jalview/io/EMBLLikeFlatFile.java @@ -1,3 +1,23 @@ +/* + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ 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. + * + * 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 . + * The Jalview Authors are detailed in the 'AUTHORS' file. + */ package jalview.io; import java.io.IOException; @@ -160,8 +180,7 @@ public abstract class EMBLLikeFlatFile extends AlignFile * when true, interpret the mol_type 'source' feature attribute * and generate an RNA sequence from the DNA record */ - protected boolean produceRna=true; - + protected boolean produceRna = true; /* * values parsed from the data file @@ -178,7 +197,7 @@ public abstract class EMBLLikeFlatFile extends AlignFile protected List dbrefs; - protected boolean sequenceStringIsRNA=false; + protected boolean sequenceStringIsRNA = false; protected String sequenceString; @@ -201,13 +220,14 @@ public abstract class EMBLLikeFlatFile extends AlignFile * using TreeMap gives CDS sequences in alphabetical, so readable, order */ cds = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); - + parse(); } /** - * process attributes for 'source' until the next FT feature entry - * only interested in 'mol_type' + * process attributes for 'source' until the next FT feature entry only + * interested in 'mol_type' + * * @param tokens * @return * @throws IOException @@ -236,7 +256,7 @@ public abstract class EMBLLikeFlatFile extends AlignFile int p = line.indexOf("\\mol_type"); int qs = line.indexOf("\"", p); int qe = line.indexOf("\"", qs + 1); - String qualifier=line.substring(qs,qe).toLowerCase(Locale.ROOT); + String qualifier = line.substring(qs, qe).toLowerCase(Locale.ROOT); if (qualifier.indexOf("rna") > -1) { sequenceStringIsRNA = true; @@ -245,12 +265,11 @@ public abstract class EMBLLikeFlatFile extends AlignFile { sequenceStringIsRNA = false; } - line=parseFeatureQualifier(sb, false); + line = parseFeatureQualifier(sb, false); } return line; } - /** * Parses one (GenBank or EMBL format) CDS feature, saves the parsed data, and * returns the next line @@ -715,8 +734,8 @@ public abstract class EMBLLikeFlatFile extends AlignFile String[] tokens = line.split(WHITESPACE); if (tokens.length < 2) { - Console.error("Ignoring bad EMBL line for " + this.accession - + ": " + line); + Console.error("Ignoring bad EMBL line for " + this.accession + ": " + + line); break; } if (tokens[1].startsWith("/")) @@ -797,7 +816,8 @@ public abstract class EMBLLikeFlatFile extends AlignFile protected String parseFeature(String line) throws IOException { String[] tokens = line.trim().split(WHITESPACE); - if (tokens.length < 2 || (!"CDS".equals(tokens[0]) && (!"source".equals(tokens[0])))) + if (tokens.length < 2 + || (!"CDS".equals(tokens[0]) && (!"source".equals(tokens[0])))) { return nextLine(); }