private String id;
private String dbRefType;
+
/**
* set to true to add derived sequence annotations (temp factor read from
* file, or computed secondary structure) to the alignment
sourceDBRef.setSource(DBRefSource.PDB);
sourceDBRef.setStartRes(pdbSequence.getStart());
sourceDBRef.setEndRes(pdbSequence.getEnd());
-
- SequenceI chainseq = pdbSequence.deriveSequence();
- chainseq.setSourceDBRef(sourceDBRef);
- chainseq.addPDBId(entry);
- chainseq.addDBRef(sourceDBRef);
-
+ pdbSequence.setSourceDBRef(sourceDBRef);
+ pdbSequence.addPDBId(entry);
+ pdbSequence.addDBRef(sourceDBRef);
+ SequenceI chainseq = pdbSequence;
seqs.addElement(chainseq);
-
AlignmentAnnotation[] chainannot = chainseq.getAnnotation();
if (chainannot != null && visibleChainAnnotation)
@SuppressWarnings("unchecked")
protected void replaceAndUpdateChains(List<SequenceI> prot,
- AlignmentI al,
- String pep, boolean b)
+ AlignmentI al, String pep, boolean b)
{
List<List<? extends Object>> replaced = AlignSeq
.replaceMatchingSeqsWith(seqs, annotations, prot, al, pep,
}
@SuppressWarnings({ "unchecked", "rawtypes" })
- private void processWithJmolParser(List<SequenceI> prot)
- throws Exception
+ private void processWithJmolParser(List<SequenceI> prot) throws Exception
{
try
{
Class cl = Class.forName("jalview.ext.jmol.JmolParser");
if (cl != null)
{
- final Constructor constructor = cl
-.getConstructor(new Class[] {
+ final Constructor constructor = cl.getConstructor(new Class[] {
boolean.class, boolean.class, boolean.class, FileParse.class });
final Object[] args = new Object[] { visibleChainAnnotation,
predictSecondaryStructure, externalSecondaryStructure,
- new FileParse(getDataName(),
- type) };
+ new FileParse(getDataName(), type) };
StructureViewSettings.setShowSeqFeatures(false);
StructureViewSettings.setVisibleChainAnnotation(false);
import jalview.datamodel.PDBEntry.Type;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Vector;
+import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
sq.setStart(3);
sq.setEnd(4);
+ sq.setDescription("Test sequence description..");
+ sq.setVamsasId("TestVamsasId");
+ sq.setSourceDBRef(new DBRefEntry("PDB", "version0", "1TST"));
+
+ sq.addDBRef(new DBRefEntry("PDB", "version1", "1Tst"));
+ sq.addDBRef(new DBRefEntry("PDB", "version2", "2Tst"));
+ sq.addDBRef(new DBRefEntry("PDB", "version3", "3Tst"));
+ sq.addDBRef(new DBRefEntry("PDB", "version4", "4Tst"));
+
+ sq.addPDBId(new PDBEntry("1PDB", "A", Type.PDB, "filePath/test1"));
+ sq.addPDBId(new PDBEntry("1PDB", "B", Type.PDB, "filePath/test1"));
+ sq.addPDBId(new PDBEntry("2PDB", "A", Type.MMCIF, "filePath/test2"));
+ sq.addPDBId(new PDBEntry("2PDB", "B", Type.MMCIF, "filePath/test2"));
+
+ sq.getDatasetSequence().addDBRef(
+ new DBRefEntry("PDB", "version1", "1Tst"));
+ sq.getDatasetSequence().addDBRef(
+ new DBRefEntry("PDB", "version2", "2Tst"));
+ sq.getDatasetSequence().addDBRef(
+ new DBRefEntry("PDB", "version3", "3Tst"));
+ sq.getDatasetSequence().addDBRef(
+ new DBRefEntry("PDB", "version4", "4Tst"));
+
+ sq.getDatasetSequence().addPDBId(
+ new PDBEntry("1PDB", "A", Type.PDB, "filePath/test1"));
+ sq.getDatasetSequence().addPDBId(
+ new PDBEntry("1PDB", "B", Type.PDB, "filePath/test1"));
+ sq.getDatasetSequence().addPDBId(
+ new PDBEntry("2PDB", "A", Type.MMCIF, "filePath/test2"));
+ sq.getDatasetSequence().addPDBId(
+ new PDBEntry("2PDB", "B", Type.MMCIF, "filePath/test2"));
+
+ ArrayList<Annotation> annotsList = new ArrayList<Annotation>();
+ System.out.println(">>>>>> " + sq.getSequenceAsString().length());
+ annotsList.add(new Annotation("A", "A", 'X', 0.1f));
+ annotsList.add(new Annotation("A", "A", 'X', 0.1f));
+ Annotation[] annots = annotsList.toArray(new Annotation[0]);
+ sq.addAlignmentAnnotation(new AlignmentAnnotation("Test annot",
+ "Test annot description", annots));
+ sq.getDatasetSequence().addAlignmentAnnotation(
+ new AlignmentAnnotation("Test annot", "Test annot description",
+ annots));
+ Assert.assertEquals(sq.getDescription(), "Test sequence description..");
+ Assert.assertEquals(sq.getDBRefs().length, 4);
+ Assert.assertEquals(sq.getAllPDBEntries().size(), 4);
+ Assert.assertNotNull(sq.getAnnotation());
+ Assert.assertEquals(sq.getAnnotation()[0].annotations.length, 2);
+ Assert.assertEquals(sq.getDatasetSequence().getDBRefs().length, 4);
+ Assert.assertEquals(sq.getDatasetSequence().getAllPDBEntries().size(),
+ 4);
+ Assert.assertNotNull(sq.getDatasetSequence().getAnnotation());
+
Sequence derived = (Sequence) sq.deriveSequence();
+
+ Assert.assertEquals(derived.getDescription(),
+ "Test sequence description..");
+ Assert.assertEquals(derived.getDBRefs().length, 4);
+ Assert.assertEquals(derived.getAllPDBEntries().size(), 4);
+ Assert.assertNotNull(derived.getAnnotation());
+ Assert.assertEquals(derived.getAnnotation()[0].annotations.length, 2);
+ Assert.assertEquals(derived.getDatasetSequence().getDBRefs().length, 4);
+ Assert.assertEquals(derived.getDatasetSequence().getAllPDBEntries()
+ .size(), 4);
+ Assert.assertNotNull(derived.getDatasetSequence().getAnnotation());
+
assertEquals("CD", derived.getSequenceAsString());
assertSame(sq.getDatasetSequence(), derived.getDatasetSequence());