Skip to content

Commit bdf94d4

Browse files
committed
wts2-1660/e4g-253/PWI/Marker Order Issue
1 parent edd4a99 commit bdf94d4

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

src/main/java/org/jax/mgi/mgd/api/model/all/service/AlleleService.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,13 +1035,10 @@ public List<SlimAlleleRefAssocDomain> searchVariant(AlleleDomain searchDomain) {
10351035
+ "\nand a._allele_key = av._allele_key"
10361036
+ "\nand av._sourcevariant_key is not null";
10371037

1038-
//String select = "select distinct a._allele_key, a.symbol, left(a.symbol, 1), substring(a.symbol, '\\d+')::int";
1039-
//String orderBy = "order by left(a.symbol, 1), substring(a.symbol, '\\d+')::int NULLS FIRST, a.symbol";
1040-
1041-
// split the symbol into a prefixPart and a numericPart (see pgmgddbschema/procedure/ACC_split_create.object)
1042-
// set numericPart = integer so it will order correctly
1043-
String select = "with allele as (select distinct a._allele_key, a.symbol, regexp_matches(split_part(a.symbol,'<',1), E'^((.*[^0-9])?)([0-9]*)', 'g') as symbolMatch";
1044-
String orderBy = ")\nselect _allele_key, symbol, symbolMatch[1], "
1038+
// split the symbol into a prefixPart and a numericPart (see pgmgddbschema/procedure/ACC_split_create.object)
1039+
// set numericPart = integer so it will order correctly
1040+
String select = "with allele as (select distinct a._allele_key, a.symbol, regexp_matches(split_part(a.symbol,'<',1), E'^((.*[^0-9])?)([0-9]*)', 'g') as symbolMatch";
1041+
String orderBy = ")\nselect _allele_key, symbol, symbolMatch[1], "
10451042
+ "\nCASE"
10461043
+ "\nwhen symbolMatch[3] = '' then 0"
10471044
+ "\nwhen symbolMatch[3] != '' then symbolMatch[3]::integer"

src/main/java/org/jax/mgi/mgd/api/model/all/service/AlleleVariantService.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -344,14 +344,11 @@ public List<SlimAlleleVariantDomain> search(AlleleVariantDomain searchDomain) {
344344
Boolean from_reference = false;
345345
Boolean from_alleleReferenceID = false;
346346
Boolean from_alleleID = false;
347-
348-
//String select = "select distinct v._variant_key, a._allele_key, a.symbol, left(a.symbol, 1), substring(a.symbol, '\\d+')::int";
349-
//String orderBy = "order by left(a.symbol, 1), substring(a.symbol, '\\d+')::int NULLS FIRST, a.symbol";
350347

351-
// split the symbol into a prefixPart and a numericPart (see pgmgddbschema/procedure/ACC_split_create.object)
352-
// set numericPart = integer so it will order correctly
353-
String select = "with allele as (select distinct v._variant_key, a._allele_key, a.symbol, regexp_matches(split_part(a.symbol,'<',1), E'^((.*[^0-9])?)([0-9]*)', 'g') as symbolMatch";
354-
String orderBy = ")\nselect distinct _variant_key, _allele_key, symbol, symbolMatch[1], "
348+
// split the symbol into a prefixPart and a numericPart (see pgmgddbschema/procedure/ACC_split_create.object)
349+
// set numericPart = integer so it will order correctly
350+
String select = "with allele as (select distinct v._variant_key, a._allele_key, a.symbol, regexp_matches(split_part(a.symbol,'<',1), E'^((.*[^0-9])?)([0-9]*)', 'g') as symbolMatch";
351+
String orderBy = ")\nselect distinct _variant_key, _allele_key, symbol, symbolMatch[1], "
355352
+ "\nCASE"
356353
+ "\nwhen symbolMatch[3] = '' then 0"
357354
+ "\nwhen symbolMatch[3] != '' then symbolMatch[3]::integer"

0 commit comments

Comments
 (0)