if (protocol.equals(jalview.io.AppletFormatAdapter.PASTE))
{
- pdbentry.setFile("INLINE" + pdb.id);
+ pdbentry.setFile("INLINE" + pdb.getId());
}
} catch (Exception ex)
return;
}
- pdbentry.setId(pdb.id);
+ pdbentry.setId(pdb.getId());
ssm.addStructureViewerListener(this);
// JUST DEAL WITH ONE SEQUENCE FOR NOW
SequenceI sequence = seq[0];
- for (int i = 0; i < pdb.chains.size(); i++)
+ for (int i = 0; i < pdb.getChains().size(); i++)
{
mappingDetails.append("\n\nPDB Sequence is :\nSequence = "
- + pdb.chains.elementAt(i).sequence.getSequenceAsString());
+ + pdb.getChains().elementAt(i).sequence.getSequenceAsString());
mappingDetails.append("\nNo of residues = "
- + pdb.chains.elementAt(i).residues.size() + "\n\n");
+ + pdb.getChains().elementAt(i).residues.size() + "\n\n");
// Now lets compare the sequences to get
// the start and end points.
// Align the sequence to the pdb
// TODO: DNa/Pep switch
AlignSeq as = new AlignSeq(sequence,
- pdb.chains.elementAt(i).sequence,
- pdb.chains.elementAt(i).isNa ? AlignSeq.DNA : AlignSeq.PEP);
+ pdb.getChains().elementAt(i).sequence,
+ pdb.getChains().elementAt(i).isNa ? AlignSeq.DNA : AlignSeq.PEP);
as.calcScoreMatrix();
as.traceAlignment();
PrintStream ps = new PrintStream(System.out)
mappingDetails.append("\nSEQ start/end " + seqstart + " " + seqend);
}
- mainchain = pdb.chains.elementAt(maxchain);
+ mainchain = pdb.getChains().elementAt(maxchain);
mainchain.pdbstart = pdbstart;
mainchain.pdbend = pdbend;
// Sort the bonds by z coord
visiblebonds = new Vector<Bond>();
- for (int ii = 0; ii < pdb.chains.size(); ii++)
+ for (int ii = 0; ii < pdb.getChains().size(); ii++)
{
- if (pdb.chains.elementAt(ii).isVisible)
+ if (pdb.getChains().elementAt(ii).isVisible)
{
- Vector<Bond> tmp = pdb.chains.elementAt(ii).bonds;
+ Vector<Bond> tmp = pdb.getChains().elementAt(ii).bonds;
for (int i = 0; i < tmp.size(); i++)
{
min[1] = (float) 1e30;
min[2] = (float) 1e30;
- for (int ii = 0; ii < pdb.chains.size(); ii++)
+ for (int ii = 0; ii < pdb.getChains().size(); ii++)
{
- if (pdb.chains.elementAt(ii).isVisible)
+ if (pdb.getChains().elementAt(ii).isVisible)
{
- Vector<Bond> bonds = pdb.chains.elementAt(ii).bonds;
+ Vector<Bond> bonds = pdb.getChains().elementAt(ii).bonds;
for (Bond tmp : bonds)
{
int bsize = 0;
// Find centre coordinate
- for (int ii = 0; ii < pdb.chains.size(); ii++)
+ for (int ii = 0; ii < pdb.getChains().size(); ii++)
{
- if (pdb.chains.elementAt(ii).isVisible)
+ if (pdb.getChains().elementAt(ii).isVisible)
{
- Vector<Bond> bonds = pdb.chains.elementAt(ii).bonds;
+ Vector<Bond> bonds = pdb.getChains().elementAt(ii).bonds;
bsize += bonds.size();
PDBChain chain;
if (bysequence && pdb != null)
{
- for (int ii = 0; ii < pdb.chains.size(); ii++)
+ for (int ii = 0; ii < pdb.getChains().size(); ii++)
{
- chain = pdb.chains.elementAt(ii);
+ chain = pdb.getChains().elementAt(ii);
for (int i = 0; i < chain.bonds.size(); i++)
{
repaint();
if (foundchain != -1)
{
- PDBChain chain = pdb.chains.elementAt(foundchain);
+ PDBChain chain = pdb.getChains().elementAt(foundchain);
if (chain == mainchain)
{
if (fatom.alignmentMapping != -1)
PDBChain chain = null;
if (foundchain != -1)
{
- chain = pdb.chains.elementAt(foundchain);
+ chain = pdb.getChains().elementAt(foundchain);
if (chain == mainchain)
{
mouseOverStructure(fatom.resNumber, chain.id);
}
// Alter the bonds
- for (PDBChain chain : pdb.chains)
+ for (PDBChain chain : pdb.getChains())
{
for (Bond tmpBond : chain.bonds)
{
void drawLabels(Graphics g)
{
- for (PDBChain chain : pdb.chains)
+ for (PDBChain chain : pdb.getChains())
{
if (chain.isVisible)
{
foundchain = -1;
- for (int ii = 0; ii < pdb.chains.size(); ii++)
+ for (int ii = 0; ii < pdb.getChains().size(); ii++)
{
- PDBChain chain = pdb.chains.elementAt(ii);
+ PDBChain chain = pdb.getChains().elementAt(ii);
int truex;
Bond tmpBond = null;
if (chain.isVisible)
{
- Vector<Bond> bonds = pdb.chains.elementAt(ii).bonds;
+ Vector<Bond> bonds = pdb.getChains().elementAt(ii).bonds;
for (int i = 0; i < bonds.size(); i++)
{
if (fatom != null) // )&& chain.ds != null)
{
- chain = pdb.chains.elementAt(foundchain);
+ chain = pdb.getChains().elementAt(foundchain);
}
}
public void setAllchainsVisible(boolean b)
{
- for (int ii = 0; ii < pdb.chains.size(); ii++)
+ for (int ii = 0; ii < pdb.getChains().size(); ii++)
{
- PDBChain chain = pdb.chains.elementAt(ii);
+ PDBChain chain = pdb.getChains().elementAt(ii);
chain.isVisible = b;
}
mainchain.isVisible = true;
if (protocol.equals(jalview.io.AppletFormatAdapter.PASTE))
{
- pdbentry.setFile("INLINE" + pdb.id);
+ pdbentry.setFile("INLINE" + pdb.getId());
}
} catch (Exception ex)
errorMessage = "Error loading file: " + pdbentry.getId();
return;
}
- pdbentry.setId(pdb.id);
+ pdbentry.setId(pdb.getId());
ssm.addStructureViewerListener(this);
// JUST DEAL WITH ONE SEQUENCE FOR NOW
SequenceI sequence = seq[0];
- for (int i = 0; i < pdb.chains.size(); i++)
+ for (int i = 0; i < pdb.getChains().size(); i++)
{
mappingDetails.append("\n\nPDB Sequence is :\nSequence = "
- + pdb.chains.elementAt(i).sequence.getSequenceAsString());
+ + pdb.getChains().elementAt(i).sequence.getSequenceAsString());
mappingDetails.append("\nNo of residues = "
- + pdb.chains.elementAt(i).residues.size() + "\n\n");
+ + pdb.getChains().elementAt(i).residues.size() + "\n\n");
// Now lets compare the sequences to get
// the start and end points.
// Align the sequence to the pdb
AlignSeq as = new AlignSeq(sequence,
- pdb.chains.elementAt(i).sequence, "pep");
+ pdb.getChains().elementAt(i).sequence, "pep");
as.calcScoreMatrix();
as.traceAlignment();
PrintStream ps = new PrintStream(System.out)
mappingDetails.append("\nSEQ start/end " + seqstart + " " + seqend);
}
- mainchain = pdb.chains.elementAt(maxchain);
+ mainchain = pdb.getChains().elementAt(maxchain);
mainchain.pdbstart = pdbstart;
mainchain.pdbend = pdbend;
// Sort the bonds by z coord
visiblebonds = new Vector<Bond>();
- for (PDBChain chain : pdb.chains)
+ for (PDBChain chain : pdb.getChains())
{
if (chain.isVisible)
{
min[1] = (float) 1e30;
min[2] = (float) 1e30;
- for (PDBChain chain : pdb.chains)
+ for (PDBChain chain : pdb.getChains())
{
if (chain.isVisible)
{
int bsize = 0;
// Find centre coordinate
- for (PDBChain chain : pdb.chains)
+ for (PDBChain chain : pdb.getChains())
{
if (chain.isVisible)
{
PDBChain chain;
if (bysequence && pdb != null)
{
- for (int ii = 0; ii < pdb.chains.size(); ii++)
+ for (int ii = 0; ii < pdb.getChains().size(); ii++)
{
- chain = pdb.chains.elementAt(ii);
+ chain = pdb.getChains().elementAt(ii);
for (int i = 0; i < chain.bonds.size(); i++)
{
repaint();
if (foundchain != -1)
{
- PDBChain chain = pdb.chains.elementAt(foundchain);
+ PDBChain chain = pdb.getChains().elementAt(foundchain);
if (chain == mainchain)
{
if (fatom.alignmentMapping != -1)
PDBChain chain = null;
if (foundchain != -1)
{
- chain = pdb.chains.elementAt(foundchain);
+ chain = pdb.getChains().elementAt(foundchain);
if (chain == mainchain)
{
mouseOverStructure(fatom.resNumber, chain.id);
}
// Alter the bonds
- for (PDBChain chain : pdb.chains)
+ for (PDBChain chain : pdb.getChains())
{
for (Bond tmpBond : chain.bonds)
{
void drawLabels(Graphics g)
{
- for (PDBChain chain : pdb.chains)
+ for (PDBChain chain : pdb.getChains())
{
if (chain.isVisible)
{
foundchain = -1;
- for (int ii = 0; ii < pdb.chains.size(); ii++)
+ for (int ii = 0; ii < pdb.getChains().size(); ii++)
{
- PDBChain chain = pdb.chains.elementAt(ii);
+ PDBChain chain = pdb.getChains().elementAt(ii);
int truex;
Bond tmpBond = null;
if (fatom != null) // )&& chain.ds != null)
{ // dead code? value of chain is either overwritten or discarded
- chain = pdb.chains.elementAt(foundchain);
+ chain = pdb.getChains().elementAt(foundchain);
}
}
public void setAllchainsVisible(boolean b)
{
- for (int ii = 0; ii < pdb.chains.size(); ii++)
+ for (int ii = 0; ii < pdb.getChains().size(); ii++)
{
- PDBChain chain = pdb.chains.elementAt(ii);
+ PDBChain chain = pdb.getChains().elementAt(ii);
chain.isVisible = b;
}
mainchain.isVisible = true;
// Add inserted residues as features to the base residue
Atom currAtom = resAtoms.get(0);
if (currAtom.insCode != ' '
+ && !residues.isEmpty()
&& residues.lastElement().atoms.get(0).resNumber == currAtom.resNumber)
{
SequenceFeature sf = new SequenceFeature("INSERTION",
Residue tmpres = residues.lastElement();
Atom tmpat = tmpres.atoms.get(0);
// Make A new SequenceFeature for the current residue numbering
- SequenceFeature sf = new SequenceFeature("RES NUM", tmpat.resName
+ SequenceFeature sf = new SequenceFeature("RESNUM", tmpat.resName
+ ":" + tmpat.resNumIns + " " + pdbid + id, "", offset
+ count, offset + count, pdbid);
// MCview.PDBChain.PDBFILEFEATURE);
resFeatures.addElement(sf);
resAnnotation.addElement(new Annotation(tmpat.tfactor));
// Keep totting up the sequence
+
if ((symbol = ResidueProperties.getAA3Hash().get(tmpat.resName)) == null)
{
String nucname = tmpat.resName.trim();
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
-import jalview.datamodel.DBRefEntry;
-import jalview.datamodel.DBRefSource;
-import jalview.datamodel.PDBEntry;
import jalview.datamodel.SequenceI;
import jalview.io.FileParse;
+import jalview.io.StructureFile;
import jalview.util.MessageManager;
-import java.awt.Color;
import java.io.IOException;
import java.lang.reflect.Constructor;
import java.util.ArrayList;
import java.util.List;
import java.util.Vector;
-public class PDBfile extends jalview.io.AlignFile
+public class PDBfile extends StructureFile
{
private static String CALC_ID_PREFIX = "JalviewPDB";
- public Vector<PDBChain> chains;
-
- public String id;
-
- /**
- * set to true to add derived sequence annotations (temp factor read from
- * file, or computed secondary structure) to the alignment
- */
- private boolean visibleChainAnnotation = false;
-
- /*
- * Set true to predict secondary structure (using JMol for protein, Annotate3D
- * for RNA)
- */
- private boolean predictSecondaryStructure = true;
-
- /*
- * Set true (with predictSecondaryStructure=true) to predict secondary
- * structure using an external service (currently Annotate3D for RNA only)
- */
- private boolean externalSecondaryStructure = false;
-
public PDBfile(boolean addAlignmentAnnotations,
boolean predictSecondaryStructure, boolean externalSecStr)
{
public void parse() throws IOException
{
// TODO set the filename sensibly - try using data source name.
- id = safeName(getDataName());
+ setId(safeName(getDataName()));
- chains = new Vector<PDBChain>();
+ setChains(new Vector<PDBChain>());
List<SequenceI> rna = new ArrayList<SequenceI>();
List<SequenceI> prot = new ArrayList<SequenceI>();
PDBChain tmpchain;
}
if (tid.length() > 0)
{
- id = tid;
+ setId(tid);
}
continue;
}
}
Atom tmpatom = new Atom(line);
- tmpchain = findChain(tmpatom.chain);
- if (tmpchain != null)
+ try
{
+ tmpchain = findChain(tmpatom.chain);
if (tmpatom.resNumIns.trim().equals(lastID))
{
// phosphorylated protein - seen both CA and P..
continue;
}
tmpchain.atoms.addElement(tmpatom);
- }
- else
+ } catch (Exception e)
{
- tmpchain = new PDBChain(id, tmpatom.chain);
- chains.addElement(tmpchain);
+ tmpchain = new PDBChain(getId(), tmpatom.chain);
+ getChains().add(tmpchain);
tmpchain.atoms.addElement(tmpatom);
}
lastID = tmpatom.resNumIns.trim();
makeResidueList();
makeCaBondList();
- if (id == null)
+ if (getId() == null)
{
- id = inFile.getName();
+ setId(inFile.getName());
}
- for (PDBChain chain : chains)
+ for (PDBChain chain : getChains())
{
SequenceI chainseq = postProcessChain(chain);
if (isRNA(chainseq))
* @param chain
* @return
*/
- protected SequenceI postProcessChain(PDBChain chain)
- {
- SequenceI pdbSequence = chain.sequence;
- pdbSequence.setName(id + "|" + pdbSequence.getName());
- PDBEntry entry = new PDBEntry();
- entry.setId(id);
- entry.setType(PDBEntry.Type.PDB);
- entry.setProperty(new Hashtable());
- if (chain.id != null)
- {
- // entry.getProperty().put("CHAIN", chains.elementAt(i).id);
- entry.setChainCode(String.valueOf(chain.id));
- }
- if (inFile != null)
- {
- entry.setFile(inFile.getAbsolutePath());
- }
- else
- {
- // TODO: decide if we should dump the datasource to disk
- entry.setFile(getDataName());
- }
-
- DBRefEntry sourceDBRef = new DBRefEntry();
- sourceDBRef.setAccessionId(id);
- sourceDBRef.setSource(DBRefSource.PDB);
- sourceDBRef.setStartRes(pdbSequence.getStart());
- sourceDBRef.setEndRes(pdbSequence.getEnd());
-
- // PDBChain objects maintain reference to dataset
- SequenceI chainseq = pdbSequence.deriveSequence();
- chainseq.setSourceDBRef(sourceDBRef);
- chainseq.addPDBId(entry);
- chainseq.addDBRef(sourceDBRef);
-
- seqs.addElement(chainseq);
-
- AlignmentAnnotation[] chainannot = chainseq.getAnnotation();
-
- if (chainannot != null && visibleChainAnnotation)
- {
- for (int ai = 0; ai < chainannot.length; ai++)
- {
- chainannot[ai].visible = visibleChainAnnotation;
- annotations.addElement(chainannot[ai]);
- }
- }
- return chainseq;
- }
public static boolean isCalcIdHandled(String calcId)
{
oldId = "";
}
aa.setCalcId(CALC_ID_PREFIX);
- aa.setProperty("PDBID", id);
+ aa.setProperty("PDBID", getId());
aa.setProperty("oldCalcId", oldId);
}
}
{
try
{
+
Class cl = Class.forName("jalview.ext.jmol.JmolParser");
if (cl != null)
{
{
}
}
-
- private void replaceAndUpdateChains(List<SequenceI> prot, AlignmentI al,
- String pep, boolean b)
- {
- List<List<? extends Object>> replaced = AlignSeq
- .replaceMatchingSeqsWith(seqs, annotations, prot, al, pep,
- false);
- for (PDBChain ch : chains)
- {
- int p = 0;
- for (SequenceI sq : (List<SequenceI>) replaced.get(0))
- {
- p++;
- if (sq == ch.sequence || sq.getDatasetSequence() == ch.sequence)
- {
- p = -p;
- break;
- }
- }
- if (p < 0)
- {
- p = -p - 1;
- // set shadow entry for chains
- ch.shadow = (SequenceI) replaced.get(1).get(p);
- ch.shadowMap = ((AlignSeq) replaced.get(2).get(p))
- .getMappingFromS1(false);
- }
- }
- }
-
- private void processPdbFileWithAnnotate3d(List<SequenceI> rna)
- throws Exception
- {
- // System.out.println("this is a PDB format and RNA sequence");
- // note: we use reflection here so that the applet can compile and run
- // without the HTTPClient bits and pieces needed for accessing Annotate3D
- // web service
- try
- {
- Class cl = Class.forName("jalview.ws.jws1.Annotate3D");
- if (cl != null)
- {
- // TODO: use the PDB ID of the structure if one is available, to save
- // bandwidth and avoid uploading the whole structure to the service
- Object annotate3d = cl.getConstructor(new Class[] {}).newInstance(
- new Object[] {});
- AlignmentI al = ((AlignmentI) cl.getMethod("getRNAMLFor",
- new Class[] { FileParse.class }).invoke(annotate3d,
- new Object[] { new FileParse(getDataName(), type) }));
- for (SequenceI sq : al.getSequences())
- {
- if (sq.getDatasetSequence() != null)
- {
- if (sq.getDatasetSequence().getAllPDBEntries() != null)
- {
- sq.getDatasetSequence().getAllPDBEntries().clear();
- }
- }
- else
- {
- if (sq.getAllPDBEntries() != null)
- {
- sq.getAllPDBEntries().clear();
- }
- }
- }
- replaceAndUpdateChains(rna, al, AlignSeq.DNA, false);
- }
- } catch (ClassNotFoundException x)
- {
- // ignore classnotfounds - occurs in applet
- }
- ;
- }
-
- /**
- * make a friendly ID string.
- *
- * @param dataName
- * @return truncated dataName to after last '/'
- */
- private String safeName(String dataName)
- {
- int p = 0;
- while ((p = dataName.indexOf("/")) > -1 && p < dataName.length())
- {
- dataName = dataName.substring(p + 1);
- }
- return dataName;
- }
-
- public void makeResidueList()
- {
- for (int i = 0; i < chains.size(); i++)
- {
- chains.elementAt(i).makeResidueList(visibleChainAnnotation);
- }
- }
-
- public void makeCaBondList()
- {
- for (int i = 0; i < chains.size(); i++)
- {
- chains.elementAt(i).makeCaBondList();
- }
- }
-
- public PDBChain findChain(String id)
- {
- for (int i = 0; i < chains.size(); i++)
- {
- if (chains.elementAt(i).id.equals(id))
- {
- return chains.elementAt(i);
- }
- }
-
- return null;
- }
-
- public void setChargeColours()
- {
- for (int i = 0; i < chains.size(); i++)
- {
- chains.elementAt(i).setChargeColours();
- }
- }
-
- public void setColours(jalview.schemes.ColourSchemeI cs)
- {
- for (int i = 0; i < chains.size(); i++)
- {
- chains.elementAt(i).setChainColours(cs);
- }
- }
-
- public void setChainColours()
- {
- for (int i = 0; i < chains.size(); i++)
- {
- // divide by zero --> infinity --> 255 ;-)
- chains.elementAt(i).setChainColours(
- Color.getHSBColor(1.0f / i, .4f, 1.0f));
- }
- }
-
- public static boolean isRNA(SequenceI seq)
- {
- for (char c : seq.getSequence())
- {
- if ((c != 'A') && (c != 'C') && (c != 'G') && (c != 'U'))
- {
- return false;
- }
- }
-
- return true;
-
- }
}
{
pdb = getSsm().setMapping(getSequence()[pe], getChains()[pe],
pdbfile, AppletFormatAdapter.PASTE);
- getPdbEntry(modelnum).setFile("INLINE" + pdb.id);
+ getPdbEntry(modelnum).setFile("INLINE" + pdb.getId());
matches = true;
foundEntry = true;
}
if (matches)
{
// add an entry for every chain in the model
- for (int i = 0; i < pdb.chains.size(); i++)
+ for (int i = 0; i < pdb.getChains().size(); i++)
{
- String chid = new String(pdb.id + ":"
- + pdb.chains.elementAt(i).id);
+ String chid = new String(pdb.getId() + ":"
+ + pdb.getChains().elementAt(i).id);
chainFile.put(chid, fileName);
chainNames.addElement(chid);
}
import jalview.datamodel.PDBEntry;
import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceI;
-import jalview.io.AlignFile;
import jalview.io.FileParse;
+import jalview.io.StructureFile;
import jalview.schemes.ResidueProperties;
import jalview.util.Comparison;
import jalview.util.MessageManager;
import java.io.IOException;
import java.util.ArrayList;
-import java.util.Collection;
import java.util.Hashtable;
import java.util.List;
import java.util.Map;
+import java.util.Vector;
import javajs.awt.Dimension;
import org.jmol.modelsetbio.Monomer;
import org.jmol.viewer.Viewer;
+import MCview.Atom;
import MCview.PDBChain;
/**
- * Import and process files with Jmol for file like PDB, mmCIF
+ * Import and process files with Jmol for file like PDB, mmCIF
*
* @author jprocter
*
*/
-public class JmolParser extends AlignFile implements
- JmolStatusListener
+public class JmolParser extends StructureFile implements JmolStatusListener
{
Viewer viewer = null;
- private Collection<PDBChain> chains;
-
- /*
- * Set true to predict secondary structure (using JMol for protein, Annotate3D
- * for RNA)
- */
- private boolean predictSecondaryStructure = true;
-
- public JmolParser(String inFile, String type) throws IOException
+ public JmolParser(boolean addAlignmentAnnotations,
+ boolean predictSecondaryStructure, boolean externalSecStr,
+ String inFile, String type) throws IOException
{
super(inFile, type);
+ this.visibleChainAnnotation = addAlignmentAnnotations;
+ this.predictSecondaryStructure = predictSecondaryStructure;
+ this.externalSecondaryStructure = externalSecStr;
+ }
+
+ public JmolParser(boolean addAlignmentAnnotations,
+ boolean predictSecondaryStructure, boolean externalSecStr,
+ FileParse fp) throws IOException
+ {
+ super(fp);
+ this.visibleChainAnnotation = addAlignmentAnnotations;
+ this.predictSecondaryStructure = predictSecondaryStructure;
+ this.externalSecondaryStructure = externalSecStr;
}
public JmolParser(FileParse fp) throws IOException
super(fp);
}
+ public JmolParser(String inFile, String type) throws IOException
+ {
+ super(inFile, type);
+ }
+
public JmolParser()
{
}
public void parse() throws IOException
{
- chains = new ArrayList<PDBChain>();
+ setChains(new Vector<PDBChain>());
Viewer jmolModel = getJmolData();
jmolModel.openReader(getDataName(), getDataName(), getReader());
waitForScript(jmolModel);
*/
if (jmolModel.ms.mc > 0)
{
- parseBiopolymers(jmolModel.ms);
+ // parseBiopolymer(jmolModel.ms);
+ transformJmolModelToJalview(jmolModel.ms);
}
}
* @param ms
* @throws IOException
*/
- public void parseBiopolymers(ModelSet ms) throws IOException
+ public void parseBiopolymer(ModelSet ms) throws IOException
{
int modelIndex = -1;
for (Model model : ms.am)
{
modelIndex++;
String modelTitle = (String) ms.getInfo(modelIndex, "title");
-
/*
- * Chains can span BioPolymers, so first make a flattened list,
- * and then work out the lengths of chains present
+ * Chains can span BioPolymers, so first make a flattened list, and then
+ * work out the lengths of chains present
*/
List<Monomer> monomers = getMonomers(ms, (BioModel) model);
List<Integer> chainLengths = getChainLengths(monomers);
int from = 0;
for (int length : chainLengths)
{
- buildSequenceFromChain(monomers.subList(from, from + length), modelTitle);
+ buildSequenceFromChain(monomers.subList(from, from + length),
+ modelTitle);
from += length;
}
}
}
+ public void transformJmolModelToJalview(ModelSet ms)
+ {
+ try
+ {
+ String lastID = "";
+ List<SequenceI> rna = new ArrayList<SequenceI>();
+ List<SequenceI> prot = new ArrayList<SequenceI>();
+ PDBChain tmpchain;
+ String pdbId = (String) ms.getInfo(0, "title");
+ setId(pdbId);
+ List<Atom> significantAtoms = convertSignificantAtoms(ms);
+ for (Atom tmpatom : significantAtoms)
+ {
+ try
+ {
+ tmpchain = findChain(tmpatom.chain);
+ if (tmpatom.resNumIns.trim().equals(lastID))
+ {
+ // phosphorylated protein - seen both CA and P..
+ continue;
+ }
+ tmpchain.atoms.addElement(tmpatom);
+ } catch (Exception e)
+ {
+ tmpchain = new PDBChain(pdbId, tmpatom.chain);
+ getChains().add(tmpchain);
+ tmpchain.atoms.addElement(tmpatom);
+ }
+ lastID = tmpatom.resNumIns.trim();
+ }
+ makeResidueList();
+ makeCaBondList();
+
+ if (getId() == null)
+ {
+ setId(inFile.getName());
+ }
+ for (PDBChain chain : getChains())
+ {
+ SequenceI chainseq = postProcessChain(chain);
+ if (isRNA(chainseq))
+ {
+ rna.add(chainseq);
+ }
+ else
+ {
+ prot.add(chainseq);
+ }
+ }
+ } catch (OutOfMemoryError er)
+ {
+ System.out
+ .println("OUT OF MEMORY LOADING TRANSFORMING JMOL MODEL TO JALVIEW MODEL");
+ // throw new IOException(
+ // MessageManager
+ // .getString("exception.outofmemory_loading_pdb_file"));
+ }
+ }
+
+ private List<Atom> convertSignificantAtoms(ModelSet ms)
+ {
+ List<Atom> significantAtoms = new ArrayList<Atom>();
+ for (org.jmol.modelset.Atom atom : ms.at)
+ {
+ if (atom.getAtomName().equalsIgnoreCase("CA")
+ || atom.getAtomName().equalsIgnoreCase("P"))
+ {
+ Atom curAtom = new Atom(atom.x, atom.y, atom.z);
+ curAtom.atomIndex = atom.getIndex();
+ curAtom.chain = atom.getChainIDStr();
+ curAtom.insCode = atom.group.getInsertionCode();
+ curAtom.name = atom.getAtomName();
+ curAtom.number = atom.getAtomNumber();
+ curAtom.resName = atom.getGroup3(true);
+ curAtom.resNumber = atom.getResno();
+ curAtom.occupancy = ms.occupancies != null ? ms.occupancies[atom
+ .getIndex()] : Float.valueOf(atom.getOccupancy100());
+ curAtom.resNumIns = "" + curAtom.resNumber + curAtom.insCode;
+ curAtom.tfactor = 0;
+ curAtom.type = 0;
+ significantAtoms.add(curAtom);
+ }
+ }
+ return significantAtoms;
+ }
+
/**
* Helper method to construct a sequence for one chain and add it to the seqs
* list
* a list of all monomers in the chain
* @param modelTitle
*/
- protected void buildSequenceFromChain(List<Monomer> monomers, String modelTitle)
+ protected void buildSequenceFromChain(List<Monomer> monomers,
+ String modelTitle)
{
final int length = monomers.size();
/*
* construct and add the Jalview sequence
*/
- String seqName = "" + modelTitle + "|"
- + chainId;
+ String seqName = "" + modelTitle + "|" + chainId;
int start = firstResNum;
int end = firstResNum + length - 1;
seqs.add(sq);
- addChainMetaData(sq, monomers, chainId);
-
/*
* add secondary structure predictions (if any)
*/
if (isPredictSecondaryStructure())
{
addSecondaryStructureAnnotation(modelTitle, sq, secstr, secstrcode,
- chainId, firstResNum);
+ chainId, firstResNum);
}
}
- public void addChainMetaData(SequenceI sq, List<Monomer> monomers,
- String chainId)
- {
- for (char res : sq.getSequence())
- {
-
- }
- }
-
/**
* Add a source db ref entry for the given sequence.
*
sq.addDBRef(sourceDBRef);
}
-
/**
* Add a PDBEntry giving the source of PDB data to the sequence
*
seq[pos] = monomer.getGroup1();
/*
- * JAL-1828 replace a modified amino acid with its standard
- * equivalent (e.g. MSE with MET->M) to maximise sequence matching
+ * JAL-1828 replace a modified amino acid with its standard equivalent
+ * (e.g. MSE with MET->M) to maximise sequence matching
*/
replaceNonCanonicalResidue(monomer.getGroup3(), seq, pos);
/*
- * if Jmol has derived a secondary structure prediction for
- * this position, convert it to Jalview equivalent and save it
+ * if Jmol has derived a secondary structure prediction for this position,
+ * convert it to Jalview equivalent and save it
*/
setSecondaryStructure(monomer.getProteinStructureSubType(), pos,
secstr, secstrcode);
* @return
*/
protected void addSecondaryStructureAnnotation(String modelTitle,
- SequenceI sq, char[] secstr, char[] secstrcode,
- String chainId, int firstResNum)
+ SequenceI sq, char[] secstr, char[] secstrcode, String chainId,
+ int firstResNum)
{
char[] seq = sq.getSequence();
boolean ssFound = false;
}
}
-
/**
* Scans the list of Monomers (residue models), inspecting the chain id for
* each, and returns an array whose length is the number of chains, and values
if (group instanceof Monomer)
{
/*
- * ignore alternate residue at same position
- * example: 1ejg has residues A:LEU, B:ILE at RESNUM=25
+ * ignore alternate residue at same position example: 1ejg has
+ * residues A:LEU, B:ILE at RESNUM=25
*/
int resNo = group.getResno();
if (lastResNo != resNo)
this.predictSecondaryStructure = predictSecondaryStructure;
}
- public Collection<PDBChain> getChains()
- {
- return chains;
- }
-
- public void setChains(Collection<PDBChain> chains)
- {
- this.chains = chains;
- }
-
}
// stacktrace already thrown so just return
return null;
}
- if (pdbfile.id == null)
+ if (pdbfile.getId() == null)
{
String reply = null;
}
else
{
- entry.setId(pdbfile.id);
+ entry.setId(pdbfile.getId());
}
entry.setType(PDBEntry.Type.FILE);
boolean isParseWithJMOL = false;
if (isParseWithJMOL)
{
- alignFile = new jalview.ext.jmol.JmolParser(inFile, type);
+ alignFile = new jalview.ext.jmol.JmolParser(annotFromStructure,
+ localSecondaryStruct, serviceSecondaryStruct, inFile,
+ type);
}
else
{
}
else if (format.equals("mmCIF"))
{
- alignFile = new jalview.ext.jmol.JmolParser(inFile, type);
+ alignFile = new jalview.ext.jmol.JmolParser(annotFromStructure,
+ localSecondaryStruct, serviceSecondaryStruct, inFile, type);
}
else if (format.equals("STH"))
{
boolean isParseWithJMOL = false;
if (isParseWithJMOL)
{
- alignFile = new jalview.ext.jmol.JmolParser(source);
+ alignFile = new jalview.ext.jmol.JmolParser(annotFromStructure,
+ localSecondaryStruct, serviceSecondaryStruct, source);
}
else
{
}
else if (format.equals("mmCIF"))
{
- alignFile = new jalview.ext.jmol.JmolParser(source);
+ alignFile = new jalview.ext.jmol.JmolParser(annotFromStructure,
+ localSecondaryStruct, serviceSecondaryStruct, source);
}
else if (format.equals("STH"))
{
--- /dev/null
+package jalview.io;
+
+import jalview.analysis.AlignSeq;
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.DBRefEntry;
+import jalview.datamodel.DBRefSource;
+import jalview.datamodel.PDBEntry;
+import jalview.datamodel.SequenceI;
+
+import java.awt.Color;
+import java.io.IOException;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Vector;
+
+import MCview.PDBChain;
+
+public abstract class StructureFile extends AlignFile
+{
+
+ private String id;
+
+ /**
+ * set to true to add derived sequence annotations (temp factor read from
+ * file, or computed secondary structure) to the alignment
+ */
+ protected boolean visibleChainAnnotation = false;
+
+ /*
+ * Set true to predict secondary structure (using JMol for protein, Annotate3D
+ * for RNA)
+ */
+ protected boolean predictSecondaryStructure = true;
+
+ /*
+ * Set true (with predictSecondaryStructure=true) to predict secondary
+ * structure using an external service (currently Annotate3D for RNA only)
+ */
+ protected boolean externalSecondaryStructure = false;
+
+ private Vector<PDBChain> chains;
+
+ public StructureFile(String inFile, String type) throws IOException
+ {
+ super(inFile, type);
+ }
+
+ public StructureFile(FileParse fp) throws IOException
+ {
+ super(fp);
+ }
+
+ public StructureFile(boolean parseImmediately, String inFile, String type)
+ throws IOException
+ {
+ super(parseImmediately, inFile, type);
+ }
+
+ public StructureFile(boolean a, FileParse fp) throws IOException
+ {
+ super(a, fp);
+ }
+
+ public StructureFile()
+ {
+ }
+
+ protected SequenceI postProcessChain(PDBChain chain)
+ {
+ SequenceI pdbSequence = chain.sequence;
+ pdbSequence.setName(getId() + "|" + pdbSequence.getName());
+ PDBEntry entry = new PDBEntry();
+ entry.setId(getId());
+ entry.setType(PDBEntry.Type.PDB);
+ entry.setProperty(new Hashtable());
+ if (chain.id != null)
+ {
+ entry.setChainCode(String.valueOf(chain.id));
+ }
+ if (inFile != null)
+ {
+ entry.setFile(inFile.getAbsolutePath());
+ }
+ else
+ {
+ entry.setFile(getDataName());
+ }
+
+ DBRefEntry sourceDBRef = new DBRefEntry();
+ sourceDBRef.setAccessionId(getId());
+ sourceDBRef.setSource(DBRefSource.PDB);
+ sourceDBRef.setStartRes(pdbSequence.getStart());
+ sourceDBRef.setEndRes(pdbSequence.getEnd());
+
+ // PDBChain objects maintain reference to dataset
+ SequenceI chainseq = pdbSequence.deriveSequence();
+ chainseq.setSourceDBRef(sourceDBRef);
+ chainseq.addPDBId(entry);
+ chainseq.addDBRef(sourceDBRef);
+
+ seqs.addElement(chainseq);
+
+ AlignmentAnnotation[] chainannot = chainseq.getAnnotation();
+
+ if (chainannot != null && visibleChainAnnotation)
+ {
+ for (int ai = 0; ai < chainannot.length; ai++)
+ {
+ chainannot[ai].visible = visibleChainAnnotation;
+ annotations.addElement(chainannot[ai]);
+ }
+ }
+ return chainseq;
+ }
+
+ protected void processPdbFileWithAnnotate3d(List<SequenceI> rna)
+ throws Exception
+ {
+ // System.out.println("this is a PDB format and RNA sequence");
+ // note: we use reflection here so that the applet can compile and run
+ // without the HTTPClient bits and pieces needed for accessing Annotate3D
+ // web service
+ try
+ {
+ Class cl = Class.forName("jalview.ws.jws1.Annotate3D");
+ if (cl != null)
+ {
+ // TODO: use the PDB ID of the structure if one is available, to save
+ // bandwidth and avoid uploading the whole structure to the service
+ Object annotate3d = cl.getConstructor(new Class[] {}).newInstance(
+ new Object[] {});
+ AlignmentI al = ((AlignmentI) cl.getMethod("getRNAMLFor",
+ new Class[] { FileParse.class }).invoke(annotate3d,
+ new Object[] { new FileParse(getDataName(), type) }));
+ for (SequenceI sq : al.getSequences())
+ {
+ if (sq.getDatasetSequence() != null)
+ {
+ if (sq.getDatasetSequence().getAllPDBEntries() != null)
+ {
+ sq.getDatasetSequence().getAllPDBEntries().clear();
+ }
+ }
+ else
+ {
+ if (sq.getAllPDBEntries() != null)
+ {
+ sq.getAllPDBEntries().clear();
+ }
+ }
+ }
+ replaceAndUpdateChains(rna, al, AlignSeq.DNA, false);
+ }
+ } catch (ClassNotFoundException x)
+ {
+ // ignore classnotfounds - occurs in applet
+ }
+ }
+
+ protected void replaceAndUpdateChains(List<SequenceI> prot,
+ AlignmentI al,
+ String pep, boolean b)
+ {
+ List<List<? extends Object>> replaced = AlignSeq
+ .replaceMatchingSeqsWith(seqs, annotations, prot, al, pep,
+ false);
+ for (PDBChain ch : getChains())
+ {
+ int p = 0;
+ for (SequenceI sq : (List<SequenceI>) replaced.get(0))
+ {
+ p++;
+ if (sq == ch.sequence || sq.getDatasetSequence() == ch.sequence)
+ {
+ p = -p;
+ break;
+ }
+ }
+ if (p < 0)
+ {
+ p = -p - 1;
+ // set shadow entry for chains
+ ch.shadow = (SequenceI) replaced.get(1).get(p);
+ ch.shadowMap = ((AlignSeq) replaced.get(2).get(p))
+ .getMappingFromS1(false);
+ }
+ }
+ }
+
+ public PDBChain findChain(String id) throws Exception
+ {
+ for (PDBChain chain : getChains())
+ {
+ if (chain.id.equalsIgnoreCase(id))
+ {
+ return chain;
+ }
+ }
+ throw new Exception("PDB chain not Found!");
+ }
+
+ public void makeResidueList()
+ {
+ for (PDBChain chain : getChains())
+ {
+ chain.makeResidueList(visibleChainAnnotation);
+ }
+ }
+
+ public void makeCaBondList()
+ {
+ for (PDBChain chain : getChains())
+ {
+ chain.makeCaBondList();
+ }
+ }
+
+ public void setChargeColours()
+ {
+ for (PDBChain chain : getChains())
+ {
+ chain.setChargeColours();
+ }
+ }
+
+ public void setColours(jalview.schemes.ColourSchemeI cs)
+ {
+ for (PDBChain chain : getChains())
+ {
+ chain.setChainColours(cs);
+ }
+ }
+
+ public void setChainColours()
+ {
+ int i = 0;
+ for (PDBChain chain : getChains())
+ {
+ chain.setChainColours(Color.getHSBColor(1.0f / i++, .4f, 1.0f));
+ }
+ }
+
+ public static boolean isRNA(SequenceI seq)
+ {
+ for (char c : seq.getSequence())
+ {
+ if ((c != 'A') && (c != 'C') && (c != 'G') && (c != 'U'))
+ {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * make a friendly ID string.
+ *
+ * @param dataName
+ * @return truncated dataName to after last '/'
+ */
+ protected String safeName(String dataName)
+ {
+ int p = 0;
+ while ((p = dataName.indexOf("/")) > -1 && p < dataName.length())
+ {
+ dataName = dataName.substring(p + 1);
+ }
+ return dataName;
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+
+ public Vector<PDBChain> getChains()
+ {
+ return chains;
+ }
+
+ public void setChains(Vector<PDBChain> chains)
+ {
+ this.chains = chains;
+ }
+}
pdb = new PDBfile(addTempFacAnnot, parseSecStr, secStructServices,
pdbFile, protocol);
- if (pdb.id != null && pdb.id.trim().length() > 0
+ if (pdb.getId() != null && pdb.getId().trim().length() > 0
&& AppletFormatAdapter.FILE.equals(protocol))
{
- registerPDBFile(pdb.id.trim(), pdbFile);
+ registerPDBFile(pdb.getId().trim(), pdbFile);
}
} catch (Exception ex)
{
String maxChainId = " ";
PDBChain maxChain = null;
boolean first = true;
- for (PDBChain chain : pdb.chains)
+ for (PDBChain chain : pdb.getChains())
{
if (targetChainId.length() > 0 && !targetChainId.equals(chain.id)
&& !infChain)
if (protocol.equals(jalview.io.AppletFormatAdapter.PASTE))
{
- pdbFile = "INLINE" + pdb.id;
+ pdbFile = "INLINE" + pdb.getId();
}
ArrayList<StructureMapping> seqToStrucMapping = new ArrayList<StructureMapping>();
}
else
{
- for (PDBChain chain : pdb.chains)
+ for (PDBChain chain : pdb.getChains())
{
StructureMapping mapping = getStructureMapping(seq, pdbFile,
chain.id, pdb, chain, sqmpping, maxAlignseq);
{
StructureMapping curChainMapping = siftsClient
.getSiftsStructureMapping(seq, pdbFile, targetChainId);
+ try
+ {
PDBChain chain = pdb.findChain(targetChainId);
if (chain != null)
{
chain.transferResidueAnnotation(curChainMapping, sqmpping);
}
+ } catch (Exception e)
+ {
+ e.printStackTrace();
+ }
return curChainMapping;
} catch (SiftsException e)
{
} while (index < maxChain.atoms.size());
StructureMapping nwMapping = new StructureMapping(seq, pdbFile,
- pdb.id, maxChainId, mapping, mappingDetails.toString());
+ pdb.getId(), maxChainId, mapping, mappingDetails.toString());
maxChain.transferResidueAnnotation(nwMapping, sqmpping);
return nwMapping;
}
public SiftsClient(PDBfile pdb) throws SiftsException
{
this.pdb = pdb;
- this.pdbId = pdb.id;
+ this.pdbId = pdb.getId();
File siftsFile = getSiftsFile(pdbId);
siftsEntry = parseSIFTs(siftsFile);
}
public SiftsClient(PDBfile pdb, File siftsFile) throws SiftsException
{
this.pdb = pdb;
- this.pdbId = pdb.id;
+ this.pdbId = pdb.getId();
siftsEntry = parseSIFTs(siftsFile);
}
{
currSeqIndex = Integer.valueOf(resNumIndexString
.split("[a-zA-Z]")[0]);
+ continue;
}
if (pdbRefDb != null)
{
void populateAtomPositions(String chainId,
HashMap<Integer, int[]> mapping) throws IllegalArgumentException
{
- PDBChain chain = pdb.findChain(chainId);
- if (chain == null || mapping == null)
- {
- throw new IllegalArgumentException(
- "Chain id or mapping must not be null.");
- }
- for (int[] map : mapping.values())
+ try
{
- if (map[PDB_RES_POS] != UNASSIGNED)
+ PDBChain chain = pdb.findChain(chainId);
+
+ if (chain == null || mapping == null)
{
- map[PDB_ATOM_POS] = getAtomIndex(map[PDB_RES_POS], chain.atoms);
+ throw new IllegalArgumentException(
+ "Chain id or mapping must not be null.");
}
+ for (int[] map : mapping.values())
+ {
+ if (map[PDB_RES_POS] != UNASSIGNED)
+ {
+ map[PDB_ATOM_POS] = getAtomIndex(map[PDB_RES_POS], chain.atoms);
+ }
+ }
+ } catch (Exception e)
+ {
+ e.printStackTrace();
}
}
PDBfile pf = new PDBfile(false, false, false, "examples/3W5V.pdb",
AppletFormatAdapter.FILE);
- assertEquals("3W5V", pf.id);
+ assertEquals("3W5V", pf.getId());
// verify no alignment annotations created
assertNull(getAlignmentAnnotations(pf));
- assertEquals(4, pf.chains.size());
- assertEquals("A", pf.chains.get(0).id);
- assertEquals("B", pf.chains.get(1).id);
- assertEquals("C", pf.chains.get(2).id);
- assertEquals("D", pf.chains.get(3).id);
+ assertEquals(4, pf.getChains().size());
+ assertEquals("A", pf.getChains().get(0).id);
+ assertEquals("B", pf.getChains().get(1).id);
+ assertEquals("C", pf.getChains().get(2).id);
+ assertEquals("D", pf.getChains().get(3).id);
- PDBChain chainA = pf.chains.get(0);
+ PDBChain chainA = pf.getChains().get(0);
assertEquals(0, chainA.seqstart); // not set
assertEquals(0, chainA.seqend); // not set
assertEquals(18, chainA.sequence.getStart());
assertEquals("PDB", pdb.getType());
assertEquals("3W5V", pdb.getId());
- PDBChain chainB = pf.chains.get(1);
+ PDBChain chainB = pf.getChains().get(1);
assertEquals(1, chainB.sequence.getStart());
assertEquals(96, chainB.sequence.getEnd());
assertTrue(chainB.sequence.getSequenceAsString().startsWith("ATYNVK"));
assertTrue(chainB.sequence.getSequenceAsString().endsWith("KEEELT"));
assertEquals("3W5V|B", chainB.sequence.getName());
- PDBChain chainC = pf.chains.get(2);
+ PDBChain chainC = pf.getChains().get(2);
assertEquals(18, chainC.sequence.getStart());
assertEquals(314, chainC.sequence.getEnd());
assertTrue(chainC.sequence.getSequenceAsString().startsWith("KCSKKQEE"));
assertTrue(chainC.sequence.getSequenceAsString().endsWith("WNVEVY"));
assertEquals("3W5V|C", chainC.sequence.getName());
- PDBChain chainD = pf.chains.get(3);
+ PDBChain chainD = pf.getChains().get(3);
assertEquals(1, chainD.sequence.getStart());
assertEquals(96, chainD.sequence.getEnd());
assertTrue(chainD.sequence.getSequenceAsString().startsWith("ATYNVK"));
* no sequence annotations created - tempFactor annotation is not added
* unless the flag to 'addAlignmentAnnotations' is set true
*/
- for (PDBChain c : pf.chains)
+ for (PDBChain c : pf.getChains())
{
assertNull(c.sequence.getAnnotation());
}
* 1GAQ has been reduced to alpha carbons only
* 1QCF is the full PDB file including headers, HETATM etc
*/
- // String[] testFile = new String[] { "./examples/1GAQ.txt",
- // "./test/jalview/ext/jmol/1QCF.pdb" }; // ,
- String[] testFile = new String[] { "./examples/testdata/1qcf.cif" }; // ,
+ String[] testFile = new String[] { "./examples/1GAQ.txt",
+ "./test/jalview/ext/jmol/1QCF.pdb" }; // ,
+ // String[] testFile = new String[] { "./examples/testdata/1qcf.cif" }; // ,
//@formatter:off
// a modified and very cut-down extract of 4UJ4
@Test(groups = { "Functional" })
public void testFileParser() throws Exception
{
+ boolean annotFromStructure = false;
+ boolean localSecondaryStruct = false;
+ boolean serviceSecondaryStruct = false;
for (String pdbStr : testFile)
{
PDBfile mctest = new PDBfile(false, false, false, pdbStr,
AppletFormatAdapter.FILE);
- JmolParser jtest = new JmolParser(pdbStr,
+ JmolParser jtest = new JmolParser(annotFromStructure,
+ localSecondaryStruct, serviceSecondaryStruct, pdbStr,
jalview.io.AppletFormatAdapter.FILE);
Vector<SequenceI> seqs = jtest.getSeqs(), mcseqs = mctest.getSeqs();
{
PDBfile mctest = new PDBfile(false, false, false, pdbWithChainBreak,
AppletFormatAdapter.PASTE);
- JmolParser jtest = new JmolParser(pdbWithChainBreak,
+ boolean annotFromStructure = false;
+ boolean localSecondaryStruct = false;
+ boolean serviceSecondaryStruct = false;
+ JmolParser jtest = new JmolParser(annotFromStructure,
+ localSecondaryStruct, serviceSecondaryStruct,
+ pdbWithChainBreak,
jalview.io.AppletFormatAdapter.PASTE);
Vector<SequenceI> seqs = jtest.getSeqs();
Vector<SequenceI> mcseqs = mctest.getSeqs();
{
PDBfile mctest = new PDBfile(false, false, false, pdbWithAltLoc,
AppletFormatAdapter.PASTE);
- JmolParser jtest = new JmolParser(pdbWithAltLoc,
+ boolean annotFromStructure = false;
+ boolean localSecondaryStruct = false;
+ boolean serviceSecondaryStruct = false;
+ JmolParser jtest = new JmolParser(annotFromStructure,
+ localSecondaryStruct, serviceSecondaryStruct, pdbWithAltLoc,
jalview.io.AppletFormatAdapter.PASTE);
Vector<SequenceI> seqs = jtest.getSeqs();
Vector<SequenceI> mcseqs = mctest.getSeqs();
File testSiftsFile = new File("test/jalview/io/" + testPDBId
+ ".xml.gz");
PDBfile pdbFile = new PDBfile(false, false, false);
- pdbFile.id = testPDBId;
+ pdbFile.setId(testPDBId);
siftsClient = new SiftsClient(pdbFile, testSiftsFile);
}