+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
import jalview.datamodel.AlignedCodonFrame;
import jalview.datamodel.AlignedCodonFrame.SequenceToSequenceMapping;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignedCodonFrame;
import jalview.datamodel.AlignedCodonFrame.SequenceToSequenceMapping;
import jalview.datamodel.Alignment;
import jalview.util.DBRefUtils;
import jalview.util.MapList;
import jalview.ws.SequenceFetcher;
import jalview.util.DBRefUtils;
import jalview.util.MapList;
import jalview.ws.SequenceFetcher;
-import jalview.ws.SequenceFetcherFactory;
-import jalview.ws.params.InvalidArgumentException;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
DBRefEntry ref8 = new DBRefEntry("PFAM", "1", "A123");
// ENSEMBL is a source of either dna or protein sequence data
DBRefEntry ref9 = new DBRefEntry("ENSEMBL", "1", "A123");
DBRefEntry ref8 = new DBRefEntry("PFAM", "1", "A123");
// ENSEMBL is a source of either dna or protein sequence data
DBRefEntry ref9 = new DBRefEntry("ENSEMBL", "1", "A123");
- List<DBRefEntry> refs = Arrays.asList(new DBRefEntry[] { ref1, ref2, ref3, ref4, ref5,
- ref6, ref7, ref8, ref9 });
+ List<DBRefEntry> refs = Arrays
+ .asList(new DBRefEntry[]
+ { ref1, ref2, ref3, ref4, ref5, ref6, ref7, ref8, ref9 });
seq.addDBRef(new DBRefEntry("UNIPROT", "0", "A1234"));
seq.addDBRef(new DBRefEntry("EMBLCDS", "0", "E2347"));
SequenceI seq2 = new Sequence("Seq2", "MGKYQARLSS");
seq.addDBRef(new DBRefEntry("UNIPROT", "0", "A1234"));
seq.addDBRef(new DBRefEntry("EMBLCDS", "0", "E2347"));
SequenceI seq2 = new Sequence("Seq2", "MGKYQARLSS");
* peptide sequence with UNIPROT dbref
*/
SequenceI dna1 = new Sequence("AF039662", "GGGGCAGCACAAGAAC");
* peptide sequence with UNIPROT dbref
*/
SequenceI dna1 = new Sequence("AF039662", "GGGGCAGCACAAGAAC");
- Mapping map = new Mapping(new Sequence("pep2", "MLAVSRG"), new MapList(
- new int[] { 1, 21 }, new int[] { 1, 7 }, 3, 1));
+ Mapping map = new Mapping(new Sequence("pep2", "MLAVSRG"),
+ new MapList(new int[]
+ { 1, 21 }, new int[] { 1, 7 }, 3, 1));
DBRefEntry dbref = new DBRefEntry("UNIPROT", "0", "Q9ZTS2", map);
dna1.addDBRef(dbref);
dna1.addDBRef(new DBRefEntry("EMBL", "0", "AF039662"));
DBRefEntry dbref = new DBRefEntry("UNIPROT", "0", "Q9ZTS2", map);
dna1.addDBRef(dbref);
dna1.addDBRef(new DBRefEntry("EMBL", "0", "AF039662"));
acf = new AlignedCodonFrame();
dbref = new DBRefEntry("UNIPROT", "0", "Q9ZTS2");
found = testee.searchDataset(!dna1.isProtein(), dna1, dbref, result,
acf = new AlignedCodonFrame();
dbref = new DBRefEntry("UNIPROT", "0", "Q9ZTS2");
found = testee.searchDataset(!dna1.isProtein(), dna1, dbref, result,
- acf, false, DBRefUtils.SEARCH_MODE_FULL); // search dataset with a protein xref from a dna
- // sequence to locate the protein product
+ acf, false, DBRefUtils.SEARCH_MODE_FULL); // search dataset with a
+ // protein xref from a dna
+ // sequence to locate the protein product
assertTrue(found);
assertEquals(1, result.size());
assertSame(pep1, result.get(0));
assertTrue(found);
assertEquals(1, result.size());
assertSame(pep1, result.get(0));
acf = new AlignedCodonFrame();
dbref = new DBRefEntry("UNIPROT", "0", "Q9ZTS2");
found = testee.searchDataset(!pep1.isProtein(), pep1, dbref, result,
acf = new AlignedCodonFrame();
dbref = new DBRefEntry("UNIPROT", "0", "Q9ZTS2");
found = testee.searchDataset(!pep1.isProtein(), pep1, dbref, result,
- acf, false, DBRefUtils.SEARCH_MODE_FULL); // search dataset with a protein's direct dbref to
- // locate dna sequences with matching xref
+ acf, false, DBRefUtils.SEARCH_MODE_FULL); // search dataset with a
+ // protein's direct dbref
+ // to
+ // locate dna sequences with matching xref
assertTrue(found);
assertEquals(1, result.size());
assertSame(dna1, result.get(0));
assertTrue(found);
assertEquals(1, result.size());
assertSame(dna1, result.get(0));
- pep1.getDatasetSequence().addDBRef(
- new DBRefEntry("Pfam", "0", "PF00111"));
- pep1.addSequenceFeature(new SequenceFeature("type", "desc", 12, 14, 1f,
- "group"));
+ pep1.getDatasetSequence()
+ .addDBRef(new DBRefEntry("Pfam", "0", "PF00111"));
+ pep1.addSequenceFeature(
+ new SequenceFeature("type", "desc", 12, 14, 1f, "group"));
- pep2.addSequenceFeature(new SequenceFeature("type2", "desc2", 13, 15,
- 12f, "group2"));
+ pep2.addSequenceFeature(
+ new SequenceFeature("type2", "desc2", 13, 15, 12f, "group2"));
MapList mapList = new MapList(new int[] { 1, 24 }, new int[] { 1, 3 },
3, 1);
MapList mapList = new MapList(new int[] { 1, 24 }, new int[] { 1, 3 },
3, 1);
assertEquals(copy.getName(), original.getName());
assertEquals(copy.getStart(), original.getStart());
assertEquals(copy.getEnd(), original.getEnd());
assertEquals(copy.getName(), original.getName());
assertEquals(copy.getStart(), original.getStart());
assertEquals(copy.getEnd(), original.getEnd());
}
/**
* Test for finding 'product' sequences for the case where the selected
* sequence has a dbref with no mapping, triggering a fetch from database
*/
}
/**
* Test for finding 'product' sequences for the case where the selected
* sequence has a dbref with no mapping, triggering a fetch from database
*/
SequenceI dna1 = new Sequence("AF039662", "GGGGCAGCACAAGAAC");
dna1.addDBRef(new DBRefEntry("UNIPROT", "ENA:0", "Q9ZTS2"));
dna1.addDBRef(new DBRefEntry("UNIPROT", "ENA:0", "P30419"));
dna1.addDBRef(new DBRefEntry("UNIPROT", "ENA:0", "P00314"));
final SequenceI pep1 = new Sequence("Q9ZTS2", "MYQLIRSSW");
SequenceI dna1 = new Sequence("AF039662", "GGGGCAGCACAAGAAC");
dna1.addDBRef(new DBRefEntry("UNIPROT", "ENA:0", "Q9ZTS2"));
dna1.addDBRef(new DBRefEntry("UNIPROT", "ENA:0", "P30419"));
dna1.addDBRef(new DBRefEntry("UNIPROT", "ENA:0", "P00314"));
final SequenceI pep1 = new Sequence("Q9ZTS2", "MYQLIRSSW");
- pep1.addDBRef(new DBRefEntry("UNIPROT", "0", "Q9ZTS2"));
+ pep1.addDBRef(new DBRefEntry("UNIPROT", "0", "Q9ZTS2", null, true));
- pep2.addDBRef(new DBRefEntry("UNIPROT", "0", "P00314"));
+ pep2.addDBRef(new DBRefEntry("UNIPROT", "0", "P00314", null, true));
}
/**
* Test for finding 'product' sequences for the case where both gene and
* transcript sequences have dbrefs to Uniprot.
*/
}
/**
* Test for finding 'product' sequences for the case where both gene and
* transcript sequences have dbrefs to Uniprot.
*/
- braf001.addSequenceFeature(new SequenceFeature("CDS", "", 5, 16, 0f,
- null));
+ braf001.addSequenceFeature(
+ new SequenceFeature("CDS", "", 5, 16, 0f, null));
- braf002.addSequenceFeature(new SequenceFeature("CDS", "", 2, 6, 0f,
- null));
- braf002.addSequenceFeature(new SequenceFeature("CDS", "", 9, 15, 0f,
- null));
+ braf002.addSequenceFeature(
+ new SequenceFeature("CDS", "", 2, 6, 0f, null));
+ braf002.addSequenceFeature(
+ new SequenceFeature("CDS", "", 9, 15, 0f, null));
DBRefEntry dbref1 = new DBRefEntry("UNIPROT", "0", "P0CE19");
MapList mapList = new MapList(new int[] { 1, 12 }, new int[] { 1, 4 },
3, 1);
DBRefEntry dbref1 = new DBRefEntry("UNIPROT", "0", "P0CE19");
MapList mapList = new MapList(new int[] { 1, 12 }, new int[] { 1, 4 },
3, 1);
DBRefEntry dbref3 = new DBRefEntry("UNIPROT", "0", "P0CE19");
MapList map2 = new MapList(new int[] { 4, 15 }, new int[] { 1, 4 }, 3,
1);
DBRefEntry dbref3 = new DBRefEntry("UNIPROT", "0", "P0CE19");
MapList map2 = new MapList(new int[] { 4, 15 }, new int[] { 1, 4 }, 3,
1);
x06707.addDBRef(dbref3);
DBRefEntry dbref4 = new DBRefEntry("UNIPROT", "0", "P0CE20");
MapList map3 = new MapList(new int[] { 4, 15 }, new int[] { 1, 4 }, 3,
1);
x06707.addDBRef(dbref3);
DBRefEntry dbref4 = new DBRefEntry("UNIPROT", "0", "P0CE20");
MapList map3 = new MapList(new int[] { 4, 15 }, new int[] { 1, 4 }, 3,
1);
assertSame(p0ce19, j03321.getDBRefs().get(0).getMap().getTo());
assertSame(p0ce20, j03321.getDBRefs().get(1).getMap().getTo());
assertSame(p0ce19, x06707.getDBRefs().get(0).getMap().getTo());
assertSame(p0ce19, j03321.getDBRefs().get(0).getMap().getTo());
assertSame(p0ce20, j03321.getDBRefs().get(1).getMap().getTo());
assertSame(p0ce19, x06707.getDBRefs().get(0).getMap().getTo());
assertFalse(CrossRef.sameSequence(null, seq1));
assertTrue(CrossRef.sameSequence(seq1, new Sequence("seq2", "ABCDEF")));
assertTrue(CrossRef.sameSequence(seq1, new Sequence("seq2", "abcdef")));
assertFalse(CrossRef.sameSequence(null, seq1));
assertTrue(CrossRef.sameSequence(seq1, new Sequence("seq2", "ABCDEF")));
assertTrue(CrossRef.sameSequence(seq1, new Sequence("seq2", "abcdef")));