Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
554e784c
Commit
554e784c
authored
13 years ago
by
tpylak
Browse files
Options
Downloads
Patches
Plain Diff
LMS-2190 ensure that the replicate sequence will be always the same for a fixes set of replicas
SVN: 21199
parent
d95b1c2c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/server/logic/ReplicateSequenceProvider.java
+13
-2
13 additions, 2 deletions
...gin/screening/server/logic/ReplicateSequenceProvider.java
with
13 additions
and
2 deletions
screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/server/logic/ReplicateSequenceProvider.java
+
13
−
2
View file @
554e784c
...
@@ -19,10 +19,13 @@ package ch.systemsx.cisd.openbis.plugin.screening.server.logic;
...
@@ -19,10 +19,13 @@ package ch.systemsx.cisd.openbis.plugin.screening.server.logic;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.Collection
;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.Comparator
;
import
java.util.LinkedHashMap
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
org.apache.commons.collections.comparators.NullComparator
;
import
ch.systemsx.cisd.common.collections.GroupByMap
;
import
ch.systemsx.cisd.common.collections.GroupByMap
;
import
ch.systemsx.cisd.common.collections.IKeyExtractor
;
import
ch.systemsx.cisd.common.collections.IKeyExtractor
;
import
ch.systemsx.cisd.openbis.generic.shared.basic.dto.IEntityPropertiesHolder
;
import
ch.systemsx.cisd.openbis.generic.shared.basic.dto.IEntityPropertiesHolder
;
...
@@ -53,7 +56,9 @@ class ReplicateSequenceProvider
...
@@ -53,7 +56,9 @@ class ReplicateSequenceProvider
GroupByMap
<
Double
,
IEntityPropertiesHolder
>
biologicalReplicates
=
GroupByMap
<
Double
,
IEntityPropertiesHolder
>
biologicalReplicates
=
groupByBiologicalReplicate
(
replicaWells
);
groupByBiologicalReplicate
(
replicaWells
);
int
biologicalReplicateSeq
=
1
;
int
biologicalReplicateSeq
=
1
;
for
(
Double
biologicalReplicateKey
:
biologicalReplicates
.
getKeys
())
// NOTE: by sorting the keys we ensure that the replicate sequence will be always the same
// for a fixes set of replicas.
for
(
Double
biologicalReplicateKey
:
createSortedCopy
(
biologicalReplicates
.
getKeys
()))
{
{
if
(
biologicalReplicateKey
!=
null
)
if
(
biologicalReplicateKey
!=
null
)
{
{
...
@@ -118,7 +123,13 @@ class ReplicateSequenceProvider
...
@@ -118,7 +123,13 @@ class ReplicateSequenceProvider
private
static
<
T
extends
Comparable
<
T
>>
Collection
<
T
>
createSortedCopy
(
Collection
<
T
>
keys
)
private
static
<
T
extends
Comparable
<
T
>>
Collection
<
T
>
createSortedCopy
(
Collection
<
T
>
keys
)
{
{
ArrayList
<
T
>
sortedKeys
=
new
ArrayList
<
T
>(
keys
);
ArrayList
<
T
>
sortedKeys
=
new
ArrayList
<
T
>(
keys
);
Collections
.
sort
(
sortedKeys
);
Collections
.
sort
(
sortedKeys
,
new
NullComparator
<
T
>(
new
Comparator
<
T
>()
{
public
int
compare
(
T
o1
,
T
o2
)
{
return
o1
.
compareTo
(
o2
);
}
}));
return
sortedKeys
;
return
sortedKeys
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment