| 26 | | Set<Xref> src = new HashSet<Xref>(); |
| 27 | | Set<DataSource> dsset = new HashSet<DataSource>(); |
| 28 | | static final Xref RAD51 = new Xref ("YER095W", BioDataSource.ENSEMBL_SCEREVISIAE); |
| 29 | | static final Xref INSR = new Xref ("Hs.705877", BioDataSource.UNIGENE); |
| 30 | | |
| | 26 | private Set<Xref> src = new HashSet<Xref>(); |
| | 27 | private Set<DataSource> dsset = new HashSet<DataSource>(); |
| | 28 | private static final Xref RAD51 = new Xref ("YER095W", BioDataSource.ENSEMBL_SCEREVISIAE); |
| | 29 | private static final Xref INSR = new Xref ("Hs.705877", BioDataSource.UNIGENE); |
| | 30 | |
| | 31 | private static final Xref NUGO = new Xref ("NuGO_eht0320285_at", BioDataSource.AFFY); |
| | 32 | private static final Xref ENSEMBL = new Xref ("ENSG00000026652", BioDataSource.ENSEMBL); |
| | 33 | private static final Xref ENTREZ = new Xref ("56895", BioDataSource.ENTREZ_GENE); |
| | 34 | |
| | 97 | stack.setTransitive(false); |
| | 98 | |
| | 99 | // test the link between NUGO and ENSEMBL that only occurs in text |
| | 100 | Set<Xref> result = stack.mapID(NUGO, null); |
| | 101 | assertTrue(result.contains(ENSEMBL)); |
| | 102 | assertFalse(result.contains(ENTREZ)); |
| | 103 | |
| | 104 | // test the link between ENTREZ and ENSEMBL that only occurs in pgdb |
| | 105 | result = stack.mapID(ENTREZ, null); |
| | 106 | assertFalse(result.contains(NUGO)); |
| | 107 | assertTrue(result.contains(ENSEMBL)); |
| | 108 | |
| | 109 | stack.setTransitive(true); |
| | 110 | |
| | 111 | // test transitive |
| | 112 | result = stack.mapID(NUGO, null); |
| | 113 | assertTrue(result.contains(ENTREZ)); |
| | 114 | assertTrue(result.contains(ENSEMBL)); |
| | 115 | |
| | 116 | // and the other way around |
| | 117 | result = stack.mapID(ENTREZ, null); |
| | 118 | assertTrue(result.contains(NUGO)); |
| | 119 | assertTrue(result.contains(ENSEMBL)); |
| | 120 | |
| | 121 | // map multiple IDs |
| | 122 | Set<Xref> set1 = new HashSet<Xref>(); |
| | 123 | set1.add (ENTREZ); |
| | 124 | Map<Xref, Set<Xref>> result2 = stack.mapID(set1, null); |
| | 125 | assertTrue (result2.get(ENTREZ).contains(NUGO)); |
| | 126 | } |