X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fext%2Fjmol%2FPDBFileWithJmol.java;h=3df8957d9c01a47f566ce4f72b2abca926ec3853;hb=3b5fd72d019a6cd71f611b4110651ff6b62ce5bf;hp=159955a8e3327e24c6a682a5725082ba04c33338;hpb=3325395b33ef3b52b4a62327621c5bddf12ee4e0;p=jalview.git diff --git a/src/jalview/ext/jmol/PDBFileWithJmol.java b/src/jalview/ext/jmol/PDBFileWithJmol.java index 159955a..3df8957 100644 --- a/src/jalview/ext/jmol/PDBFileWithJmol.java +++ b/src/jalview/ext/jmol/PDBFileWithJmol.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2) - * Copyright (C) 2014 The Jalview Authors + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ The Jalview Authors * * This file is part of Jalview. * @@ -27,6 +27,7 @@ import jalview.datamodel.Sequence; import jalview.datamodel.SequenceI; import jalview.io.AlignFile; import jalview.io.FileParse; +import jalview.schemes.ResidueProperties; import jalview.util.MessageManager; import java.io.IOException; @@ -153,11 +154,17 @@ public class PDBFileWithJmol extends AlignFile implements { if (len > 0) { + boolean isNa = (biopoly.isDna() || biopoly.isRna()); + // normalise sequence from Jmol to jalview + int[] cinds = isNa ? ResidueProperties.nucleotideIndex : ResidueProperties.aaIndex; + int nonGap = isNa ? ResidueProperties.maxNucleotideIndex + : ResidueProperties.maxProteinIndex; + char ngc = 'X'; char newseq[] = new char[len]; - System.arraycopy(seq, 0, newseq, 0, len); Annotation asecstr[] = new Annotation[len+firstrnum-1]; for (int p = 0; p < len; p++) { + newseq[p] = cinds[seq[p]] == nonGap ? ngc : seq[p]; if (secstr[p] >= 'A' && secstr[p] <= 'z') { asecstr[p] = new Annotation("" + secstr[p], null, @@ -170,18 +177,25 @@ public class PDBFileWithJmol extends AlignFile implements PDBEntry pdbe = new PDBEntry(); pdbe.setFile(getDataName()); pdbe.setId(getDataName()); - sq.addPDBId(pdbe); pdbe.setProperty(new Hashtable()); - pdbe.getProperty().put("CHAIN", "" + _lastChainId); + // pdbe.getProperty().put("CHAIN", "" + _lastChainId); + pdbe.setChainCode(String.valueOf(_lastChainId)); + sq.addPDBId(pdbe); // JAL-1533 // Need to put the number of models for this polymer somewhere for Chimera/others to grab // pdbe.getProperty().put("PDBMODELS", biopoly.) seqs.add(sq); - if (!(biopoly.isDna() || biopoly.isRna())) + if (!isNa) { + String mt = model.getModelTitle() == null ? getDataName() + : model.getModelTitle(); + if (_lastChainId >= ' ') + { + mt += _lastChainId; + } AlignmentAnnotation ann = new AlignmentAnnotation( "Secondary Structure", - "Secondary Structure from PDB File", asecstr); + "Secondary Structure for " + mt, asecstr); ann.belowAlignment=true; ann.visible=true; ann.autoCalculated=false;