X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FModellerDescription.java;h=bd0a9007be4cc0426dc7d8612d65a236f7073ea0;hb=e894eb87d40be6e8452d19032ddffe80dad5f804;hp=457a6ae8fe5787558d7a95e18881ea877b289e8f;hpb=69f23b44e8ce05b33fca23ffb3774c285a23dd9b;p=jalview.git diff --git a/src/jalview/io/ModellerDescription.java b/src/jalview/io/ModellerDescription.java index 457a6ae..bd0a900 100755 --- a/src/jalview/io/ModellerDescription.java +++ b/src/jalview/io/ModellerDescription.java @@ -1,8 +1,25 @@ +/* + * Jalview - A Sequence Alignment Editor and Viewer + * Copyright (C) 2006 AM Waterhouse, J Procter, 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 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ package jalview.io; import jalview.datamodel.SequenceI; import java.util.Vector; -import com.stevesoft.pat.Regex; public class ModellerDescription { /** @@ -70,7 +87,7 @@ public class ModellerDescription private resCode validResidueCode(String field) { Integer val = null; - com.stevesoft.pat.Regex r = new Regex("\\s*((([-0-9]+).?)|FIRST|LAST|@)"); + com.stevesoft.pat.Regex r = new com.stevesoft.pat.Regex("\\s*((([-0-9]+).?)|FIRST|LAST|@)"); if (!r.search(field)) { @@ -81,8 +98,8 @@ public class ModellerDescription { value = r.stringMatched(1); } - jalview.bin.Cache.log.debug("from '" + field + "' matched '" + value + - "'"); + // jalview.bin.Cache.log.debug("from '" + field + "' matched '" + value + + // "'"); try { val = Integer.valueOf(value); @@ -107,7 +124,7 @@ public class ModellerDescription field = st.nextToken(":"); do { - if (seqTypes[i].compareToIgnoreCase(field) == 0) + if (seqTypes[i].equalsIgnoreCase(field) ) { break; } @@ -133,8 +150,8 @@ public class ModellerDescription } else { - jalview.bin.Cache.log.debug( - "Ignoring non-Modeller description: invalid integer-like field '" + field + "'"); + // jalview.bin.Cache.log.debug( + // "Ignoring non-Modeller description: invalid integer-like field '" + field + "'"); type = -1; /* invalid field! - throw the FieldSet away */ } ; @@ -225,19 +242,17 @@ public class ModellerDescription if (seq.getDatasetSequence() != null && seq.getDatasetSequence().getDBRef() != null) { - Vector dbr = seq.getDatasetSequence().getDBRef(); + jalview.datamodel.DBRefEntry [] dbr = seq.getDatasetSequence().getDBRef(); int i, j; - for (i = 0, j = dbr.size(); i < j; i++) + for (i = 0, j = dbr.length; i < j; i++) { - jalview.datamodel.DBRefEntry dref = (jalview.datamodel.DBRefEntry) - dbr.get(i); - if (dref != null) + if (dbr[i] != null) { // JBPNote PDB dbRefEntry needs properties to propagate onto ModellerField // JBPNote Need to get info from the user about whether the sequence is the one being modelled, or if it is a template. - if (dref.getSource().equals("PDB")) + if (dbr[i].getSource().equals(jalview.datamodel.DBRefSource.PDB)) { - fields.put(Fields[LOCALID], dref.getAccessionId()); + fields.put(Fields[LOCALID], dbr[i].getAccessionId()); t = 2; break; }