use of org.nextprot.api.core.domain.ChromosomalLocation in project nextprot-api by calipho-sib.
the class ChromosomalLocationComparatorTest method allChromosomalLocations.
/* Output of SQL query (867) : "select chromosome, band from nextprot.gene_identifiers GROUP BY chromosome, band" */
private static List<ChromosomalLocation> allChromosomalLocations() {
String[] chromosomes = new String[] { "21", "6", "17", "4", "10", "15", "15", "2", "16", "2", "1", "16", "12", "5", "21", "22", "12", "X", "4", "7", "4", "X", "4", "5", "18", "15", "3", "4", "6", "7", "2", "16", "10", "17", "4", "11", "20", "11", "5", "6", "20", "3", "1", "8", "17", "19", "9", "18", "19", "2", "4", "16", "6", "unknown", "12", "5", "17", "12", "22", "6", "16", "8", "19", "12", "7", "12", "16", "18", "17", "4", "6", "22", "3", "11", "7", "unknown", "4", "19", "6", "2", "12", "6", "6", "6", "3", "19", "10", "16", "11", "6", "19", "7", "9", "19", "unknown", "22", "13", "3", "14", "7", "10", "8", "7", "3", "1", "3", "1", "5", "6", "3", "4", "5", "6", "14", "1", "4", "7", "9", "3", "12", "10", "17", "20", "14", "2", "20", "9", "9", "17", "5", "3", "12", "6", "6", "14", "5", "18", "10", "10", "14", "6", "12", "9", "10", "2", "1", "14", "3", "X", "7", "13", "5", "3", "3", "12", "5", "7", "10", "6", "X", "4", "5", "16", "14", "21", "9", "10", "11", "3", "1", "10", "16", "9", "6", "8", "1", "1", "14", "1", "11", "5", "13", "Y", "9", "8", "20", "5", "10", "20", "13", "1", "4", "13", "16", "12", "10", "2", "19", "13", "1", "5", "5", "16", "12", "12", "13", "4", "2", "21", "6", "16", "12", "2", "4", "X", "5", "7", "8", "4", "3", "1", "13", "X", "10", "9", "1", "7", "X", "14", "2", "18", "2", "9", "16", "20", "4", "2", "3", "5", "19", "7", "9", "2", "4", "12", "5", "16", "6", "2", "14", "4", "2", "2", "7", "1", "1", "14", "5", "9", "5", "13", "1", "4", "19", "7", "9", "9", "X", "9", "1", "X", "11", "5", "17", "19", "9", "9", "3", "3", "7", "15", "20", "1", "13", "10", "X", "X", "4", "14", "13", "13", "8", "3", "3", "3", "9", "12", "1", "2", "16", "2", "5", "2", "Y", "8", "12", "3", "8", "2", "15", "1", "21", "2", "15", "1", "1", "4", "12", "3", "15", "13", "X", "5", "20", "2", "X", "7", "9", "7", "5", "1", "8", "13", "13", "18", "2", "5", "3", "12", "1", "X", "21", "14", "1", "7", "6", "2", "1", "1", "6", "6", "14", "3", "7", "X", "15", "14", "18", "9", "7", "2", "X", "2", "4", "2", "4", "2", "4", "6", "15", "14", "5", "2", "7", "10", "2", "11", "2", "5", "16", "8", "4", "10", "5", "6", "11", "1", "21", "3", "Y", "18", "15", "11", "17", "2", "8", "16", "15", "2", "9", "1", "12", "16", "9", "15", "11", "9", "9", "10", "7", "4", "6", "2", "2", "13", "6", "18", "4", "3", "Y", "1", "1", "X", "19", "6", "9", "1", "X", "19", "19", "1", "12", "19", "1", "22", "17", "10", "1", "3", "1", "3", "10", "10", "16", "17", "unknown", "20", "9", "11", "1", "10", "3", "8", "16", "13", "18", "2", "X", "X", "3", "12", "12", "11", "6", "10", "8", "3", "22", "4", "5", "2", "X", "19", "2", "3", "5", "7", "X", "11", "2", "13", "17", "5", "2", "12", "8", "8", "14", "12", "6", "13", "1", "X", "X", "14", "7", "1", "19", "11", "9", "unknown", "4", "8", "1", "9", "3", "3", "8", "14", "7", "X", "2", "17", "13", "3", "3", "X", "12", "12", "22", "7", "7", "12", "1", "17", "17", "3", "6", "21", "2", "8", "1", "2", "12", "17", "8", "10", "1", "10", "19", "10", "1", "4", "1", "7", "22", "6", "2", "19", "10", "10", "9", "22", "3", "7", "5", "10", "12", "3", "1", "2", "19", "17", "5", "10", "21", "7", "10", "15", "9", "3", "6", "7", "4", "5", "3", "15", "9", "12", "3", "1", "6", "8", "17", "10", "6", "19", "8", "15", "12", "3", "8", "14", "11", "2", "2", "11", "1", "15", "15", "4", "1", "8", "17", "20", "10", "9", "3", "7", "6", "6", "11", "4", "7", "16", "2", "1", "11", "12", "2", "3", "X", "2", "5", "20", "3", "17", "22", "6", "9", "6", "Y", "8", "20", "4", "18", "20", "4", "11", "10", "2", "11", "7", "8", "14", "6", "15", "17", "14", "5", "4", "17", "12", "2", "16", "Y", "13", "6", "22", "17", "18", "X", "X", "1", "3", "11", "10", "4", "11", "2", "11", "1", "18", "7", "12", "1", "1", "22", "16", "3", "9", "10", "13", "X", "17", "12", "3", "4", "13", "8", "8", "1", "14", "20", "4", "10", "3", "21", "7", "20", "4", "13", "1", "15", "22", "9", "10", "18", "4", "21", "11", "6", "9", "11", "1", "16", "7", "18", "7", "1", "21", "8", "20", "2", "5", "8", "X", "6", "4", "Y", "2", "11", "14", "16", "17", "1", "20", "11", "6", "X", "4", "9", "21", "3", "8", "6", "18", "13", "X", "4", "11", "9", "15", "18", "X", "2", "17", "18", "20", "5", "10", "17", "5", "14", "22", "4", "12", "9", "5", "3", "15", "15", "3", "7", "12", "3", "7", "19", "2", "1", "22", "4", "12", "15", "5", "14", "7", "X", "14", "15", "2", "7", "11", "2", "5", "20", "11", "9", "9", "5", "5", "6", "14", "11", "2", "3", "8", "11", "13", "7", "15", "X", "8", "13", "12", "3", "7", "1", "18", "13", "X", "9", "6", "13", "8", "4", "11", "13", "7", "4", "6", "18", "3", "X", "1", "1", "11", "10", "15", "4", "5", "7", "3", "15", "8", "13", "9", "3", "2", "15", "8", "3", "1", "X", "7", "8", "3", "13", "6", "MT", "13", "8", "X", "12", "13", "10", "15" };
String[] bands = new String[] { "p12", "unknown", "q21.33", "q31.23", "q23.1", "q21.3", "q13.2", "p23.2", "q13", "q12.1", "q44", "p11.2", "q24.13", "q12.1", "q21.3", "q12.2", "p13.32", "p21.3", "p11", "q21.13", "q22.3", "p11.2-p11.4", "p13", "p15.1", "p11.23", "q24.2", "p25.1", "q31.1", "q23.1", "p21.1", "q34", "q22.2", "unknown", "q21.31", "q21.1", "q22.3", "p12.1", "p13", "q34", "q23.3", "q13.33", "q26.1", "p35.1", "q21.2", "q23", "p13.13", "q34.3", "q11.2", "p13.11", "q36.2", "q26", "p12.1", "q14.3", "p11.2", "p11.22", "q35.2", "q21.1", "p13.2", "q13.32", "q22.2", "q23.1", "q21.13", "q13.31", "p11.21", "p22.1 ", "q12", "q23.3", "q22.1", "q11.1", "q23", "p24.2", "q13.2", "p24.3", "q14.1", "q32.2", "unknown", "q25", "q13.43", "p12.1", "p23.1", "q24.33", "p22.2", "p11.2", "q13", "p25.3", "q11", "q22.2", "unknown", "q25", "q16.2", "q13.4", "q21.2", "q11", "q13.13", "q23.3", "q11.22", "q34", "p22.3", "q32.32", "p15.3", "p12.1", "p21.1", "p13", "p12.1", "p22.1", "q29", "q23.2", "q13.3", "q24.1", "p24.2", "q21.22", "p14.3", "p24.3", "q13.1", "p32.1", "p16.2", "q22.3", "q22.1", "q13.33", "p12.1", "q24.33", "q21.2", "q11.21", "q31.3", "q11.2", "p11.22", "q34.12", "p22.1", "q25.2", "q11.2", "q22.2", "p13.1", "q12", "p22.3", "q32.31", "q31.3", "q12.1", "q26.12", "q24.1", "q11.2", "q24.3", "q24.23", "q32", "q23.31", "q31.3", "q32", "q13.3", "q12.3", "q13.2", "p12.3", "q22.1", "p14.2", "p22.2", "p11.2", "q24.11", "q13.1", "q31.1", "p11.21", "p25.3", "q28", "q32.2", "q32", "p13.12", "q23.2", "q22.11", "p21.2", "q11.21", "p11.12", "q27.3 ", "q25.1", "p11.22", "q24.3", "q31.3", "q25.3", "q22.3", "q31.3", "p34.2", "q22.1", "p21.2", "p15.3", "p15.2", "q13.3", "q11.23", "p23", "q24.21", "p11.21", "q22.1", "q26.3", "q12", "q21", "", "q28.2", "q13.1", "q24.1", "q14.3", "q25.3", "q22.1", "", "q14.12", "p34.3", "q35.1", "q23.2", "p13.2", "q23.1", "q21.32", "q31.3", "p15.33", "p22.1", "p11.1", "p25.1", "p13.3", "q23.3", "q23.2", "q31.21", "p22.12", "q14.3", "q21.3", "q12.2", "p15.31", "q22.1", "p13.1", "q12.3", "q11.1", "p15.1", "p24.2", "p36.11", "q35", "q21.1", "unknown", "q14.3", "p11.21", "q32.1", "q22.2", "p13.13", "q11.23", "q33", "q23.1", "p22.1", "q23.3", "q13.33", "q31.33", "p13.1", "q23.3", "q27", "q23.2", "q23.1", "p13.11", "p21.33", "q36.1", "q23.3", "p16.3", "q33.1", "q33.3", "q11.22", "p11.2", "p22.2", "q23.1", "q33.3", "q34.13", "q33.1", "q22.2", "p36.13", "q34.1", "19p13.11", "q31.31", "p22.2", "p11.2", "p22.13", "q13", "p32.3", "q22.3", "p14.1", "unknown", "q23.3 - q24.1", "unknown", "q33.1", "q33.3", "q27.1", "p21.2", "q22", "q22.33", "q13.13", "unknown", "q21.32", "q11.23", "q21.33", "q27.2", "p14", "q22.2", "q14.3", "q32.1", "p12", "p23", "p14.2", "p26.2", "unknown", "q24.12", "q23.3 ", "q13", "q12.1", "p22.2", "q12.3", "p11.2", "q11.21", "q13.2", "p11.23", "q25.1", "q21.3", "q12.3", "q26.2", "q23.3", "q21.2", "p24.2", "q25.2", "p36.22", "q23.1", "q28.1", "q13.3", "p14.3", "q21.2", "unknown", "q21.31", "p15.32", "q13.31", "q22.2", "q25", "p12.2", "q21.32", "q36.3", "p13.1", "q32.1", "q11.22", "q33.1", "q33.3", "p11.22", "p13.1", "q22.2", "q11.2", "", "p36.12", "q23", "q22.3", "q24.1", "q25.3", "q31.32", "q25.1", "p25.3", "q21.11", "p33", "p23", "q21", "q32.12", "q24", "q33", "q27.3", "q22.31", "q12", "unknown", "q21.11", "p14.1", "p22.3", "p21.1", "q32.3", "p12", "q37.2", "q21.3", "q24.3", "q13.2", "p21.2", "q15.3", "q24.3", "p13.3", "p13.2", "p21.3", "q25.1", "q31.2", "p12", "p13.3", "p13.2", "q23.2", "p11.1", "q21.21", "p11.23", "q31.2", "", "q13.2", "p36.23", "q21.1", "q25.32", "unknown", "q21.32", "q11.1", "q24.2", "q22", "p24.3", "p23.3", "q22.1", "q21.1", "q24.1", "p13.2", "q24.1", "q24.22", "q11.2", "q31.2", "q23", "q14.2", "q12", "p13.3", "p15.2", "q21.12", "q34.2", "q23.2", "p15", "p25.1", "q32.3", "p22.1", "q22.2", "p16.1", "q13.31", "p11.2", "q12", "p13.3", "q26.2", "p13.2", "q22.1", "p24.3", "q31.2", "q21.2", "q12", "p13.3", "p13.2", "q13.13", "p13.12", "q24.3", "q11.1", "q24.2", "p12.33", "p22.3", "q12.1", "q32.3", "q13.13", "q26.13", "q23.2", "q21", "p12", "", "p11.23", "p22.3", "q12.2", "p36.21", "q22.1", "p21.33", "p21.3", "p3.3", "q31.2", "q12.3", "q24.2", "q27.1", "p21.2", "q26.32", "q21.33", "q14.1", "q24.1", "p21.1", "q24.32", "q24.23", "q27.2", "q11.23", "q32.3", "q13.2", "p12", "p11.23", "q13.12", "q37.3", "q13.11", "q21.3", "q32.1", "q13.1", "p15.5", "q35", "q12.2", "q25.3", "p12", "q21.3", "q13.11", "q24.11", "q12.3", "q21.3", "q21.31", "q16.1", "q14.2", "q22", "p22.31", "q13.3", "q13.2", "unknown", "q43", "q13.41", "q24.3", "q34.2", "q32.2", "q12", "q22.2", "q42.13", "p24.1", "p21.31", "q23", "p22", "q24.2", "q36.1", "q11.2", "q12.2", "p13.2", "q13.2", "q11.1", "p12.3", "q22.1", "q24.21", "q21.1", "q12.1", "p11.2", "p22.2", "p12.3", "p32.2", "p13.3", "q12", "q21.1", "q25.2", "q22.12", "p24.1", "q23.1", "p36.33", "p16.1", "p13.33", "q24.1", "q23.3", "q26.11", "q21.3", "q21.2", "p12", "q26.2", "q42.3", "q28.3", "p12", "q22.2", "p", "q22.33", "q36.3", "q13.2", "q25.2", "q24.31", "p12", "q13.31", "p13", "p12.1", "q14.2", "p15.3", "p13", "q22.3", "q24.2", "q14.2", "q13.32", "q24.3", "p14.1", "q22.3", "q11.2", "p22.3", "p13", "q11.2", "p11.1", "p26.1", "q26", "q32.3", "q32.1", "p15.31", "q26.2", "q13.3", "q34.11", "q21.2", "q25.2", "q41", "p12.3", "p11.22", "p13.1", "p12.31", "q11.1", "q13.42", "q11.21", "q14", "q24.31", "q21.2", "q24.13", "q32.11", "q23.1", "p16.3", "p21", "q23.3", "p31.1", "q13.1", "q25.1", "unknown", "p35.3", "q21.11", "p11.2", "q13.11", "q21.1", "q21.12", "q25.31", "q31.2", "q22.31", "q16.3", "q14.3", "q31.22", "q11.21", "q22.3", "q37.1", "p21.3", "q22.2", "p13.31", "p14", "q27.3", "q24", "p25.2", "q31", "p13", "p21.1", "unknown", "q11.2", "q14.1", "p21.3", "p21.32", "q11.221", "q24.3", "p12.3", "p15.32 - p15.31", "q12.2", "q11.1", "p15.32", "p11.2", "q23.33", "p11.1", "q12.3", "q21.11", "p11.21", "q32.13", "p21.31", "q22.1", "q21.32", "q32.33", "q15", "q22.2", "q23.1", "q24.32", "p23.3", "p12.3", "q11.223", "cen", "q22.32", "q13.1", "q23.3", "q21.1", "q12", "p11.21", "q25.2", "p11.1", "q13.1", "q21.3", "q13.3", "q21", "p16.2", "p14.2", "q42.2", "q11.1", "p15.1", "p11.1", "q21.2", "q42.11", "q12.3", "q12.2", "p26.3", "q21.2", "q24.2", "q33.2", "p11.4", "q23.2", "q15", "q26.33", "", "q32.2", "q11.23", "p23.1", "p31.3", "q22.1 - q23.3", "p12.2", "q21.23", "q23.32", "p25.2", "unknown", "q36.2", "q13.12", "q31.3", "q21.2", "p36.31", "unknown", "q13.33", "q33.2", "q11.22", "q22.3", "q13.1", "q22.13", "p14.3", "q24.2", "q22.33", "q13.3", "q32.2", "p12.2", "q34", "q21.33", "q11.23", "p21.1", "p11.2", "p23.2", "q13.32", "q32.2", "q33.2", "q12.1", "p22.11", "q14.2", "q32", "q11.222", "q33.2", "q23.2", "q21.2", "q24.2", "q25.1", "p34.1", "q13.2", "q22.1", "p12.2", "q26.3", "p15.2", "p21.1", "q22.2", "p14.1", "q24.22", "p24.1", "q21.31", "q14.11", "q26.1", "q22.1", "p15.2", "q21.13", "q22.2", "p11.31", "p11.22", "q21.2", "q11.2", "q23", "q11.22", "q21.2", "p12.2", "", "p15.33", "q32.2", "unknown", "q35.1", "q13.12", "q21.33", "q35.3", "p12.2", "q24.3", "q22.1 - q22.2", "q28", "", "p12.2", "q13.12", "q11.2", "q13.11", "q22.3", "q42.12", "q11.21", "p15.1", "q14.2", "q15.1", "q22.3", "q31.1", "p14.3", "unknown", "q21.1", "q24.1", "q21.1", "p14.2", "p15.1", "q31.1", "q11.1", "p11.1", "q11", "q21.31", "q22.32", "q21.1", "q31.1", "q27", "q22.3", "q13.4", "q11.1", "q12.2", "q22.1", "q12.1", "q12.13", "p21.2", "q12", "q21.32", "q23.2", "q21.33", "q22", "p24.1", "p15.2", "p35.2", "p11.32", "p13", "p22.33", "q31.1", "q15", "q22.3", "q13.3", "q35.2", "q13.5", "q14.13", "q32", "q34.3", "q15-q16.1", "q21.2", "q25.33", "q22.2", "q31.1", "q21.1", "p15.4", "p14", "q26.1", "q24", "q14.1", "p22.1", "q13.32", "q25.3", "p21.2", "q12.11", "q22.31", "q26.31", "q14.1", "q26.3", "q13.1", "q21.3", "p36.32", "p11.3", "q22.1", "q24.12", "q13.2", "q12.12", "p25.2", "", "q21.1", "p11.23", "p22.2", "q13.2", "q31.1", "p11.1", "q15.2" };
Preconditions.checkArgument(chromosomes.length == bands.length);
List<ChromosomalLocation> list = new ArrayList<>();
for (int i = 0; i < chromosomes.length; i++) {
ChromosomalLocation location = new ChromosomalLocation();
location.setChromosome(chromosomes[i]);
location.setBand(bands[i]);
list.add(location);
}
return list;
}
use of org.nextprot.api.core.domain.ChromosomalLocation in project nextprot-api by calipho-sib.
the class GeneDaoIntegrationTest method shouldGetSomeSilverGeneMappingLocation.
@Test
public void shouldGetSomeSilverGeneMappingLocation() {
// Note that SILVER mapping should be filtered out in chromosome reports
// We just check that we have one SILVER chr location in these examples (should hopefully remain true a long time)
// Find more examples with query "Query for case 1" in
// See https://docs.google.com/document/d/1SkyXg82DgvbRD6Xq5tye1Ay87KCYF1D7VQBDB1A94iQ/edit#
// just replace with condition for case 5:
// where
// gi_src = 'Ensembl' and haplotype = 'haplotype' and map_mastbool is true and map_qid = 50
String[] entryNames = { "NX_P30450", "NX_P30453", "NX_Q16473", "NX_P30462", "NX_P30456" };
boolean haveSilverMapping = false;
for (String entryName : entryNames) {
int cnt = 0;
List<ChromosomalLocation> locs = geneDao.findChromosomalLocationsByEntryName(entryName);
for (ChromosomalLocation loc : locs) {
if (!loc.isGoldMapping()) {
haveSilverMapping = true;
cnt++;
}
}
System.out.println(entryName + ":" + locs.size() + " ChrLocations, " + cnt + " SILVER mapping");
}
Assert.assertEquals(true, haveSilverMapping);
}
use of org.nextprot.api.core.domain.ChromosomalLocation in project nextprot-api by calipho-sib.
the class GeneDaoIntegrationTest method shouldHandleCaseWhenASingleUniProtNameIsProvided.
@Test
public void shouldHandleCaseWhenASingleUniProtNameIsProvided() {
// Case 2 - about 21685 locations, example: NX_Q8WVF5;
ChromosomalLocation loc = buildChromosomalLocation("KCTD4-dn", "KCTD4-gn", "KCTD4");
Assert.assertEquals("KCTD4", loc.getRecommendedName("old"));
Assert.assertEquals("KCTD4", loc.getRecommendedName());
}
use of org.nextprot.api.core.domain.ChromosomalLocation in project nextprot-api by calipho-sib.
the class GeneDaoIntegrationTest method shouldHandleCaseWhenNoUniProtNameIsProvided.
@Test
public void shouldHandleCaseWhenNoUniProtNameIsProvided() {
// Case 1 - about 167 locations, example: NX_Q8NDZ9;
ChromosomalLocation loc = buildChromosomalLocation("RP11-138I18.1", "RP11-138I18.1", null);
Assert.assertEquals("RP11-138I18.1", loc.getRecommendedName("old"));
Assert.assertEquals("unknown", loc.getRecommendedName());
}
use of org.nextprot.api.core.domain.ChromosomalLocation in project nextprot-api by calipho-sib.
the class ChromosomeFieldBuilder method init.
@Override
protected void init(Entry entry) {
// build GENE_BAND by concatenating distinct band and chr+band
// build CHR_LOC field by concatenating distinct chromosomal locations (chr + band) after sorting them alphabetically
// build CHR_LOCS field based of first element in CHR_LOC
// Note that CHR_LOC is displayed in UI search result and CHR_LOC_S is used to sort UI search result
// this is why it is important to compute the CHR_LOC_S based on the first location displayed in UI (consistency)
List<String> gblist = new ArrayList<String>();
Set<String> clset = new TreeSet<String>();
Set<String> gbset = new TreeSet<String>(Collections.reverseOrder());
// The reverse is important otherwise solr may find wrong locations with queries like 11q13 in "19q13.11 q13.11"
List<ChromosomalLocation> chrlocs = entry.getChromosomalLocations();
for (ChromosomalLocation data : chrlocs) {
String ch = data.getChromosome() == null ? "" : data.getChromosome();
String gb1 = data.getBand() == null ? "" : data.getBand();
String gb2 = ch + gb1;
String cl = ch + ("unknown".equals(gb1) ? "" : gb1);
gbset.add(gb1);
gbset.add(gb2);
clset.add(cl);
}
String gene_band = Joiner.on(" ").skipNulls().join(gbset).trim();
String chr_loc = Joiner.on(" ").skipNulls().join(clset).trim();
Integer chr_loc_s = sortChr(chr_loc);
addField(Fields.GENE_BAND, gene_band);
addField(Fields.CHR_LOC, chr_loc);
addField(Fields.CHR_LOC_S, chr_loc_s);
}
Aggregations