...
  View open merge request
Commits (2)
  • Mikaël Salson's avatar
    server/.../models/{db,task}.py: Results can be hidden · 4ab2cfe2
    Mikaël Salson authored
    We add a new field to the results_file stating that they can be hidden.
    This means that those results shouldn't appear in the last processed
    results. They should not be taken into consideration when fusing results.
    They should not be proposed when comparing results.
    
    A first example of those hidden results is when we launch a grep reads.
    This is just a process launched behind the scene that should not be
    made explicit to the user.
    
    Fix #3899
    4ab2cfe2
  • Mikaël Salson's avatar
    server/.../{models,controllers}: Ignore hidden files · d7bd8fbe
    Mikaël Salson authored
    See previous commit for more information
    d7bd8fbe
......@@ -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)
)
)
......@@ -304,6 +306,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
)
......@@ -593,6 +596,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
......