3 import static org.testng.AssertJUnit.assertEquals;
4 import static org.testng.AssertJUnit.assertSame;
5 import static org.testng.AssertJUnit.assertTrue;
7 import jalview.api.AlignViewportI;
8 import jalview.datamodel.AlignedCodonFrame;
9 import jalview.datamodel.AlignmentI;
10 import jalview.datamodel.ColumnSelection;
11 import jalview.datamodel.SearchResults;
12 import jalview.datamodel.SearchResults.Match;
13 import jalview.datamodel.Sequence;
14 import jalview.datamodel.SequenceGroup;
15 import jalview.datamodel.SequenceI;
16 import jalview.gui.AlignViewport;
17 import jalview.io.AppletFormatAdapter;
18 import jalview.io.FormatAdapter;
20 import java.awt.Color;
21 import java.io.IOException;
22 import java.util.Arrays;
23 import java.util.Collections;
24 import java.util.HashSet;
25 import java.util.List;
28 import org.testng.annotations.Test;
30 public class MappingUtilsTest
32 private AlignViewportI dnaView;
34 private AlignViewportI proteinView;
37 * Simple test of mapping with no intron involved.
39 @Test(groups = { "Functional" })
40 public void testBuildSearchResults()
42 final Sequence seq1 = new Sequence("Seq1", "C-G-TA-GC");
43 seq1.createDatasetSequence();
45 final Sequence aseq1 = new Sequence("Seq1", "-P-R");
46 aseq1.createDatasetSequence();
49 * Map dna bases 1-6 to protein residues 1-2
51 AlignedCodonFrame acf = new AlignedCodonFrame();
52 MapList map = new MapList(new int[] { 1, 6 }, new int[] { 1, 2 }, 3, 1);
53 acf.addMap(seq1.getDatasetSequence(), aseq1.getDatasetSequence(), map);
54 Set<AlignedCodonFrame> acfList = Collections.singleton(acf);
57 * Check protein residue 1 maps to codon 1-3, 2 to codon 4-6
59 SearchResults sr = MappingUtils.buildSearchResults(aseq1, 1, acfList);
60 assertEquals(1, sr.getResults().size());
61 Match m = sr.getResults().get(0);
62 assertEquals(seq1.getDatasetSequence(), m.getSequence());
63 assertEquals(1, m.getStart());
64 assertEquals(3, m.getEnd());
65 sr = MappingUtils.buildSearchResults(aseq1, 2, acfList);
66 assertEquals(1, sr.getResults().size());
67 m = sr.getResults().get(0);
68 assertEquals(seq1.getDatasetSequence(), m.getSequence());
69 assertEquals(4, m.getStart());
70 assertEquals(6, m.getEnd());
73 * Check inverse mappings, from codons 1-3, 4-6 to protein 1, 2
75 for (int i = 1; i < 7; i++)
77 sr = MappingUtils.buildSearchResults(seq1, i, acfList);
78 assertEquals(1, sr.getResults().size());
79 m = sr.getResults().get(0);
80 assertEquals(aseq1.getDatasetSequence(), m.getSequence());
81 int residue = i > 3 ? 2 : 1;
82 assertEquals(residue, m.getStart());
83 assertEquals(residue, m.getEnd());
88 * Simple test of mapping with introns involved.
90 @Test(groups = { "Functional" })
91 public void testBuildSearchResults_withIntron()
93 final Sequence seq1 = new Sequence("Seq1", "C-G-TAGA-GCAGCTT");
94 seq1.createDatasetSequence();
96 final Sequence aseq1 = new Sequence("Seq1", "-P-R");
97 aseq1.createDatasetSequence();
100 * Map dna bases [2, 4, 5], [7, 9, 11] to protein residues 1 and 2
102 AlignedCodonFrame acf = new AlignedCodonFrame();
103 MapList map = new MapList(new int[] { 2, 2, 4, 5, 7, 7, 9, 9, 11, 11 },
104 new int[] { 1, 2 }, 3, 1);
105 acf.addMap(seq1.getDatasetSequence(), aseq1.getDatasetSequence(), map);
106 Set<AlignedCodonFrame> acfList = Collections.singleton(acf);
109 * Check protein residue 1 maps to [2, 4, 5]
111 SearchResults sr = MappingUtils.buildSearchResults(aseq1, 1, acfList);
112 assertEquals(2, sr.getResults().size());
113 Match m = sr.getResults().get(0);
114 assertEquals(seq1.getDatasetSequence(), m.getSequence());
115 assertEquals(2, m.getStart());
116 assertEquals(2, m.getEnd());
117 m = sr.getResults().get(1);
118 assertEquals(seq1.getDatasetSequence(), m.getSequence());
119 assertEquals(4, m.getStart());
120 assertEquals(5, m.getEnd());
123 * Check protein residue 2 maps to [7, 9, 11]
125 sr = MappingUtils.buildSearchResults(aseq1, 2, acfList);
126 assertEquals(3, sr.getResults().size());
127 m = sr.getResults().get(0);
128 assertEquals(seq1.getDatasetSequence(), m.getSequence());
129 assertEquals(7, m.getStart());
130 assertEquals(7, m.getEnd());
131 m = sr.getResults().get(1);
132 assertEquals(seq1.getDatasetSequence(), m.getSequence());
133 assertEquals(9, m.getStart());
134 assertEquals(9, m.getEnd());
135 m = sr.getResults().get(2);
136 assertEquals(seq1.getDatasetSequence(), m.getSequence());
137 assertEquals(11, m.getStart());
138 assertEquals(11, m.getEnd());
141 * Check inverse mappings, from codons to protein
143 for (int i = 1; i < 14; i++)
145 sr = MappingUtils.buildSearchResults(seq1, i, acfList);
146 int residue = (i == 2 || i == 4 || i == 5) ? 1 : (i == 7 || i == 9
150 assertEquals(0, sr.getResults().size());
153 assertEquals(1, sr.getResults().size());
154 m = sr.getResults().get(0);
155 assertEquals(aseq1.getDatasetSequence(), m.getSequence());
156 assertEquals(residue, m.getStart());
157 assertEquals(residue, m.getEnd());
162 * Test mapping a sequence group made of entire sequences.
164 * @throws IOException
166 @Test(groups = { "Functional" })
167 public void testMapSequenceGroup_sequences() throws IOException
170 * Set up dna and protein Seq1/2/3 with mappings (held on the protein
173 AlignmentI cdna = loadAlignment(">Seq1\nACG\n>Seq2\nTGA\n>Seq3\nTAC\n",
175 cdna.setDataset(null);
176 AlignmentI protein = loadAlignment(">Seq1\nK\n>Seq2\nL\n>Seq3\nQ\n",
178 protein.setDataset(null);
179 AlignedCodonFrame acf = new AlignedCodonFrame();
180 MapList map = new MapList(new int[] { 1, 3 }, new int[] { 1, 1 }, 3, 1);
181 for (int seq = 0; seq < 3; seq++)
183 acf.addMap(cdna.getSequenceAt(seq).getDatasetSequence(), protein
184 .getSequenceAt(seq).getDatasetSequence(), map);
186 Set<AlignedCodonFrame> acfList = Collections.singleton(acf);
188 AlignViewportI dnaView = new AlignViewport(cdna);
189 AlignViewportI proteinView = new AlignViewport(protein);
190 protein.setCodonFrames(acfList);
193 * Select Seq1 and Seq3 in the protein (startRes=endRes=0)
195 SequenceGroup sg = new SequenceGroup();
196 sg.setColourText(true);
197 sg.setIdColour(Color.GREEN);
198 sg.setOutlineColour(Color.LIGHT_GRAY);
199 sg.addSequence(protein.getSequenceAt(0), false);
200 sg.addSequence(protein.getSequenceAt(2), false);
203 * Verify the mapped sequence group in dna
205 SequenceGroup mappedGroup = MappingUtils.mapSequenceGroup(sg,
206 proteinView, dnaView);
207 assertTrue(mappedGroup.getColourText());
208 assertSame(sg.getIdColour(), mappedGroup.getIdColour());
209 assertSame(sg.getOutlineColour(), mappedGroup.getOutlineColour());
210 assertEquals(2, mappedGroup.getSequences().size());
211 assertSame(cdna.getSequenceAt(0), mappedGroup.getSequences().get(0));
212 assertSame(cdna.getSequenceAt(2), mappedGroup.getSequences().get(1));
213 assertEquals(0, mappedGroup.getStartRes());
214 assertEquals(2, mappedGroup.getEndRes());
217 * Verify mapping sequence group from dna to protein
220 sg.addSequence(cdna.getSequenceAt(1), false);
221 sg.addSequence(cdna.getSequenceAt(0), false);
224 mappedGroup = MappingUtils.mapSequenceGroup(sg, dnaView, proteinView);
225 assertTrue(mappedGroup.getColourText());
226 assertSame(sg.getIdColour(), mappedGroup.getIdColour());
227 assertSame(sg.getOutlineColour(), mappedGroup.getOutlineColour());
228 assertEquals(2, mappedGroup.getSequences().size());
229 assertSame(protein.getSequenceAt(1), mappedGroup.getSequences().get(0));
230 assertSame(protein.getSequenceAt(0), mappedGroup.getSequences().get(1));
231 assertEquals(0, mappedGroup.getStartRes());
232 assertEquals(0, mappedGroup.getEndRes());
236 * Helper method to load an alignment and ensure dataset sequences are set up.
242 * @throws IOException
244 protected AlignmentI loadAlignment(final String data, String format)
247 AlignmentI a = new FormatAdapter().readFile(data,
248 AppletFormatAdapter.PASTE, format);
254 * Test mapping a column selection in protein to its dna equivalent
256 * @throws IOException
258 @Test(groups = { "Functional" })
259 public void testMapColumnSelection_proteinToDna() throws IOException
261 setupMappedAlignments();
263 ColumnSelection colsel = new ColumnSelection();
266 * Column 0 in protein picks up Seq2/L, Seq3/G which map to cols 0-4 and 0-3
267 * in dna respectively, overall 0-4
269 colsel.addElement(0);
270 ColumnSelection cs = MappingUtils.mapColumnSelection(colsel,
271 proteinView, dnaView);
272 assertEquals("[0, 1, 2, 3, 4]", cs.getSelected().toString());
275 * Column 1 in protein picks up Seq1/K which maps to cols 0-3 in dna
278 colsel.addElement(1);
279 cs = MappingUtils.mapColumnSelection(colsel, proteinView, dnaView);
280 assertEquals("[0, 1, 2, 3]", cs.getSelected().toString());
283 * Column 2 in protein picks up gaps only - no mapping
286 colsel.addElement(2);
287 cs = MappingUtils.mapColumnSelection(colsel, proteinView, dnaView);
288 assertEquals("[]", cs.getSelected().toString());
291 * Column 3 in protein picks up Seq1/P, Seq2/Q, Seq3/S which map to columns
292 * 6-9, 6-10, 5-8 respectively, overall to 5-10
295 colsel.addElement(3);
296 cs = MappingUtils.mapColumnSelection(colsel, proteinView, dnaView);
297 assertEquals("[5, 6, 7, 8, 9, 10]", cs.getSelected().toString());
300 * Combine selection of columns 1 and 3 to get a discontiguous mapped
304 colsel.addElement(1);
305 colsel.addElement(3);
306 cs = MappingUtils.mapColumnSelection(colsel, proteinView, dnaView);
307 assertEquals("[0, 1, 2, 3, 5, 6, 7, 8, 9, 10]", cs.getSelected()
312 * @throws IOException
314 protected void setupMappedAlignments() throws IOException
317 * Set up dna and protein Seq1/2/3 with mappings (held on the protein
318 * viewport). Lower case for introns.
320 AlignmentI cdna = loadAlignment(">Seq1\nAC-GctGtC-T\n"
321 + ">Seq2\nTc-GA-G-T-Tc\n" + ">Seq3\nTtTT-AaCGg-\n", "FASTA");
322 cdna.setDataset(null);
323 AlignmentI protein = loadAlignment(
324 ">Seq1\n-K-P\n>Seq2\nL--Q\n>Seq3\nG--S\n", "FASTA");
325 protein.setDataset(null);
326 AlignedCodonFrame acf = new AlignedCodonFrame();
327 MapList map = new MapList(new int[] { 1, 3, 6, 6, 8, 9 }, new int[] {
329 acf.addMap(cdna.getSequenceAt(0).getDatasetSequence(), protein
330 .getSequenceAt(0).getDatasetSequence(), map);
331 map = new MapList(new int[] { 1, 1, 3, 4, 5, 7 }, new int[] { 1, 2 },
333 acf.addMap(cdna.getSequenceAt(1).getDatasetSequence(), protein
334 .getSequenceAt(1).getDatasetSequence(), map);
335 map = new MapList(new int[] { 1, 1, 3, 4, 5, 5, 7, 8 }, new int[] { 1,
337 acf.addMap(cdna.getSequenceAt(2).getDatasetSequence(), protein
338 .getSequenceAt(2).getDatasetSequence(), map);
339 Set<AlignedCodonFrame> acfList = Collections.singleton(acf);
341 dnaView = new AlignViewport(cdna);
342 proteinView = new AlignViewport(protein);
343 protein.setCodonFrames(acfList);
347 * Test mapping a column selection in dna to its protein equivalent
349 * @throws IOException
351 @Test(groups = { "Functional" })
352 public void testMapColumnSelection_dnaToProtein() throws IOException
354 setupMappedAlignments();
356 ColumnSelection colsel = new ColumnSelection();
359 * Column 0 in dna picks up first bases which map to residue 1, columns 0-1
362 colsel.addElement(0);
363 ColumnSelection cs = MappingUtils.mapColumnSelection(colsel, dnaView,
365 assertEquals("[0, 1]", cs.getSelected().toString());
368 * Columns 3-5 in dna map to the first residues in protein Seq1, Seq2, and
369 * the first two in Seq3. Overall to columns 0, 1, 3 (col2 is all gaps).
371 colsel.addElement(3);
372 colsel.addElement(4);
373 colsel.addElement(5);
374 cs = MappingUtils.mapColumnSelection(colsel, dnaView, proteinView);
375 assertEquals("[0, 1, 3]", cs.getSelected().toString());
378 @Test(groups = { "Functional" })
379 public void testMapColumnSelection_null() throws IOException
381 setupMappedAlignments();
382 ColumnSelection cs = MappingUtils.mapColumnSelection(null, dnaView,
384 assertTrue("mapped selection not empty", cs.getSelected().isEmpty());
388 * Tests for the method that converts a series of [start, end] ranges to
391 @Test(groups = { "Functional" })
392 public void testFlattenRanges()
394 assertEquals("[1, 2, 3, 4]",
395 Arrays.toString(MappingUtils.flattenRanges(new int[] { 1, 4 })));
398 Arrays.toString(MappingUtils.flattenRanges(new int[] { 1, 2, 3,
402 Arrays.toString(MappingUtils.flattenRanges(new int[] { 1, 1, 2,
405 "[1, 2, 3, 4, 7, 8, 9, 12]",
406 Arrays.toString(MappingUtils.flattenRanges(new int[] { 1, 4, 7,
408 // unpaired start position is ignored:
410 "[1, 2, 3, 4, 7, 8, 9, 12]",
411 Arrays.toString(MappingUtils.flattenRanges(new int[] { 1, 4, 7,
416 * Test mapping a sequence group made of entire columns.
418 * @throws IOException
420 @Test(groups = { "Functional" })
421 public void testMapSequenceGroup_columns() throws IOException
424 * Set up dna and protein Seq1/2/3 with mappings (held on the protein
427 AlignmentI cdna = loadAlignment(
428 ">Seq1\nACGGCA\n>Seq2\nTGACAG\n>Seq3\nTACGTA\n", "FASTA");
429 cdna.setDataset(null);
430 AlignmentI protein = loadAlignment(">Seq1\nKA\n>Seq2\nLQ\n>Seq3\nQV\n",
432 protein.setDataset(null);
433 AlignedCodonFrame acf = new AlignedCodonFrame();
434 MapList map = new MapList(new int[] { 1, 6 }, new int[] { 1, 2 }, 3, 1);
435 for (int seq = 0; seq < 3; seq++)
437 acf.addMap(cdna.getSequenceAt(seq).getDatasetSequence(), protein
438 .getSequenceAt(seq).getDatasetSequence(), map);
440 Set<AlignedCodonFrame> acfList = Collections.singleton(acf);
442 AlignViewportI dnaView = new AlignViewport(cdna);
443 AlignViewportI proteinView = new AlignViewport(protein);
444 protein.setCodonFrames(acfList);
447 * Select all sequences, column 2 in the protein
449 SequenceGroup sg = new SequenceGroup();
450 sg.setColourText(true);
451 sg.setIdColour(Color.GREEN);
452 sg.setOutlineColour(Color.LIGHT_GRAY);
453 sg.addSequence(protein.getSequenceAt(0), false);
454 sg.addSequence(protein.getSequenceAt(1), false);
455 sg.addSequence(protein.getSequenceAt(2), false);
460 * Verify the mapped sequence group in dna
462 SequenceGroup mappedGroup = MappingUtils.mapSequenceGroup(sg,
463 proteinView, dnaView);
464 assertTrue(mappedGroup.getColourText());
465 assertSame(sg.getIdColour(), mappedGroup.getIdColour());
466 assertSame(sg.getOutlineColour(), mappedGroup.getOutlineColour());
467 assertEquals(3, mappedGroup.getSequences().size());
468 assertSame(cdna.getSequenceAt(0), mappedGroup.getSequences().get(0));
469 assertSame(cdna.getSequenceAt(1), mappedGroup.getSequences().get(1));
470 assertSame(cdna.getSequenceAt(2), mappedGroup.getSequences().get(2));
471 assertEquals(3, mappedGroup.getStartRes());
472 assertEquals(5, mappedGroup.getEndRes());
475 * Verify mapping sequence group from dna to protein
478 sg.addSequence(cdna.getSequenceAt(0), false);
479 sg.addSequence(cdna.getSequenceAt(1), false);
480 sg.addSequence(cdna.getSequenceAt(2), false);
481 // select columns 2 and 3 in DNA which span protein columns 0 and 1
484 mappedGroup = MappingUtils.mapSequenceGroup(sg, dnaView, proteinView);
485 assertTrue(mappedGroup.getColourText());
486 assertSame(sg.getIdColour(), mappedGroup.getIdColour());
487 assertSame(sg.getOutlineColour(), mappedGroup.getOutlineColour());
488 assertEquals(3, mappedGroup.getSequences().size());
489 assertSame(protein.getSequenceAt(0), mappedGroup.getSequences().get(0));
490 assertSame(protein.getSequenceAt(1), mappedGroup.getSequences().get(1));
491 assertSame(protein.getSequenceAt(2), mappedGroup.getSequences().get(2));
492 assertEquals(0, mappedGroup.getStartRes());
493 assertEquals(1, mappedGroup.getEndRes());
497 * Test mapping a sequence group made of a sequences/columns region.
499 * @throws IOException
501 @Test(groups = { "Functional" })
502 public void testMapSequenceGroup_region() throws IOException
505 * Set up gapped dna and protein Seq1/2/3 with mappings (held on the protein
508 AlignmentI cdna = loadAlignment(
509 ">Seq1\nA-CG-GC--AT-CA\n>Seq2\n-TG-AC-AG-T-AT\n>Seq3\n-T--ACG-TAAT-G\n",
511 cdna.setDataset(null);
512 AlignmentI protein = loadAlignment(
513 ">Seq1\n-KA-S\n>Seq2\n--L-QY\n>Seq3\nQ-V-M\n", "FASTA");
514 protein.setDataset(null);
515 AlignedCodonFrame acf = new AlignedCodonFrame();
516 MapList map = new MapList(new int[] { 1, 9 }, new int[] { 1, 3 }, 3, 1);
517 for (int seq = 0; seq < 3; seq++)
519 acf.addMap(cdna.getSequenceAt(seq).getDatasetSequence(), protein
520 .getSequenceAt(seq).getDatasetSequence(), map);
522 Set<AlignedCodonFrame> acfList = Collections.singleton(acf);
524 AlignViewportI dnaView = new AlignViewport(cdna);
525 AlignViewportI proteinView = new AlignViewport(protein);
526 protein.setCodonFrames(acfList);
529 * Select Seq1 and Seq2 in the protein, column 1 (K/-). Expect mapped
530 * sequence group to cover Seq1, columns 0-3 (ACG). Because the selection
531 * only includes a gap in Seq2 there is no mappable selection region in the
534 SequenceGroup sg = new SequenceGroup();
535 sg.setColourText(true);
536 sg.setIdColour(Color.GREEN);
537 sg.setOutlineColour(Color.LIGHT_GRAY);
538 sg.addSequence(protein.getSequenceAt(0), false);
539 sg.addSequence(protein.getSequenceAt(1), false);
544 * Verify the mapped sequence group in dna
546 SequenceGroup mappedGroup = MappingUtils.mapSequenceGroup(sg,
547 proteinView, dnaView);
548 assertTrue(mappedGroup.getColourText());
549 assertSame(sg.getIdColour(), mappedGroup.getIdColour());
550 assertSame(sg.getOutlineColour(), mappedGroup.getOutlineColour());
551 assertEquals(1, mappedGroup.getSequences().size());
552 assertSame(cdna.getSequenceAt(0), mappedGroup.getSequences().get(0));
553 // Seq2 in protein has a gap in column 1 - ignored
554 // Seq1 has K which should map to columns 0-3 in Seq1
555 assertEquals(0, mappedGroup.getStartRes());
556 assertEquals(3, mappedGroup.getEndRes());
559 * Now select cols 2-4 in protein. These cover Seq1:AS Seq2:LQ Seq3:VM which
560 * extend over DNA columns 3-12, 1-7, 6-13 respectively, or 1-13 overall.
564 mappedGroup = MappingUtils.mapSequenceGroup(sg, proteinView, dnaView);
565 assertEquals(1, mappedGroup.getStartRes());
566 assertEquals(13, mappedGroup.getEndRes());
569 * Verify mapping sequence group from dna to protein
572 sg.addSequence(cdna.getSequenceAt(0), false);
574 // select columns 4,5 - includes Seq1:codon2 (A) only
577 mappedGroup = MappingUtils.mapSequenceGroup(sg, dnaView, proteinView);
578 assertEquals(2, mappedGroup.getStartRes());
579 assertEquals(2, mappedGroup.getEndRes());
581 // add Seq2 to dna selection cols 4-5 include codons 1 and 2 (LQ)
582 sg.addSequence(cdna.getSequenceAt(1), false);
583 mappedGroup = MappingUtils.mapSequenceGroup(sg, dnaView, proteinView);
584 assertEquals(2, mappedGroup.getStartRes());
585 assertEquals(4, mappedGroup.getEndRes());
587 // add Seq3 to dna selection cols 4-5 include codon 1 (Q)
588 sg.addSequence(cdna.getSequenceAt(2), false);
589 mappedGroup = MappingUtils.mapSequenceGroup(sg, dnaView, proteinView);
590 assertEquals(0, mappedGroup.getStartRes());
591 assertEquals(4, mappedGroup.getEndRes());
594 @Test(groups = { "Functional" })
595 public void testFindMappingsForSequence()
597 SequenceI seq1 = new Sequence("Seq1", "ABC");
598 SequenceI seq2 = new Sequence("Seq2", "ABC");
599 SequenceI seq3 = new Sequence("Seq3", "ABC");
600 SequenceI seq4 = new Sequence("Seq4", "ABC");
601 seq1.createDatasetSequence();
602 seq2.createDatasetSequence();
603 seq3.createDatasetSequence();
604 seq4.createDatasetSequence();
607 * Create mappings from seq1 to seq2, seq2 to seq1, seq3 to seq1
609 AlignedCodonFrame acf1 = new AlignedCodonFrame();
610 MapList map = new MapList(new int[] { 1, 3 }, new int[] { 1, 3 }, 1, 1);
611 acf1.addMap(seq1.getDatasetSequence(), seq2.getDatasetSequence(), map);
612 AlignedCodonFrame acf2 = new AlignedCodonFrame();
613 acf2.addMap(seq2.getDatasetSequence(), seq1.getDatasetSequence(), map);
614 AlignedCodonFrame acf3 = new AlignedCodonFrame();
615 acf3.addMap(seq3.getDatasetSequence(), seq1.getDatasetSequence(), map);
617 Set<AlignedCodonFrame> mappings = new HashSet<AlignedCodonFrame>();
623 * Seq1 has three mappings
625 List<AlignedCodonFrame> result = MappingUtils.findMappingsForSequence(
627 assertEquals(3, result.size());
628 assertTrue(result.contains(acf1));
629 assertTrue(result.contains(acf2));
630 assertTrue(result.contains(acf3));
633 * Seq2 has two mappings
635 result = MappingUtils.findMappingsForSequence(seq2, mappings);
636 assertEquals(2, result.size());
637 assertTrue(result.contains(acf1));
638 assertTrue(result.contains(acf2));
641 * Seq3 has one mapping
643 result = MappingUtils.findMappingsForSequence(seq3, mappings);
644 assertEquals(1, result.size());
645 assertTrue(result.contains(acf3));
648 * Seq4 has no mappings
650 result = MappingUtils.findMappingsForSequence(seq4, mappings);
651 assertEquals(0, result.size());
653 result = MappingUtils.findMappingsForSequence(null, mappings);
654 assertEquals(0, result.size());
656 result = MappingUtils.findMappingsForSequence(seq1, null);
657 assertEquals(0, result.size());
659 result = MappingUtils.findMappingsForSequence(null, null);
660 assertEquals(0, result.size());