Skip to content

Commit

Permalink
Adding script to count by study and omics type
Browse files Browse the repository at this point in the history
  • Loading branch information
aclum committed May 17, 2024
1 parent 9977788 commit 3152213
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions assets/mongodb_queries/data_qc/omics_count_by_study.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
db.getCollection(
'omics_processing_set'
).aggregate(
[
{
$group: {
_id: {
study: '$part_of',
type: '$omics_type.has_raw_value'
},
count: { $sum: 1 }
}
},
{
$lookup: {
from: 'study_set',
localField: '_id.study',
foreignField: 'id',
as: 'study_set'
}
},
{
$project: {
count: 1,
'study_set.id': 1,
'study_set.title': 1
}
}
],
{ maxTimeMS: 60000, allowDiskUse: true }
);

0 comments on commit 3152213

Please sign in to comment.