diff --git a/js/mx/utils/autoprocessingsorter.js b/js/mx/utils/autoprocessingsorter.js index 77c89ef1e..04684e9cb 100644 --- a/js/mx/utils/autoprocessingsorter.js +++ b/js/mx/utils/autoprocessingsorter.js @@ -34,15 +34,26 @@ AutoprocessingRanker.prototype.rank = function(array, spacegroudFieldName){ }); - function sortByHighestSymmetry(a, b) { - var spaceGroupA = a[spacegroudFieldName].replace(/\s/g, ""); + function sortByHighestSymmetry(a, b) { + var spaceGroupA = a[spacegroudFieldName].replace(/\s/g, ""); var spaceGroupB = b[spacegroudFieldName].replace(/\s/g, ""); - - if ( _.indexOf(ExtISPyB.spaceGroups, spaceGroupA) == _.indexOf(ExtISPyB.spaceGroups, spaceGroupB)){ + + indexOfSpaceGroupA = _.indexOf(ExtISPyB.spaceGroups, spaceGroupA) + if (indexOfSpaceGroupA == -1) { + /** If not found check with long name */ + indexOfSpaceGroupA = _.indexOf(ExtISPyB.spaceGroupLongNames, spaceGroupA) + } + + indexOfSpaceGroupB = _.indexOf(ExtISPyB.spaceGroups, spaceGroupB) + if (indexOfSpaceGroupB == -1) { + indexOfSpaceGroupB = _.indexOf(ExtISPyB.spaceGroupLongNames, spaceGroupB) + } + + if ( indexOfSpaceGroupA == indexOfSpaceGroupB ){ return ( parseFloat(a.innerShell.rMerge) - parseFloat(b.innerShell.rMerge)); } - return _.indexOf(ExtISPyB.spaceGroups, spaceGroupB) - _.indexOf(ExtISPyB.spaceGroups, spaceGroupA); - + return indexOfSpaceGroupB - indexOfSpaceGroupA; + } function sortByrMerge(a, b) { diff --git a/mx/config.js b/mx/config.js index 14f90671f..fbf3b3e2d 100644 --- a/mx/config.js +++ b/mx/config.js @@ -3,7 +3,7 @@ var ExtISPyB ={ release_date : '2017/03/01', spaceGroups : ["P1", "P2", "P21", "C2", "P222", "P2221", "P21212", "P212121", "C2221", "C222", "F222", "I222", "I212121", "P4", "P41", "P42", "P43", "I4", "I41", "P422", "P4212", "P4122", "P41212", "P4222", "P42212", "P4322", "P43212", "I422", "I4122", "P3", "P31", "P32", "H3", "R3", "P312", "P321", "P3112", "P3121", "P3212", "P3221", "H32", "R32", "P6", "P61", "P65", "P62", "P64", "P63", "P622", "P6122", "P6522", "P6222", "P6422", "P6322", "P23", "F23", "I23", "P213", "I213", "P432", "P4232", "F432", "F4132", "I432", "P4332", "P4132", "I4132"], - + spaceGroupLongNames : ["P1", "P121", "P1211", "C121", "P222", "P2221", "P21212", "P212121", "C2221", "C222", "F222", "I222", "I212121", "P4", "P41", "P42", "P43", "I4", "I41", "P422", "P4212", "P4122", "P41212", "P4222", "P42212", "P4322", "P43212", "I422", "I4122", "P3", "P31", "P32", "H3", "R3", "P312", "P321", "P3112", "P3121", "P3212", "P3221", "H32", "R32", "P6", "P61", "P65", "P62", "P64", "P63", "P622", "P6122", "P6522", "P6222", "P6422", "P6322", "P23", "F23", "I23", "P213", "I213", "P432", "P4232", "F432", "F4132", "I432", "P4332", "P4132", "I4132"], sites:[ {