Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
66265df
nose-timer to pip command
antgonza Jun 16, 2017
304e2e4
improving study listing // artifact info
antgonza Jun 18, 2017
c97c34a
adding code to both list
antgonza Jun 18, 2017
82d9798
fix js length
antgonza Jun 18, 2017
dce947e
Merge branch 'improving-tests' of https://github.com/antgonza/qiita i…
antgonza Jun 19, 2017
ddd724a
improving sql and display
antgonza Jun 20, 2017
73dd5ca
Merge branch 'analysis-refactor' of https://github.com/biocore/qiita …
antgonza Jun 20, 2017
c295635
improving sql
antgonza Jun 21, 2017
c239b5a
adding some of the requested improvements
antgonza Jun 21, 2017
2b405d9
addressing comments
antgonza Jun 22, 2017
736f347
addressing @ElDeveloper and @wasade comments
antgonza Jun 23, 2017
cc18c3c
Merge branch 'analysis-refactor' of https://github.com/biocore/qiita …
antgonza Jun 26, 2017
fd4a8d6
Merge branch 'analysis-refactor' of https://github.com/biocore/qiita …
antgonza Jun 27, 2017
86f7bbc
fixing tests
antgonza Jul 2, 2017
983d606
adding ORDER
antgonza Jul 3, 2017
cca49c3
to debug
antgonza Jul 3, 2017
37092a9
Merge branch 'analysis-refactor' of https://github.com/biocore/qiita …
antgonza Jul 4, 2017
2112607
Merge branch 'analysis-refactor' of https://github.com/biocore/qiita …
antgonza Jul 4, 2017
c1e468b
update upstream
antgonza Jul 4, 2017
26e4734
fix tests
antgonza Jul 4, 2017
98b293d
to debug
antgonza Jul 4, 2017
561e837
Merge branch 'analysis-refactor' of https://github.com/biocore/qiita …
antgonza Jul 7, 2017
65f741a
Merge branch 'analysis-refactor' of https://github.com/biocore/qiita …
antgonza Jul 7, 2017
03e9f55
fixing errors 1
antgonza Jul 8, 2017
2d53fea
missing ]
antgonza Jul 8, 2017
44ab61f
fix error
antgonza Jul 8, 2017
b114500
barcode_type 8, defaults
antgonza Jul 8, 2017
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
135 changes: 55 additions & 80 deletions qiita_db/test/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -801,98 +801,73 @@ def test_generate_study_list(self):
qdb.user.User('shared@foo.bar'), 'test_study_1', efo=[1],
info=info)

exp_info = [{
'metadata_complete': True,
'ebi_submission_status': 'submitted',
'shared': [('shared@foo.bar', 'Shared')],
'pi': ('PI_dude@foo.bar', 'PIDude'),
'status': 'private',
'proc_data_info': [],
'publication_doi': ['10.100/123456', '10.100/7891011'],
'publication_pid': ['123456', '7891011'],
'study_abstract': (
exp_info = [
{'status': 'private', 'metadata_complete': True,
'study_tags': None, 'publication_doi': [
'10.100/123456', '10.100/7891011'],
'study_title': ('Identification of the Microbiomes for '
'Cannabis Soils'),
'publication_pid': ['123456', '7891011'],
'ebi_submission_status': 'submitted', 'study_id': 1,
'ebi_study_accession': 'EBI123456-BB',
'shared': [('shared@foo.bar', 'Shared')],
'study_abstract': (
'This is a preliminary study to examine the microbiota '
'associated with the Cannabis plant. Soils samples from '
'the bulk soil, soil associated with the roots, and the '
'rhizosphere were extracted and the DNA sequenced. Roots '
'from three independent plants of different strains were '
'examined. These roots were obtained November 11, 2011 from '
'plants that had been harvested in the summer. Future studies '
'will attempt to analyze the soils and rhizospheres from the '
'same location at different time points in the plant '
'lifecycle.'),
'study_id': 1,
'ebi_study_accession': 'EBI123456-BB',
'study_title': ('Identification of the Microbiomes for Cannabis '
'Soils'),
'number_samples_collected': 27,
'study_tags': None
}, {
'metadata_complete': True,
'ebi_submission_status': 'not submitted', 'publication_pid': [],
'study_abstract': 'Some abstract goes here',
'pi': ('lab_dude@foo.bar', 'LabDude'), 'status': 'sandbox',
'proc_data_info': [], 'study_tags': None, 'shared': [],
'publication_doi': [], 'study_id': new_study.id,
'ebi_study_accession': None, 'study_title': 'test_study_1',
'number_samples_collected': 0}]
'associated with the Cannabis plant. Soils samples from the '
'bulk soil, soil associated with the roots, and the '
'rhizosphere were extracted and the DNA sequenced. Roots from '
'three independent plants of different strains were examined. '
'These roots were obtained November 11, 2011 from plants that '
'had been harvested in the summer. Future studies will '
'attempt to analyze the soils and rhizospheres from the same '
'location at different time points in the plant lifecycle.'),
'pi': ('PI_dude@foo.bar', 'PIDude'),
'artifact_biom_ids': [4, 5, 6, 7],
'number_samples_collected': 27},
{'status': 'sandbox', 'metadata_complete': True,
'study_tags': None, 'publication_doi': [],
'study_title': 'test_study_1', 'publication_pid': [],
'ebi_submission_status': 'not submitted',
'study_id': new_study.id, 'ebi_study_accession': None,
'shared': [], 'study_abstract': 'Some abstract goes here',
'pi': ('lab_dude@foo.bar', 'LabDude'),
'artifact_biom_ids': None, 'number_samples_collected': 0}]
obs_info = qdb.util.generate_study_list([1, 2, 3, 4], True)
self.assertEqual(obs_info, exp_info)

qdb.artifact.Artifact(4).visibility = 'public'
exp_info[0]['status'] = 'public'
exp_info[0]['proc_data_info'] = [
{'data_type': '18S', 'name': 'BIOM',
'algorithm': 'QIIME v1.9.1 (Pick closed-reference OTUs)',
'pid': 4, 'processed_date': '2012-10-02 17:30:00',
'params': {'similarity': 0.97, 'reference_name': 'Greengenes',
'sortmerna_e_value': 1, u'sortmerna_max_pos': 10000,
'threads': 1, u'sortmerna_coverage': 0.97,
'reference_version': '13_8'}},
{'data_type': '18S', 'name': 'BIOM',
'algorithm': 'QIIME v1.9.1 (Pick closed-reference OTUs)',
'pid': 5, 'processed_date': '2012-10-02 17:30:00',
'params': {'similarity': 0.97, 'reference_name': 'Greengenes',
'sortmerna_e_value': 1, u'sortmerna_max_pos': 10000,
'threads': 1, 'sortmerna_coverage': 0.97,
'reference_version': '13_8'}},
{'data_type': '16S', 'name': 'BIOM',
'algorithm': 'QIIME v1.9.1 (Pick closed-reference OTUs)',
'pid': 6, 'processed_date': '2012-10-02 17:30:00',
'params': {'similarity': 0.97, 'reference_name': 'Silva',
'sortmerna_e_value': 1, u'sortmerna_max_pos': 10000,
'threads': 1, 'sortmerna_coverage': 0.97,
'reference_version': 'test'}}]
obs_info = qdb.util.generate_study_list([1, 2, 3, 4], True)
self.assertEqual(obs_info, exp_info)

exp_info[0]['proc_data_info'] = [
{'data_type': '18S', 'name': 'BIOM',
'algorithm': 'QIIME v1.9.1 (Pick closed-reference OTUs)',
'pid': 4, 'processed_date': '2012-10-02 17:30:00',
'params': {'similarity': 0.97, 'reference_name': 'Greengenes',
'sortmerna_e_value': 1, u'sortmerna_max_pos': 10000,
'threads': 1, 'sortmerna_coverage': 0.97,
'reference_version': '13_8'}},
{'data_type': '18S', 'name': 'BIOM',
'algorithm': 'QIIME v1.9.1 (Pick closed-reference OTUs)',
'pid': 5, 'processed_date': '2012-10-02 17:30:00',
'params': {'similarity': 0.97, 'reference_name': 'Greengenes',
'sortmerna_e_value': 1, u'sortmerna_max_pos': 10000,
'threads': 1, 'sortmerna_coverage': 0.97,
'reference_version': '13_8'}},
{'data_type': '16S', 'name': 'BIOM',
'algorithm': 'QIIME v1.9.1 (Pick closed-reference OTUs)',
'pid': 6, 'processed_date': '2012-10-02 17:30:00',
'params': {'similarity': 0.97, 'reference_name': 'Silva',
'sortmerna_e_value': 1, u'sortmerna_max_pos': 10000,
'threads': 1, 'sortmerna_coverage': 0.97,
'reference_version': 'test'}},
{'processed_date': '2012-10-02 17:30:00', 'pid': 7, 'name': 'BIOM',
'data_type': '16S'}]
obs_info = qdb.util.generate_study_list([1, 2, 3, 4], False)
self.assertEqual(obs_info, exp_info)

def test_get_artifacts_bioms_information(self):
# we are gonna test that it ignores 1 and 2 cause they are not biom,
# 4 has all information and 7 and 8 don't
obs = qdb.util.get_artifacts_bioms_information([1, 2, 4, 7, 8])
# not testing timestamp
for i in range(len(obs)):
del obs[i]['timestamp']

exp = [
{'files': ['1_study_1001_closed_reference_otu_table.biom'],
'target_subfragment': ['V4'], 'data_type': '18S',
'parameters': {
'reference': 1, 'similarity': 0.97, 'sortmerna_e_value': 1,
'sortmerna_max_pos': 10000, 'input_data': 2, 'threads': 1,
'sortmerna_coverage': 0.97}, 'name': 'BIOM',
'algorithm': ('Pick closed-reference OTUs, QIIMEv1.9.1 '
'| barcode_type 8, defaults'), 'artifact_id': 4},
{'files': [], 'target_subfragment': ['V4'], 'data_type': '16S',
'parameters': {}, 'name': 'BIOM', 'algorithm': '',
'artifact_id': 7},
{'files': ['biom_table.biom'], 'target_subfragment': [],
'data_type': '18S', 'parameters': {}, 'name': 'noname',
'algorithm': '', 'artifact_id': 8}]
self.assertEqual(obs, exp)


if __name__ == '__main__':
main()
Loading