Skip to content

Commit 5c8af7b

Browse files
committed
server: Sort samples in the same way for variants and samplesMetadata
1 parent 53619e8 commit 5c8af7b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

opencga-server/src/main/java/org/opencb/opencga/server/utils/VariantFetcher.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,9 @@ public QueryResult variantsStudy(int studyId, String regionStr, boolean histogra
126126
new QueryOptions("exclude", Arrays.asList("projects.studies.samples.annotationSets",
127127
"projects.studies.samples.attributes"))
128128
, sessionId);
129+
samplesQueryResult.getResult().sort((o1, o2) -> Integer.compare(o1.getId(), o2.getId()));
129130
samplesMap.put(study.getId(), samplesQueryResult.getResult());
130-
samplesQueryResult.getResult().stream().map(Sample::getId).sorted().forEach(returnedSamples::add);
131+
samplesQueryResult.getResult().stream().map(Sample::getId).forEach(returnedSamples::add);
131132
}
132133
query.append(VariantDBAdaptor.VariantQueryParams.RETURNED_SAMPLES.key(), returnedSamples);
133134
}

0 commit comments

Comments
 (0)