Skip to content

Commit

Permalink
Show "is validated" chip on /runs page
Browse files Browse the repository at this point in the history
  • Loading branch information
danvk committed Mar 5, 2015
1 parent e2534a3 commit 5f9fff0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
14 changes: 11 additions & 3 deletions cycledash/runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,18 @@ def get_runs():
"""Return a tuple of a list of all runs, the last 5 comments, and an object with
lists of potential completions for the run upload form typeahead fields."""
with tables(db, 'vcfs', 'user_comments') as (con, vcfs, user_comments):
joined = vcfs.outerjoin(user_comments, vcfs.c.id == user_comments.c.vcf_id)
validation_vcfs = vcfs.select().where(vcfs.c.validation_vcf == True).alias()
joined = (vcfs
.outerjoin(user_comments, vcfs.c.id == user_comments.c.vcf_id)
.outerjoin(validation_vcfs,
validation_vcfs.c.dataset_name == vcfs.c.dataset_name))
num_comments = func.count(user_comments.c.vcf_id).label('num_comments')
q = select(vcfs.c + [num_comments]).select_from(joined).group_by(
vcfs.c.id).order_by(desc(vcfs.c.id))
is_validated = func.count(validation_vcfs.c.id).label('is_validated')
q = (select(vcfs.c + [num_comments] + [is_validated])
.select_from(joined)
.where(vcfs.c.validation_vcf == False)
.group_by(vcfs.c.id)
.order_by(desc(vcfs.c.id)))
vcfs = [dict(v) for v in con.execute(q).fetchall()]
completions = _extract_completions(vcfs)

Expand Down
2 changes: 1 addition & 1 deletion cycledash/static/js/runs/components/RunsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ var RunLabels = React.createClass({
render: function() {
var run = this.props.run;
var labelTypes = [
['validation_vcf', 'validation', 'Is a validation VCF'],
['is_validated', 'validated', 'Has associated validation data'],
['tumor_bam_uri', 'tumor', 'Has an associated tumor BAM'],
['normal_bam_uri', 'normal', 'Has an associated normal BAM']
];
Expand Down

0 comments on commit 5f9fff0

Please sign in to comment.