Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions qiita_db/support_files/patches/python_patches/66.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ def create_command(software, name, description, parameters, outputs=None,
sql_param_values = []
sql_artifact_params = []
for pname, vals in parameters.items():
# vals should always have 2 elements as it should be:
# param_name: [parameter_type, default]
if len(vals) != 2:
raise QiitaDBError(
"Malformed parameters dictionary, the format should be "
Expand Down
17 changes: 9 additions & 8 deletions qiita_db/test/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -1062,23 +1062,24 @@ def test_get_artifacts_information(self):

exp = [
{'files': ['1_study_1001_closed_reference_otu_table.biom'],
'artifact_id': 4, 'data_type': '18S', 'target_gene': '16S rRNA',
'name': 'BIOM', 'target_subfragment': ['V4'],
'parameters': {
'artifact_id': 4, 'data_type': '18S', 'active': False,
'target_gene': '16S rRNA', 'name': 'BIOM',
'target_subfragment': ['V4'], 'parameters': {
'reference': '1', 'similarity': '0.97',
'sortmerna_e_value': '1', 'sortmerna_max_pos': '10000',
'threads': '1', 'sortmerna_coverage': '0.97'},
'algorithm': 'Pick closed-reference OTUs | Split libraries FASTQ',
'platform': 'Illumina',
'algorithm_az': 'd480799a0a7a2fbe0e9022bc9c602018',
'platform': 'Illumina', 'prep_samples': 27},
{'files': [], 'artifact_id': 7, 'data_type': '16S',
'prep_samples': 27},
{'files': [], 'artifact_id': 7, 'data_type': '16S', 'active': True,
'target_gene': '16S rRNA', 'name': 'BIOM',
'target_subfragment': ['V4'], 'parameters': {}, 'algorithm': '',
'algorithm_az': '', 'platform': 'Illumina', 'prep_samples': 27},
'platform': 'Illumina', 'algorithm_az': '', 'prep_samples': 27},
{'files': ['biom_table.biom'], 'artifact_id': 8,
'data_type': '18S', 'target_gene': 'not provided',
'data_type': '18S', 'active': True, 'target_gene': 'not provided',
'name': 'noname', 'target_subfragment': [], 'parameters': {},
'algorithm': '', 'algorithm_az': '', 'platform': 'not provided',
'algorithm': '', 'platform': 'not provided', 'algorithm_az': '',
'prep_samples': 0}]
self.assertItemsEqual(obs, exp)

Expand Down
7 changes: 6 additions & 1 deletion qiita_db/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -1628,9 +1628,11 @@ def get_artifacts_information(artifact_ids, only_biom=True):
commands = {}
qdb.sql_connection.TRN.add(sql_params)
for cid, params in qdb.sql_connection.TRN.execute_fetchindex():
cmd = qdb.software.Command(cid)
commands[cid] = {
'params': params,
'merging_scheme': qdb.software.Command(cid).merging_scheme}
'merging_scheme': cmd.merging_scheme,
'active': cmd.software.active}

# now let's get the actual artifacts
ts = {}
Expand Down Expand Up @@ -1664,8 +1666,10 @@ def get_artifacts_information(artifact_ids, only_biom=True):

# generating algorithm, by default is ''
algorithm = ''
active = True
if cid is not None:
ms = commands[cid]['merging_scheme']
active = commands[cid]['active']
eparams = []
if ms['parameters']:
eparams.append(','.join(['%s: %s' % (k, aparams[k])
Expand Down Expand Up @@ -1733,6 +1737,7 @@ def get_artifacts_information(artifact_ids, only_biom=True):
'parameters': aparams,
'algorithm': algorithm,
'algorithm_az': algorithm_az[algorithm],
'active': active,
'files': filepaths})

return results
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def test_analyisis_graph_handler_get_request(self):
exp = {'edges': [(8, job_id), (job_id, 9)],
'nodes': [
('job', 'job', job_id, 'Single Rarefaction', 'success'),
('artifact', 'BIOM', 9, 'noname\n(BIOM)', 'artifact'),
('artifact', 'BIOM', 9, 'noname\n(BIOM)', 'deprecated'),
('artifact', 'BIOM', 8, 'noname\n(BIOM)', 'artifact')],
'workflow': None}
self.assertItemsEqual(obs, exp)
Expand Down Expand Up @@ -160,7 +160,7 @@ def test_get_analysis_graph_handler(self):
exp = {'edges': [[8, job_id], [job_id, 9]],
'nodes': [
['job', 'job', job_id, 'Single Rarefaction', 'success'],
['artifact', 'BIOM', 9, 'noname\n(BIOM)', 'artifact'],
['artifact', 'BIOM', 9, 'noname\n(BIOM)', 'deprecated'],
['artifact', 'BIOM', 8, 'noname\n(BIOM)', 'artifact']],
'workflow': None}
self.assertItemsEqual(obs, exp)
Expand Down
32 changes: 16 additions & 16 deletions qiita_pet/handlers/api_proxy/tests/test_artifact.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,33 +228,33 @@ def test_artifact_get_info(self):
data = [
{'files': ['1_study_1001_closed_reference_otu_table_Silva.biom'],
'artifact_id': 6, 'data_type': '16S',
'timestamp': '2012-10-02 17:30:00', 'target_gene': '16S rRNA',
'name': 'BIOM', 'target_subfragment': ['V4'],
'parameters': {
'reference': '2', 'similarity': '0.97',
'sortmerna_e_value': '1', 'sortmerna_max_pos': '10000',
'threads': '1', 'sortmerna_coverage': '0.97'},
'timestamp': '2012-10-02 17:30:00', 'active': False,
'target_gene': '16S rRNA', 'name': 'BIOM',
'target_subfragment': ['V4'], 'parameters': {
'reference': '2', 'similarity': '0.97', 'sortmerna_e_value': '1',
'sortmerna_max_pos': '10000', 'threads': '1',
'sortmerna_coverage': '0.97'},
'algorithm': 'Pick closed-reference OTUs | Split libraries FASTQ',
'platform': 'Illumina',
'algorithm_az': 'd480799a0a7a2fbe0e9022bc9c602018',
'prep_samples': 27},
{'files': ['1_study_1001_closed_reference_otu_table.biom'],
'artifact_id': 5, 'data_type': '18S',
'timestamp': '2012-10-02 17:30:00', 'target_gene': '16S rRNA',
'name': 'BIOM', 'target_subfragment': ['V4'],
'parameters': {
'reference': '1', 'similarity': '0.97',
'sortmerna_e_value': '1', 'sortmerna_max_pos': '10000',
'threads': '1', 'sortmerna_coverage': '0.97'},
'timestamp': '2012-10-02 17:30:00', 'active': False,
'target_gene': '16S rRNA', 'name': 'BIOM',
'target_subfragment': ['V4'], 'parameters': {
'reference': '1', 'similarity': '0.97', 'sortmerna_e_value': '1',
'sortmerna_max_pos': '10000', 'threads': '1',
'sortmerna_coverage': '0.97'},
'algorithm': 'Pick closed-reference OTUs | Split libraries FASTQ',
'platform': 'not provided',
'algorithm_az': 'd480799a0a7a2fbe0e9022bc9c602018',
'prep_samples': 27},
{'files': [], 'artifact_id': 7, 'data_type': '16S',
'timestamp': '2012-10-02 17:30:00', 'target_gene': '16S rRNA',
'name': 'BIOM', 'target_subfragment': ['V4'], 'parameters': {},
'algorithm': '', 'platform': 'Illumina', 'algorithm_az': '',
'prep_samples': 27}]
'timestamp': '2012-10-02 17:30:00', 'active': True,
'target_gene': '16S rRNA', 'name': 'BIOM',
'target_subfragment': ['V4'], 'parameters': {}, 'algorithm': '',
'platform': 'Illumina', 'algorithm_az': '', 'prep_samples': 27}]
exp = {'status': 'success', 'msg': '', 'data': data}
self.assertItemsEqual(obs.keys(), exp.keys())
self.assertEqual(obs['status'], exp['status'])
Expand Down
14 changes: 7 additions & 7 deletions qiita_pet/handlers/api_proxy/tests/test_prep_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,17 +306,17 @@ def test_prep_template_graph_get_req(self):
obs['nodes'])
self.assertIn(
('artifact', 'Demultiplexed', 2,
'Demultiplexed 1\n(Demultiplexed)', 'artifact'),
'Demultiplexed 1\n(Demultiplexed)', 'deprecated'),
obs['nodes'])
self.assertIn(
('artifact', 'Demultiplexed', 3,
'Demultiplexed 2\n(Demultiplexed)', 'artifact'),
'Demultiplexed 2\n(Demultiplexed)', 'deprecated'),
obs['nodes'])
self.assertIn(('artifact', 'BIOM', 4, 'BIOM\n(BIOM)', 'artifact'),
self.assertIn(('artifact', 'BIOM', 4, 'BIOM\n(BIOM)', 'deprecated'),
obs['nodes'])
self.assertIn(('artifact', 'BIOM', 5, 'BIOM\n(BIOM)', 'artifact'),
self.assertIn(('artifact', 'BIOM', 5, 'BIOM\n(BIOM)', 'deprecated'),
obs['nodes'])
self.assertIn(('artifact', 'BIOM', 6, 'BIOM\n(BIOM)', 'artifact'),
self.assertIn(('artifact', 'BIOM', 6, 'BIOM\n(BIOM)', 'deprecated'),
obs['nodes'])
self.assertEqual(3, len([n for dt, _, _, n, _ in obs['nodes']
if n == 'Pick closed-reference OTUs' and
Expand Down Expand Up @@ -346,9 +346,9 @@ def test_prep_template_graph_get_req(self):
obs['nodes'])
self.assertIn(
('artifact', 'Demultiplexed', 2,
'Demultiplexed 1\n(Demultiplexed)', 'artifact'),
'Demultiplexed 1\n(Demultiplexed)', 'deprecated'),
obs['nodes'])
self.assertIn(('artifact', 'BIOM', 4, 'BIOM\n(BIOM)', 'artifact'),
self.assertIn(('artifact', 'BIOM', 4, 'BIOM\n(BIOM)', 'deprecated'),
obs['nodes'])
self.assertEqual(3, len([n for dt, _, _, n, _ in obs['nodes']
if n == 'Pick closed-reference OTUs' and
Expand Down
3 changes: 2 additions & 1 deletion qiita_pet/handlers/artifact_handlers/base_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ def artifact_summary_get_request(user, artifact_id):
'command': cmd.name,
'software': sw.name,
'software_version': sw.version,
'processing_parameters': proc_params.values
'processing_parameters': proc_params.values,
'software_active': sw.active
}
else:
processing_info = {}
Expand Down
21 changes: 10 additions & 11 deletions qiita_pet/handlers/artifact_handlers/tests/test_base_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,17 +227,16 @@ def test_artifact_summary_get_request(self):
'btn-sm" href="/vamps/2"><span class="glyphicon '
'glyphicon-export"></span> Submit to VAMPS</a>'),
'processing_info': {
'command': 'Split libraries FASTQ',
'software': 'QIIME',
'software_version': '1.9.1',
'processing_parameters': {
'max_barcode_errors': '1.5', 'sequence_max_n': '0',
'max_bad_run_length': '3', 'phred_offset': u'auto',
'rev_comp': 'False', 'phred_quality_threshold': '3',
'input_data': '1', 'rev_comp_barcode': 'False',
'rev_comp_mapping_barcodes': 'False',
'min_per_read_length_fraction': '0.75',
'barcode_type': u'golay_12'}},
'software_active': False, 'command': 'Split libraries FASTQ',
'processing_parameters': {
'max_barcode_errors': '1.5', 'sequence_max_n': '0',
'max_bad_run_length': '3', 'phred_offset': 'auto',
'rev_comp': 'False', 'phred_quality_threshold': '3',
'input_data': '1', 'rev_comp_barcode': 'False',
'rev_comp_mapping_barcodes': 'False',
'min_per_read_length_fraction': '0.75',
'barcode_type': 'golay_12'},
'software_version': '1.9.1', 'software': 'QIIME'},
'files': exp_files,
'is_from_analysis': False,
'summary': None,
Expand Down
12 changes: 6 additions & 6 deletions qiita_pet/handlers/study_handlers/tests/test_artifact.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,18 +168,18 @@ def test_post(self):
'data_type': '16S', 'timestamp': u'2012-10-02 17:30:00',
'platform': 'Illumina',
'algorithm_az': 'd480799a0a7a2fbe0e9022bc9c602018',
'prep_samples': 27,
'prep_samples': 27, 'active': False,
'algorithm': 'Pick closed-reference OTUs | Split libraries FASTQ',
'parameters': {
'reference': u'2', 'similarity': '0.97',
'sortmerna_e_value': '1', 'sortmerna_max_pos': '10000',
'threads': '1', 'sortmerna_coverage': '0.97'},
'reference': '2', 'similarity': '0.97', 'sortmerna_e_value': '1',
'sortmerna_max_pos': '10000', 'threads': '1',
'sortmerna_coverage': '0.97'},
'target_gene': '16S rRNA', 'name': 'BIOM'},
{'files': [], 'target_subfragment': ['V4'], 'artifact_id': 7,
'data_type': '16S', 'timestamp': '2012-10-02 17:30:00',
'platform': 'Illumina', 'algorithm_az': '', 'prep_samples': 27,
'algorithm': '', 'parameters': {}, 'target_gene': '16S rRNA',
'name': 'BIOM'}]
'active': True, 'algorithm': '', 'parameters': {},
'target_gene': '16S rRNA', u'name': u'BIOM'}]
exp = {'status': 'success', 'msg': '', 'data': data}
obs = loads(response.body)
self.assertItemsEqual(obs.keys(), exp.keys())
Expand Down
25 changes: 14 additions & 11 deletions qiita_pet/static/js/networkVue.js
Original file line number Diff line number Diff line change
Expand Up @@ -1067,15 +1067,17 @@ Vue.component('processing-graph', {
vm.countdownPoll = 15;
$('#countdown-span').html(vm.countdownPoll);
vm.colorScheme = {
'success': {border: '#00cc00', background: '#7FE57F', highlight: {border: '#00cc00', background: '#a5eda5'}},
'running': {border: '#b28500', background: '#ffbf00', highlight: {border: '#b28500', background: '#ffdc73'}},
'error': {border: '#ff3333', background: '#ff5b5b', highlight: {border: '#ff3333', background: '#ff8484'}},
'in_construction': {border: '#634a00', background: '#e59400', highlight: {border: '#634a00', background: '#efbe66'}},
'queued': {border: '#4f5b66', background: '#a7adba', highlight: {border: '#4f5b66', background: '#c0c5ce'}},
'waiting': {border: '#4f5b66', background: '#a7adba', highlight: {border: '#4f5b66', background: '#c0c5ce'}},
'artifact': {border: '#BBBBBB', background: '#FFFFFF', highlight: {border: '#999999', background: '#FFFFFF'}},
'type': {border: '#BBBBBB', background: '#CCCCCC', highlight: {border: '#999999', background: '#DDDDDD'}},
'deleting': {border: '#ff3333', background: '#ff6347', highlight: {border: '#ff3333', background: '#ff6347'}}};
'success': {border: '#00cc00', background: '#7FE57F', highlight: {border: '#00cc00', background: '#a5eda5'}, 'color': '#333333'},
'running': {border: '#b28500', background: '#ffbf00', highlight: {border: '#b28500', background: '#ffdc73'}, 'color': '#333333'},
'error': {border: '#ff3333', background: '#ff5b5b', highlight: {border: '#ff3333', background: '#ff8484'}, 'color': '#333333'},
'in_construction': {border: '#634a00', background: '#e59400', highlight: {border: '#634a00', background: '#efbe66'}, 'color': '#333333'},
'queued': {border: '#4f5b66', background: '#a7adba', highlight: {border: '#4f5b66', background: '#c0c5ce'}, 'color': '#333333'},
'waiting': {border: '#4f5b66', background: '#a7adba', highlight: {border: '#4f5b66', background: '#c0c5ce'}, 'color': '#333333'},
'artifact': {border: '#BBBBBB', background: '#FFFFFF', highlight: {border: '#999999', background: '#FFFFFF'}, 'color': '#333333'},
'type': {border: '#BBBBBB', background: '#CCCCCC', highlight: {border: '#999999', background: '#DDDDDD'}, 'color': '#333333'},
'deleting': {border: '#ff3333', background: '#ff6347', highlight: {border: '#ff3333', background: '#ff6347'}, 'color': '#333333'},
'deprecated': {border: '#000000', background: '#000000', highlight: {border: '#000000', background: '#333333'}, 'color': '#ffffff'}
};

show_loading('processing-network-div');
$("#processing-network-div").hide();
Expand All @@ -1091,9 +1093,10 @@ Vue.component('processing-graph', {
var circle_statuses = [];
var circle_types = [];
for (var circle_name in vm.colorScheme) {
var text = '<td style="padding: 5px; background-color:' + vm.colorScheme[circle_name]['background'] +
var text = '<td style="padding: 5px; color:' + vm.colorScheme[circle_name]['color'] +
'; background-color:' + vm.colorScheme[circle_name]['background'] +
';"><small>' + circle_name + '</small></td>';
if (circle_name === 'artifact' || circle_name === 'type'){
if (circle_name === 'artifact' || circle_name === 'type' || circle_name === 'deprecated'){
circle_types.push(text);
} else {
circle_statuses.push(text);
Expand Down
21 changes: 12 additions & 9 deletions qiita_pet/static/js/qiita.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,17 +314,20 @@ function format_biom_rows(data, row, for_study_list = true, samples = null) {

// grouping by processing_method, data_type and parameters
$.each(data, function (idx, info) {
if (typeof info !== 'string' && !(info instanceof String)) {
var algorithm = info.algorithm;
if (!(algorithm in processing_method)) {
processing_method[algorithm] = {};
}
// ignore the artifacts that were generated with software that is not active
if (info['active']) {
if (typeof info !== 'string' && !(info instanceof String)) {
var algorithm = info.algorithm;
if (!(algorithm in processing_method)) {
processing_method[algorithm] = {};
}

var data_type = info.data_type + ' (' + info.target_subfragment.join(', ') + ')';
if (!(data_type in processing_method[algorithm])) {
processing_method[algorithm][data_type] = [];
var data_type = info.data_type + ' (' + info.target_subfragment.join(', ') + ')';
if (!(data_type in processing_method[algorithm])) {
processing_method[algorithm][data_type] = [];
}
processing_method[algorithm][data_type].push(info);
}
processing_method[algorithm][data_type].push(info);
}
});

Expand Down
5 changes: 5 additions & 0 deletions qiita_pet/templates/artifact_ajax/artifact_summary.html
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@
<div class='row'>
<div class='col-md-12'>
<h4>
{% if processing_info and not processing_info['software_active'] %}
<div class="alert alert-warning" role="alert">
Warning, this artifact is deprecated!
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be useful to state what this means exactly for the user, either to link to a help page or to spell things out in this message.

</div>
{% end %}
<i id='summary-title'>{{name}}</i><i> (ID: {{artifact_id}}) Visibility: {{visibility}}</i>
{% if editable %}
<a class="btn btn-default btn-sm" data-toggle="modal" data-target="#update-artifact-name"><span class="glyphicon glyphicon-pencil"></span> Edit name</a>
Expand Down
10 changes: 5 additions & 5 deletions qiita_pet/test/test_prep_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,17 +90,17 @@ def test_get(self):
obs['nodes'])
self.assertIn(
['artifact', 'Demultiplexed', 2,
'Demultiplexed 1\n(Demultiplexed)', 'artifact'],
'Demultiplexed 1\n(Demultiplexed)', 'deprecated'],
obs['nodes'])
self.assertIn(
['artifact', 'Demultiplexed', 3,
'Demultiplexed 2\n(Demultiplexed)', 'artifact'],
'Demultiplexed 2\n(Demultiplexed)', 'deprecated'],
obs['nodes'])
self.assertIn(['artifact', 'BIOM', 4, 'BIOM\n(BIOM)', 'artifact'],
self.assertIn(['artifact', 'BIOM', 4, 'BIOM\n(BIOM)', 'deprecated'],
obs['nodes'])
self.assertIn(['artifact', 'BIOM', 5, 'BIOM\n(BIOM)', 'artifact'],
self.assertIn(['artifact', 'BIOM', 5, 'BIOM\n(BIOM)', 'deprecated'],
obs['nodes'])
self.assertIn(['artifact', 'BIOM', 6, 'BIOM\n(BIOM)', 'artifact'],
self.assertIn(['artifact', 'BIOM', 6, 'BIOM\n(BIOM)', 'deprecated'],
obs['nodes'])
self.assertEqual(3, len([n for dt, _, _, n, _ in obs['nodes']
if n == 'Pick closed-reference OTUs' and
Expand Down
Loading