Skip to content

Commit

Permalink
Merge pull request #407 from olofsvensson/issue_406
Browse files Browse the repository at this point in the history
Issue #406 : Added check for long space group names
  • Loading branch information
olofsvensson authored Apr 26, 2018
2 parents 0b417e2 + ead8d25 commit 69ea74f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
23 changes: 17 additions & 6 deletions js/mx/utils/autoprocessingsorter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion mx/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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:[
{
Expand Down

0 comments on commit 69ea74f

Please sign in to comment.