X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2FMCview%2FPDBChain.java;h=c1c586a3e4c0dff15e4d31f8f2bd02dead1b924b;hb=506d60f0e188723ddc91c26824b41ac7034df3fe;hp=aa404cce0dda8fc829ecb6fb704447f72e0e5879;hpb=86132ff6e4262123e5c89be4e33500d53265f557;p=jalview.git diff --git a/src/MCview/PDBChain.java b/src/MCview/PDBChain.java index aa404cc..c1c586a 100755 --- a/src/MCview/PDBChain.java +++ b/src/MCview/PDBChain.java @@ -1,17 +1,17 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer - * Copyright (C) 2007 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle - * + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4) + * Copyright (C) 2008 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 @@ -25,6 +25,7 @@ import java.awt.*; import jalview.analysis.*; import jalview.datamodel.*; import jalview.schemes.*; +import jalview.structure.StructureMapping; public class PDBChain { @@ -32,19 +33,33 @@ public class PDBChain * SequenceFeature group for PDB File features added to sequences */ private static final String PDBFILEFEATURE = "PDBFile"; + private static final String IEASTATUS = "IEA:jalview"; + public String id; + public Vector bonds = new Vector(); + public Vector atoms = new Vector(); + public Vector residues = new Vector(); + public int offset; + public Sequence sequence; + public boolean isVisible = true; + public int pdbstart = 0; + public int pdbend = 0; + public int seqstart = 0; + public int seqend = 0; + public String pdbid = ""; + public PDBChain(String pdbid, String id) { this.pdbid = pdbid.toLowerCase(); @@ -57,9 +72,9 @@ public class PDBChain for (int i = 0; i < bonds.size(); i++) { - tmp = tmp + ( (Bond) bonds.elementAt(i)).at1.resName + " " + - ( (Bond) bonds.elementAt(i)).at1.resNumber + " " + offset + - "\n"; + tmp = tmp + ((Bond) bonds.elementAt(i)).at1.resName + " " + + ((Bond) bonds.elementAt(i)).at1.resNumber + " " + offset + + "\n"; } return tmp; @@ -96,15 +111,19 @@ public class PDBChain } /** - * copy over the RESNUM seqfeatures from the internal chain sequence to the mapped sequence + * copy over the RESNUM seqfeatures from the internal chain sequence to the + * mapped sequence + * * @param seq - * @param status The Status of the transferred annotation + * @param status + * The Status of the transferred annotation * @return the features added to sq (or its dataset) */ - public SequenceFeature[] transferRESNUMFeatures(SequenceI seq, String status) + public SequenceFeature[] transferRESNUMFeatures(SequenceI seq, + String status) { SequenceI sq = seq; - while (sq!=null && sq.getDatasetSequence()!=null) + while (sq != null && sq.getDatasetSequence() != null) { sq = sq.getDatasetSequence(); if (sq == sequence) @@ -114,11 +133,10 @@ public class PDBChain } /** * Remove any existing features for this chain if they exist ? - * SequenceFeature[] seqsfeatures=seq.getSequenceFeatures(); - int totfeat=seqsfeatures.length; - // Remove any features for this exact chain ? - for (int i=0; i k) + { + min = k; + } + else if (max < k) + { + max = k; + } + } + } + sq + .addAlignmentAnnotation(new AlignmentAnnotation("PDB.RESNUM", + "PDB Residue Numbering for " + this.pdbid + ":" + + this.id, an, (float) min, (float) max, + AlignmentAnnotation.LINE_GRAPH)); + } + } }