Commit 5a4af716 authored by Mathieu Giraud's avatar Mathieu Giraud

Merge branch 'feature-s/3899-hidden-results' into 'dev'

Hide some results

Closes #3899

See merge request !477
parents b57898a6 d7bd8fbe
Pipeline #95183 passed with stages
in 9 minutes and 18 seconds
......@@ -313,6 +313,7 @@ def get_data():
& ( db.sample_set.id == db.sample_set_membership.sample_set_id )
& ( db.sequence_file.id == db.sample_set_membership.sequence_file_id)
& ( db.results_file.sequence_file_id == db.sequence_file.id )
& ( db.results_file.hidden == False )
& ( db.results_file.config_id == request.vars["config"] )
).select(db.sequence_file.ALL,db.results_file.ALL, db.sample_set.id, orderby=db.sequence_file.id|~db.results_file.run_date)
......
......@@ -20,6 +20,7 @@ def index():
& (db.sequence_file.id==db.sample_set_membership.sequence_file_id)
& (db.sample_set_membership.sample_set_id==db.patient.sample_set_id)
& (db.results_file.config_id==db.config.id)
& (db.results_file.hidden == False)
).select(
orderby = ~db.results_file.run_date
)
......
......@@ -59,7 +59,8 @@ def info():
).select(
left=db.results_file.on(
(db.results_file.sequence_file_id==db.sequence_file.id)
& (db.results_file.config_id==str(config_id) )
& (db.results_file.config_id==str(config_id))
& (db.results_file.hidden == False)
),
orderby = db.sequence_file.id|~db.results_file.run_date
)
......@@ -79,6 +80,7 @@ def info():
left=db.results_file.on(
(db.results_file.sequence_file_id==db.sequence_file.id)
& (db.results_file.config_id==str(config_id) )
& (db.results_file.hidden == False)
)
)
......
......@@ -99,7 +99,8 @@ def index():
).select(
left=db.results_file.on(
(db.results_file.sequence_file_id==db.sequence_file.id)
& (db.results_file.config_id==str(config_id) )
& (db.results_file.config_id==str(config_id))
& (db.results_file.hidden == False)
),
orderby = db.sequence_file.id|~db.results_file.run_date
)
......@@ -118,7 +119,8 @@ def index():
).select(
left=db.results_file.on(
(db.results_file.sequence_file_id==db.sequence_file.id)
& (db.results_file.config_id==str(config_id) )
& (db.results_file.config_id==str(config_id))
& (db.results_file.hidden == False)
)
)
......@@ -311,6 +313,7 @@ def result_files():
(db.sequence_file.id == db.sample_set_membership.sequence_file_id) &
(db.results_file.sequence_file_id == db.sequence_file.id) &
(db.results_file.data_file != None) &
(db.results_file.hidden == False) &
config_query
)
......@@ -600,6 +603,7 @@ def custom():
& (db.sequence_file.id == db.sample_set_membership.sequence_file_id)
& (db.results_file.sequence_file_id==db.sequence_file.id)
& (db.results_file.data_file != '')
& (db.results_file.hidden == False)
& (db.config.id==db.results_file.config_id))
group_ids = get_involved_groups()
......
......@@ -209,6 +209,7 @@ db.define_table('results_file',
Field('config_id', 'reference config', ondelete='SET NULL'),
Field('run_date','datetime'),
Field('scheduler_task_id', 'integer'),
Field('hidden', 'boolean', default = False, notnull = True),
Field('data_file', 'upload',
uploadfolder=defs.DIR_RESULTS,
length=LENGTH_UPLOAD, autodelete=AUTODELETE))
......
......@@ -12,6 +12,7 @@ def get_last_results(sequence_file, config_ids=None):
select_on_config = db.results_file.config_id.belongs(config_ids)
# First get the max run dates for the good result files
select_max_run = db((db.results_file.sequence_file_id == sequence_file)\
& (db.results_file.hidden == False)\
& (select_on_config))._select(db.results_file.run_date.max().with_alias('max'),
groupby=db.results_file.config_id)
......
......@@ -62,6 +62,7 @@ def compute_contamination(sequence_file_id, results_file_id, config_id):
& ( db.sequence_file.id == db.sample_set_membership.sequence_file_id)
& ( db.sequence_file.id != sequence_file_id[i])
& ( db.results_file.sequence_file_id == db.sequence_file.id )
& ( db.results_file.hidden == False )
& ( db.results_file.config_id == config_id[i] )
).select(db.sequence_file.ALL,db.results_file.ALL, db.sample_set.id, orderby=db.sequence_file.id|~db.results_file.run_date)
......@@ -104,6 +105,7 @@ def compute_extra(id_file, id_config, min_threshold):
result = {}
d = None
results_file = db((db.results_file.sequence_file_id == id_file) &
(db.results_file.hidden == False) &
(db.results_file.config_id == id_config)
).select(orderby=~db.results_file.run_date).first()
filename = defs.DIR_RESULTS+results_file.data_file
......@@ -148,6 +150,7 @@ def schedule_run(id_sequence, id_config, grep_reads=None):
ts = time.time()
data_id = db.results_file.insert(sequence_file_id = id_sequence,
run_date = datetime.datetime.fromtimestamp(ts).strftime('%Y-%m-%d %H:%M:%S'),
hidden = grep_reads is not None,
config_id = id_config )
args = [id_sequence, id_config, data_id, grep_reads]
......@@ -183,6 +186,7 @@ def schedule_fuse(sample_set_ids, config_ids):
row = db((db.sample_set_membership.sample_set_id == sample_set_id)
& (db.sample_set_membership.sequence_file_id == db.results_file.sequence_file_id)
& (db.results_file.config_id == config_id)
& (db.results_file.hidden == False)
).select(db.sample_set_membership.sample_set_id, db.sample_set_membership.sequence_file_id,
db.results_file.id, db.results_file.config_id).first()
if row:
......@@ -648,6 +652,7 @@ def run_fuse(id_file, id_config, id_data, sample_set_id, clean_before=True, clea
& ( db.sample_set_membership.sequence_file_id == db.sequence_file.id)
& ( db.sample_set_membership.sample_set_id == sample_set_id)
& ( db.results_file.config_id == id_config )
& ( db.results_file.hidden == False)
).select( orderby=db.sequence_file.id|~db.results_file.run_date)
query = []
sequence_file_id = 0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment