Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
138 commits
Select commit Hold shift + click to select a range
0c9598b
fix #1067
antgonza Feb 20, 2018
58858ae
addressing @ElDeveloper comments
antgonza Feb 21, 2018
82c546a
Merge pull request #2507 from antgonza/fix-1067
wasade Feb 22, 2018
cbebd76
fix #2512
antgonza Feb 23, 2018
7659c88
fix #1999 (#2514)
antgonza Feb 23, 2018
617831b
addressing @ElDeveloper comments
antgonza Feb 23, 2018
ff87431
Merge branch 'master' of https://github.com/biocore/qiita into dev
antgonza Feb 23, 2018
b1924c3
Merge branch 'dev' of https://github.com/biocore/qiita into dev
antgonza Feb 23, 2018
7462867
adding secret
antgonza Feb 23, 2018
0994537
Merge pull request #2515 from antgonza/fix-2512
Mar 7, 2018
7b63710
WIP: EBI-ENA test (#2516)
antgonza Mar 7, 2018
bb3cd2f
fix secure
antgonza Mar 7, 2018
baf7739
rm single quote
antgonza Mar 7, 2018
5e0f643
upstrem dev
antgonza Mar 7, 2018
ae5d1a3
Fix 2321 (#2522)
antgonza Mar 8, 2018
1d54381
Merge branch 'dev' of https://github.com/biocore/qiita into dev
antgonza Apr 3, 2018
4ba96ab
Illumina models 0318 (#2532)
antgonza Apr 3, 2018
6a06964
adding secure
antgonza Apr 3, 2018
b9a2cba
Merge branch 'dev' of https://github.com/biocore/qiita into dev
antgonza Apr 4, 2018
232c21a
Update index.rst (#2533)
stephanieorch Apr 4, 2018
56aaeac
Plugin API Doc (#2534)
antgonza Apr 4, 2018
2dcdd93
Fix 1810 (#2523)
antgonza Apr 4, 2018
caee66e
DOC: Cleanup of JavaScript libraries and licenses (#2536)
ElDeveloper Apr 4, 2018
39cc48d
Merge branch 'dev' of https://github.com/biocore/qiita into dev
antgonza Apr 5, 2018
b268a42
adding initial download/redbiom info
antgonza Apr 5, 2018
77af7fd
adding docs
antgonza Apr 5, 2018
c1c8e9b
addressing @ElDeveloper comments
antgonza Apr 5, 2018
e7c5832
Fix aid str workflow (#2537)
antgonza Apr 5, 2018
d1d5e44
Merge branch 'dev' of https://github.com/biocore/qiita into dev
antgonza Apr 5, 2018
e356545
fix #2519
antgonza Apr 5, 2018
3799456
fix #2524
antgonza Apr 5, 2018
b510802
fix #2531
antgonza Apr 6, 2018
cc404e0
fix #2529
antgonza Apr 6, 2018
7bad458
split qiita-cron-job into multiple commands
antgonza Apr 6, 2018
eb62b96
rm leftover docs
antgonza Apr 6, 2018
5d53cde
Merge pull request #2540 from antgonza/fix-2524
Apr 6, 2018
d6293b4
Merge pull request #2542 from antgonza/fix-2529
adswafford Apr 6, 2018
af7469b
Merge pull request #2541 from antgonza/fix-2531
adswafford Apr 6, 2018
03ec61b
Merge pull request #2539 from antgonza/fix-2519
adswafford Apr 6, 2018
4672d2c
Update downloading.rst
stephanieorch Apr 6, 2018
3c6416e
fix_reference_order (#2547)
stephanieorch Apr 6, 2018
2437e4f
addressing @stephanieorch comments
antgonza Apr 6, 2018
ed78f0a
addressing @ElDeveloper comments
antgonza Apr 6, 2018
f9ed95f
Fix 2492 (#2544)
antgonza Apr 6, 2018
a9ba0e5
Redbiom -> redbiom @wasade
antgonza Apr 6, 2018
6d72398
addressing @wasade comments
antgonza Apr 6, 2018
59b9bcb
Update .travis.yml
antgonza Apr 6, 2018
9f7e186
Fix 2505 (#2545)
antgonza Apr 7, 2018
2a2cce7
Merge pull request #2543 from antgonza/split-qiita-cron-job
Apr 7, 2018
9f8ab39
Merge pull request #2538 from antgonza/doc-redbiom-download
Apr 7, 2018
2c8b4c6
Fix 2530 (#2546)
antgonza Apr 7, 2018
51986a1
fix-secure
antgonza Apr 7, 2018
d701b81
improve available files display
antgonza Apr 15, 2018
aef0e50
update to master
antgonza May 1, 2018
13c43af
Merge branch 'master' of https://github.com/biocore/qiita into dev
antgonza May 2, 2018
86dcd77
fix flake8
antgonza May 2, 2018
1cc4315
Merge pull request #2577 from antgonza/upstream-master-0502018
tanaes May 2, 2018
3aae997
fix #2580 (#2584)
antgonza May 16, 2018
ab7c8d3
fix #2581 (#2583)
antgonza May 16, 2018
60af7f6
fixed analysis page figure (#2578)
stephanieorch May 16, 2018
981cebc
fix #2570 (#2586)
antgonza May 16, 2018
fc52463
fix #2590
antgonza May 21, 2018
434f782
Merge pull request #2592 from antgonza/fix-2590
May 22, 2018
29c2f10
improve sample summary speed (#2591)
antgonza May 22, 2018
f7b6186
fix #2562 (#2588)
antgonza May 22, 2018
a07bfe1
Fix 2565 (#2587)
antgonza May 22, 2018
481928d
fix #2574 (#2585)
antgonza May 22, 2018
8df5989
adding qiimp via iframes (#2582)
antgonza May 22, 2018
072e926
allow to hide job via GUI (#2593)
antgonza May 22, 2018
90a88d9
Fix upload and faq page (#2594)
antgonza May 22, 2018
6afb10a
fixing bugs found during initial review
antgonza May 25, 2018
2ce85a8
Merge pull request #2596 from antgonza/fix-deploy-errors-rc-052518
May 25, 2018
679528b
fix bug in delete column sample template (#2597)
antgonza May 25, 2018
011b339
Merge branch 'release-candidate' of https://github.com/biocore/qiita …
antgonza May 30, 2018
5e34afe
Add qiimp xlsx (#2599)
antgonza Jun 4, 2018
056389f
Merge branch 'release-candidate' of https://github.com/biocore/qiita …
antgonza Jun 11, 2018
935c321
rm qiimp link
antgonza Jun 11, 2018
6803da8
Rm qiimp link (#2603)
antgonza Jun 11, 2018
2476274
fix #2606
antgonza Jun 11, 2018
dcbb643
solving conflicts
antgonza Jun 11, 2018
d8aa5e1
fix conflicts
antgonza Jun 25, 2018
f9bd633
Merge branch 'dev' of https://github.com/biocore/qiita into dev
antgonza Jun 28, 2018
c017536
Merge branch 'dev' of https://github.com/biocore/qiita into dev
antgonza Jul 2, 2018
fe7331a
select all/none from upload
antgonza Jul 2, 2018
6a25454
Merge pull request #2615 from antgonza/fix-2598
Jul 3, 2018
5834489
upstream dev
antgonza Jul 3, 2018
efc5b62
fix #2610 (#2616)
antgonza Jul 5, 2018
5be9c99
fix #2602
antgonza Jul 5, 2018
0ce0ac8
fix #2601 (#2617)
antgonza Jul 6, 2018
e4af992
Merge branch 'dev' of https://github.com/biocore/qiita into fix-2606
antgonza Jul 6, 2018
73df73e
adding ChangeLog message
antgonza Jul 6, 2018
1c732c1
TRAVIS_PULL_REQUEST -> TRAVIS_BRANCH
antgonza Jul 6, 2018
94bb8e4
Merge pull request #2618 from antgonza/fix-2602
adswafford Jul 6, 2018
22cd247
addressing @adswafford comment
antgonza Jul 6, 2018
58e07e6
Merge pull request #2607 from antgonza/fix-2606
adswafford Jul 6, 2018
0095284
add ignore parent for command merging scheme (#2619)
antgonza Jul 6, 2018
3609ea9
adding get_validator_jobs (#2620)
antgonza Jul 6, 2018
cd3061e
fixes #2629 changed button text from Select None to Unselect All (#2631)
ryanusahk Jul 24, 2018
dcdc24b
Labman minimal changes (#2633)
antgonza Jul 26, 2018
c787682
rm QiitaStudySearch (#2638)
antgonza Aug 15, 2018
308c86d
Fix 2635 (#2639)
antgonza Aug 16, 2018
c5a2ac3
fix #2627 (#2640)
antgonza Aug 16, 2018
b3a7af3
adds UsersListDBHandler (#2636)
antgonza Aug 17, 2018
a78d7be
upstream master 0618
antgonza Aug 17, 2018
5e3b603
Merge branch 'dev' of https://github.com/biocore/qiita into dev
antgonza Aug 17, 2018
c75e17e
fix #2632 (#2643)
antgonza Aug 20, 2018
6f448f3
fix #2608
antgonza Aug 21, 2018
70bca50
fix #2600
antgonza Aug 28, 2018
fc2d88a
Merge pull request #2645 from antgonza/fix-2608
Aug 28, 2018
99598cf
Merge pull request #2647 from antgonza/fix-2600
Aug 28, 2018
000c423
fix #2622 (#2646)
antgonza Aug 29, 2018
03883e1
Fix 2623 (#2644)
antgonza Aug 29, 2018
28e897e
Add specimen_id attribute to the study object (#2649)
ElDeveloper Aug 30, 2018
aad650a
fix #2651 and partial #2652
antgonza Aug 31, 2018
9797a1a
Fixes #2398
Sep 1, 2018
ad34d04
Resolving conflict with another new patch file.
Sep 1, 2018
c73bd55
Merge branch 'dev' of http://github.com/biocore/qiita into dev
Sep 4, 2018
8aed862
Rename file
Sep 4, 2018
f6cfb15
67.py renamed to 66.py. minor edit to edit_study.html
Sep 4, 2018
043f5eb
Update study title only if UTF-8 characters were removed.
Sep 4, 2018
1bd63f8
Merge pull request #2657 from antgonza/fix-2651
adswafford Sep 5, 2018
c723359
Scp (#2660)
antgonza Sep 5, 2018
7b5f42d
Merge branch 'dev' of http://github.com/biocore/qiita into dev
Sep 5, 2018
6b099ca
UTF-8 stripper now processes all study-types.
Sep 10, 2018
ebd99b0
66.py now passes flake8 tests.
Sep 10, 2018
2682c91
Merge branch 'dev' of https://github.com/biocore/qiita into dev
Sep 26, 2018
34aca8b
Additional Processing Command functionality
Oct 5, 2018
85ae011
Additional Processing Command functionality
Oct 5, 2018
15aad87
Fixed bug
Oct 5, 2018
b8337eb
Pass flake8
Oct 5, 2018
4f97e8b
Fix _method in Click
Oct 5, 2018
455b88f
Specified Click 6.7 as a dependency
Oct 5, 2018
bf45f0e
Misc cleanup
Oct 7, 2018
93efdb6
Modified qiita-db.dbs
Oct 7, 2018
1ed506d
Added comment metadata to new column.
Oct 7, 2018
50cf38a
Refined tests
Oct 7, 2018
b1e0f8b
Replaced Qtest w/_test
Oct 7, 2018
6b49822
Reverted functions beginning w/Q to '_'.
Oct 8, 2018
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: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ install:
'pandas>=0.18' 'matplotlib>=1.1.0' 'scipy>0.13.0' 'numpy>=1.7' 'h5py>=2.3.1'
- source activate qiita
- pip install -U pip
- pip install sphinx sphinx-bootstrap-theme nose-timer codecov
- pip install sphinx sphinx-bootstrap-theme nose-timer codecov 'Click==6.7'
- 'echo "backend: Agg" > matplotlibrc'
- git clone https://github.com/nicolasff/webdis
- pushd webdis
Expand Down
18 changes: 18 additions & 0 deletions qiita_db/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,8 @@ def build_files(self, merge_duplicated_sample_ids):
# are going to create
rename_dup_samples = False
grouped_samples = {}

addtl_processing_cmd = {}
for aid, asamples in viewitems(samples):
# find the artifat info, [0] there should be only 1 info
ainfo = [bi for bi in bioms_info
Expand All @@ -847,6 +849,11 @@ def build_files(self, merge_duplicated_sample_ids):

label = "%s || %s" % (data_type, ainfo['algorithm'])
if label not in grouped_samples:
aparams = qdb.artifact.Artifact(aid).processing_parameters
if aparams is not None:
fam = aparams.command.addtl_processing_cmd
if fam is not None:
addtl_processing_cmd[label] = fam
grouped_samples[label] = []
grouped_samples[label].append((aid, asamples))
# 2. if rename_dup_samples is still False, make sure that we don't
Expand All @@ -872,6 +879,11 @@ def build_files(self, merge_duplicated_sample_ids):
biom_files = self._build_biom_tables(
grouped_samples, rename_dup_samples)

# if values for addtl_processing_cmd were found, return them as
# well, if only to allow for testing.
if addtl_processing_cmd:
return (biom_files, addtl_processing_cmd)

return biom_files

def _build_biom_tables(self, grouped_samples, rename_dup_samples=False):
Expand Down Expand Up @@ -934,16 +946,22 @@ def _build_biom_tables(self, grouped_samples, rename_dup_samples=False):
"analysis due to rarefaction level")

# write out the file
# data_type and algorithm values become part of the file
# name(s).
data_type = sub('[^0-9a-zA-Z]+', '', data_type)
algorithm = sub('[^0-9a-zA-Z]+', '', algorithm)
info = "%s_%s" % (data_type, algorithm)
fn = "%d_analysis_%s.biom" % (self._id, info)
biom_fp = join(base_fp, fn)
# save final biom here
with biom_open(biom_fp, 'w') as f:
new_table.to_hdf5(
f, "Generated by Qiita, analysis id: %d, info: %s" % (
self._id, label))
biom_files.append((data_type, biom_fp))

# return the biom files, either with or without needed tree, to
# the user.
return biom_files

def _build_mapping_file(self, samples, rename_dup_samples=False):
Expand Down
37 changes: 37 additions & 0 deletions qiita_db/software.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,18 @@ class Command(qdb.base.QiitaObject):

Attributes
----------
active
addtl_processing_cmd
analysis_only
default_parameter_sets
description
merging_scheme
name
naming_order
optional_parameters
outputs
parameters
required_parameters
software
name
description
Expand All @@ -35,7 +47,16 @@ class Command(qdb.base.QiitaObject):

Methods
-------
_check_id
activate

Class Methods
-------------
create
exists
get_commands_by_input_type(cls, artifact_types, active_only=True,
get_html_generator(cls, artifact_type):
get_validator(cls, artifact_type):

See Also
--------
Expand Down Expand Up @@ -445,6 +466,22 @@ def name(self):
qdb.sql_connection.TRN.add(sql, [self.id])
return qdb.sql_connection.TRN.execute_fetchlast()

@property
def addtl_processing_cmd(self):
"""Additional processing commands required for merging

Returns
-------
str
Returns the additional processing command for merging
"""
with qdb.sql_connection.TRN:
sql = """SELECT addtl_processing_cmd
FROM qiita.software_command
WHERE command_id = %s"""
qdb.sql_connection.TRN.add(sql, [self.id])
return qdb.sql_connection.TRN.execute_fetchlast()

@property
def description(self):
"""The description of the command
Expand Down
6 changes: 6 additions & 0 deletions qiita_db/support_files/patches/67.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
-- October 6, 2018
-- add addtl_processing_cmd column to record additional information required to merge some BIOMS.

ALTER TABLE qiita.software_command ADD addtl_processing_cmd varchar;

COMMENT ON COLUMN qiita.software_command.addtl_processing_cmd IS 'Store information on additional processes to merge BIOMs, if any.';
5 changes: 4 additions & 1 deletion qiita_db/support_files/qiita-db.dbs
Original file line number Diff line number Diff line change
Expand Up @@ -1307,6 +1307,9 @@
<column name="ignore_parent_command" type="bool" jt="-7" mandatory="y" >
<defo>false</defo>
</column>
<column name="addtl_processing_cmd" type="varchar" jt="12">
<comment><![CDATA[Store information on additional processes to merge BIOMs, if any.]]></comment>
</column>
<index name="pk_soft_command" unique="PRIMARY_KEY" >
<column name="command_id" />
</index>
Expand Down Expand Up @@ -1854,4 +1857,4 @@ ALTER TABLE oauth_software ADD CONSTRAINT fk_oauth_software FOREIGN KEY ( client
]]></string>
</script>
Copy link
Member

Choose a reason for hiding this comment

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

This is no right, correct? There should have been changes in this file, cause we added a new column. Could you double check?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just added a line. Just to clarify, this is an internal format right? I don't see a schema reference at the top.

Copy link
Member

Choose a reason for hiding this comment

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

I think is fine now but here is more information: https://github.com/biocore/qiita/blob/master/CONTRIBUTING.md#making-database-changes, will wait for confirmation.

</layout>
</project>
</project>
11 changes: 9 additions & 2 deletions qiita_db/support_files/qiita-db.html
Original file line number Diff line number Diff line change
Expand Up @@ -1911,6 +1911,8 @@
<use id='nn' x='2162' y='1332' xlink:href='#nn'/><a xlink:href='#software_command.active'><text x='2178' y='1342'>active</text><title>active bool not null default &#039;True&#039;</title></a>
<use id='nn' x='2162' y='1347' xlink:href='#nn'/><a xlink:href='#software_command.is_analysis'><text x='2178' y='1357'>is_analysis</text><title>is_analysis bool not null default &#039;False&#039;</title></a>
<use id='nn' x='2162' y='1362' xlink:href='#nn'/><a xlink:href='#software_command.ignore_parent_command'><text x='2178' y='1372'>ignore_parent_command</text><title>ignore_parent_command bool not null default false</title></a>
<use id='nn' x='2162' y='1377' xlink:href='#nn'/><a xlink:href='#software_command.addtl_processing_cmd'><text x='2178' y='1387'>addtl_processing_cmd</text><title>addtl_processing_cmd varchar
Store information on additional processes to merge BIOMs, if any.</title></a>

<!-- ============= Table 'processing_job_validator' ============= -->
<rect class='table' x='2160' y='1403' width='150' height='90' rx='7' ry='7' />
Expand Down Expand Up @@ -5722,6 +5724,12 @@
<td> bool DEFO false </td>
<td> </td>
</tr>
<tr>
<td>*</td>
<td><a name='software_command.addtl_processing_cmd'>addtl&#095;processing&#095;cmd</a></td>
<td> varchar </td>
<td>Store information on additional processes to merge BIOMs, if any.</td>
</tr>
<tr><th colspan='4'><b>Indexes</b></th></tr>
<tr> <td>Pk</td><td>pk&#095;soft&#095;command</td>
<td> ON command&#095;id</td>
Expand Down Expand Up @@ -6176,5 +6184,4 @@
</tr>
</tbody>
</table>

</body></html>
</body></html>
38 changes: 37 additions & 1 deletion qiita_db/test/test_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def _create_analyses_with_samples(self, user='demo@microbio.me',
Parameters
----------
user : qiita_db.user.User, optional
The user email to attach the analysis. Default: demo@microbio.me
The user email to attach to the analysis. Default: demo@microbio.me
merge : bool, optional
Merge duplicated ids or not

Expand All @@ -91,14 +91,17 @@ def _create_analyses_with_samples(self, user='demo@microbio.me',
"""
user = qdb.user.User(user)
dflt_analysis = user.default_analysis

dflt_analysis.add_samples(
{4: ['1.SKB8.640193', '1.SKD8.640184', '1.SKB7.640196',
'1.SKM9.640192', '1.SKM4.640180']})

new = qdb.analysis.Analysis.create(
user, "newAnalysis", "A New Analysis", from_default=True,
merge_duplicated_sample_ids=merge)

self._wait_for_jobs(new)

return new

def test_lock_samples(self):
Expand Down Expand Up @@ -512,6 +515,39 @@ def test_build_files(self):
'1.SKB8.640193', '1.SKB7.640196']
self.assertItemsEqual(biom_ids, exp)

def test_build_files_addtl_processing_cmd(self):
tmp = qdb.artifact.Artifact(4).processing_parameters.command
cmd_id = tmp.id

# set a known artifact's additional processing command
# to a known value. Then test for it.
with qdb.sql_connection.TRN:
sql = """UPDATE qiita.software_command
SET addtl_processing_cmd = 'ls'
WHERE command_id = %s""" % cmd_id
qdb.sql_connection.TRN.add(sql, [cmd_id])
qdb.sql_connection.TRN.execute()

analysis = self._create_analyses_with_samples()
results = npt.assert_warns(
qdb.exceptions.QiitaDBWarning, analysis.build_files, False)

# if build_files used additional processing commands, it will
# return a tuple, where the second element is a dictionary of
# the commands used.
# biom_tables = results[0]
addtl_processing_cmds = results[1]
for k in addtl_processing_cmds:
self.assertItemsEqual('ls', addtl_processing_cmds[k])

# cleanup (assume command was NULL previously)
with qdb.sql_connection.TRN:
sql = """UPDATE qiita.software_command
SET addtl_processing_cmd = NULL
WHERE command_id = %s""" % cmd_id
qdb.sql_connection.TRN.add(sql, [cmd_id])
qdb.sql_connection.TRN.execute()

def test_build_files_merge_duplicated_sample_ids(self):
user = qdb.user.User("demo@microbio.me")
dflt_analysis = user.default_analysis
Expand Down
24 changes: 24 additions & 0 deletions qiita_db/test/test_software.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,30 @@ def test_name(self):
self.assertEqual(qdb.software.Command(1).name, "Split libraries FASTQ")
self.assertEqual(qdb.software.Command(2).name, "Split libraries")

def test_addtl_processing_cmd(self):
# initial test
self.assertEqual(qdb.software.Command(1).addtl_processing_cmd, None)

# modify table directly, in order to test method
with qdb.sql_connection.TRN:
sql = """UPDATE qiita.software_command
SET addtl_processing_cmd = 'ls'
WHERE command_id = 1"""
qdb.sql_connection.TRN.add(sql, [1])
qdb.sql_connection.TRN.execute()

# test method returns 'ls'
self.assertEqual(qdb.software.Command(1).addtl_processing_cmd, 'ls')

# clean up table
with qdb.sql_connection.TRN:
sql = """UPDATE qiita.software_command
SET addtl_processing_cmd = NULL
WHERE command_id = 1"""
qdb.sql_connection.TRN.add(sql, [1])
qdb.sql_connection.TRN.execute()
self.assertEqual(qdb.software.Command(1).addtl_processing_cmd, None)

def test_description(self):
self.assertEqual(
qdb.software.Command(1).description,
Expand Down