Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
207 commits
Select commit Hold shift + click to select a range
6f4a557
Modifying config files and parser
josenavas Feb 19, 2016
f65d6bf
Merge branch 'subdir-portals' of https://github.com/biocore/qiita int…
antgonza Feb 19, 2016
ff36f09
Addressing comments
josenavas Feb 19, 2016
17042b9
fixing some files!
antgonza Feb 19, 2016
f0271e8
Fixing parser
josenavas Feb 19, 2016
6bd9d31
Merge branch 'master' of https://github.com/biocore/qiita into subdir…
josenavas Feb 19, 2016
60c50e8
Merge branch 'subdir-portals' of https://github.com/biocore/qiita int…
antgonza Feb 19, 2016
a0ab325
update sitebase for portals
squirrelo Feb 19, 2016
23afbde
move to raw output
squirrelo Feb 19, 2016
b3fc0a1
addressing @squirrelo comments
antgonza Feb 19, 2016
e5bae74
update error_log
squirrelo Feb 19, 2016
71e8383
update list_studies
squirrelo Feb 19, 2016
de2b96b
fixing some files!
antgonza Feb 19, 2016
731d62c
Merge pull request #1649 from antgonza/subdir-portals-agp
josenavas Feb 19, 2016
65c1d8d
Merge pull request #1650 from squirrelo/portal-updates-1
josenavas Feb 19, 2016
d4e544a
Fixing form in error_log.html
josenavas Feb 19, 2016
9e28c90
Merge pull request #1651 from squirrelo/portal-updates-2
josenavas Feb 19, 2016
b7ea47e
Merge branch 'subdir-portals' of https://github.com/biocore/qiita int…
josenavas Feb 19, 2016
78bc774
Fixing various files
josenavas Feb 19, 2016
f4a1ce1
More files
josenavas Feb 19, 2016
9d0d57d
Fixing study description templates
josenavas Feb 19, 2016
31acb67
Merge pull request #1655 from josenavas/subdir-portals-misc
antgonza Feb 20, 2016
a10e4af
Fixing comments
josenavas Feb 20, 2016
427f866
Adding missing import
josenavas Feb 20, 2016
48094b8
Merge pull request #1656 from josenavas/subdir-portals-2
antgonza Feb 20, 2016
593dbee
Merge pull request #1654 from josenavas/portal-updates-2
antgonza Feb 20, 2016
4981f03
Merge pull request #1652 from antgonza/subdir-portals-agp-1
josenavas Feb 20, 2016
e02ec12
Merge pull request #1657 from josenavas/subdir-portals-study-desc-tem…
antgonza Feb 20, 2016
18fdd3a
Fixing merge conflict
josenavas Feb 23, 2016
a8f8271
Fixing link in list_studies
josenavas Feb 23, 2016
690106f
Adding setUp to TestSearchStudiesAJAX
josenavas Feb 23, 2016
afcd709
Adding a test to TestSearchStudiesAJAX with different portal
josenavas Feb 23, 2016
ff469b9
Changing url in email sent to the user
josenavas Feb 24, 2016
4689470
Fixing link in sitebase.html
josenavas Feb 24, 2016
bbe27ca
Fixing moi call in analysis
josenavas Feb 25, 2016
11372c8
Fixing login_url in webserver config
josenavas Feb 25, 2016
a55fb93
Merge branch 'subdir-portals-missing' of https://github.com/josenavas…
antgonza Feb 29, 2016
030f397
Merge pull request #1662 from josenavas/subdir-portals-missing
antgonza Feb 29, 2016
c23fcee
solving rest of issues
antgonza Mar 1, 2016
6c933fb
Merge pull request #1670 from antgonza/fixing-portals
josenavas Mar 1, 2016
8ab30b5
some more minor fixes
antgonza Mar 2, 2016
d1c5468
Merge pull request #1673 from antgonza/fixing-portals-1
josenavas Mar 2, 2016
b7a438f
Make travis run the plugin tests
josenavas Mar 22, 2016
b441801
Adding httpretty to the installation
josenavas Mar 22, 2016
e8d468f
Fixing travis - again
josenavas Mar 22, 2016
a8d4a6e
Third...
josenavas Mar 22, 2016
6f4e206
Maybe now?
josenavas Mar 22, 2016
f8f53fd
Merge branch 'artifact-study-pages-travis' of https://github.com/jose…
antgonza Mar 22, 2016
56112bb
testing ls
antgonza Mar 22, 2016
57a2aac
just testing plugins
antgonza Mar 22, 2016
ed42f06
using pip HTTPretty
antgonza Mar 22, 2016
8ef46d7
fixing mpl 1
antgonza Mar 22, 2016
73993c1
fixing mpl 2
antgonza Mar 22, 2016
a859822
fixing mpl 3
antgonza Mar 22, 2016
f3aa79c
pip freeze
antgonza Mar 22, 2016
317e27b
fix None errors 1
antgonza Mar 22, 2016
809d285
fix None errors 2
antgonza Mar 22, 2016
4590eca
fix None errors 3
antgonza Mar 22, 2016
dba88bf
fix None errors 4
antgonza Mar 22, 2016
04f7b86
fix None errors 5
antgonza Mar 22, 2016
f9e1017
fix None errors 6
antgonza Mar 22, 2016
55ffb17
fix None errors 7
josenavas Mar 22, 2016
8a1c1c1
Fix None errors 8
josenavas Mar 22, 2016
bd16210
Merge branch 'artifact-study-pages' of https://github.com/biocore/qii…
antgonza Mar 23, 2016
c10bd24
fix None errors 9
antgonza Mar 23, 2016
4b1aac4
fix None errors 10
antgonza Mar 23, 2016
6ff817d
fix None errors 11
antgonza Mar 23, 2016
6b7c0f5
fix None errors 12
antgonza Mar 23, 2016
2b755f6
fix None errors 13
antgonza Mar 23, 2016
92c0836
fix None errors 14
antgonza Mar 23, 2016
23e7c8b
fix None errors 15
antgonza Mar 23, 2016
11b091e
fix None errors 16
antgonza Mar 23, 2016
d3fe3d7
fix None errors 17
antgonza Mar 23, 2016
438b0b8
fix None errors 18
antgonza Mar 23, 2016
9448aac
fix None errors 19
antgonza Mar 23, 2016
ccf0be1
fix None errors 20
antgonza Mar 23, 2016
63e5760
Fxing user verify
josenavas Mar 31, 2016
4cacd18
Removing code that should not be here
josenavas Mar 31, 2016
6b5a69a
argh
josenavas Mar 31, 2016
f17c7bc
Merge pull request #1602 from biocore/artifact-study-pages
antgonza Mar 31, 2016
803cd92
Merge branch 'fix-user-verify' of https://github.com/josenavas/qiita …
antgonza Mar 31, 2016
1b2ab5b
addressing @squirrelo comments
antgonza Mar 31, 2016
23cf548
flake8
antgonza Mar 31, 2016
0b3db3b
Merge pull request #1731 from antgonza/fix-user-verify
josenavas Mar 31, 2016
de3f14f
initial commit
antgonza Mar 31, 2016
2bf5c53
Merge pull request #1732 from antgonza/fixing-new-analysis
ElDeveloper Mar 31, 2016
fd91d95
initial commit
antgonza Mar 31, 2016
8e965c3
Ignoring HTML summary
josenavas Mar 31, 2016
92bd37a
making sure the job and the cmd datatype are the same
antgonza Mar 31, 2016
ca3e478
Fix
josenavas Mar 31, 2016
0fc280c
Check before you cross the road
josenavas Mar 31, 2016
a3d72ed
Merge pull request #1734 from josenavas/fix-split-lib
antgonza Mar 31, 2016
dc4d708
Merge pull request #1735 from josenavas/i-want-to-cry-a-lot-an-noody-…
antgonza Mar 31, 2016
f8d39d5
Merge pull request #1733 from antgonza/fixing-analysis-gui
josenavas Mar 31, 2016
d3fab09
if->elif and else case
josenavas Mar 31, 2016
f5a396f
Merge pull request #1736 from josenavas/check-for-return
antgonza Mar 31, 2016
b90cbd5
Solving merge conflicts
josenavas Apr 1, 2016
1d629a5
Merge pull request #1738 from josenavas/subdir-portals-asp
antgonza Apr 1, 2016
59ed4ec
fixing master error
antgonza Apr 1, 2016
45b71ac
Merge pull request #1739 from antgonza/fix-master
josenavas Apr 1, 2016
7d7662f
fixing vamps and ebi buttons
antgonza Apr 1, 2016
2dfa8d2
initial commit
antgonza Apr 2, 2016
d5c8d1c
Merge pull request #1740 from antgonza/fixing-vamps-ebi-buttons
josenavas Apr 2, 2016
115f780
fixing flake8
antgonza Apr 2, 2016
354097b
fix #1693
antgonza Apr 2, 2016
20d1bb2
Merge pull request #1741 from antgonza/adding-delete-buttons-to-new-gui
ElDeveloper Apr 2, 2016
a2cb10e
fix #1395
antgonza Apr 3, 2016
de60506
addressing @wasade comment
antgonza Apr 3, 2016
557d4d4
fix #1699
antgonza Apr 3, 2016
e926d68
Merge pull request #1744 from antgonza/fix-1699
ElDeveloper Apr 3, 2016
0be11dc
addressing @ElDeveloper comment
antgonza Apr 3, 2016
0183cb1
Merge pull request #1742 from antgonza/fix-1693
ElDeveloper Apr 3, 2016
04aa971
small fix
antgonza Apr 5, 2016
6e8372c
fixing error
antgonza Apr 5, 2016
9440806
Merge pull request #1749 from antgonza/ascii-analysis-error
squirrelo Apr 6, 2016
99df913
addressing @squirrelo comment
antgonza Apr 6, 2016
c93058d
Merge pull request #1750 from antgonza/fix-analysis-empty-biom
ElDeveloper Apr 7, 2016
f34d3c1
make tornado changes needed for server side autocomplete
squirrelo Apr 8, 2016
2faeb47
upate UI to use selected2 and ajax autocomplete
squirrelo Apr 8, 2016
ad677e1
break sharing JS into own file
squirrelo Apr 8, 2016
7846413
add sharing to study page Fix #1730 Fix #1092
squirrelo Apr 8, 2016
f22a50c
add user to autocomplete list when verified
squirrelo Apr 8, 2016
38d1bb2
test updates
squirrelo Apr 8, 2016
7df98ca
make share js more generic
squirrelo Apr 8, 2016
997274b
add anaysis sharing to UI. Fix #1615
squirrelo Apr 8, 2016
5fe04bc
add & update tests
squirrelo Apr 8, 2016
01ac908
add messaging for sharing analyses and studies
squirrelo Apr 8, 2016
e369520
address comments
squirrelo Apr 8, 2016
1a3414a
merge origin/share-studies-in-studies
squirrelo Apr 8, 2016
9d7524b
remove global var
squirrelo Apr 8, 2016
c177213
jquery and javascript notation cleanup
squirrelo Apr 8, 2016
42e2ced
fix issue with javascript breaking chars in messages. Fix #1745
squirrelo Apr 8, 2016
d665068
add test
squirrelo Apr 8, 2016
63d0a7a
fix analysis share changes
squirrelo Apr 8, 2016
5fb1147
merge origin/share-studies-in-studies
squirrelo Apr 8, 2016
df3ea00
fix call to test patch calls. Fix #1682
squirrelo Apr 8, 2016
d12b6bc
uncomment another test
squirrelo Apr 8, 2016
2314e24
fix backwards messages
squirrelo Apr 9, 2016
63f7033
Merge pull request #1755 from squirrelo/share-studies-in-studies
antgonza Apr 9, 2016
b40bb8b
merge upstream/master
squirrelo Apr 9, 2016
32f052b
fix suggestions
squirrelo Apr 10, 2016
5363da1
Adding delete dispatchable call
josenavas Apr 11, 2016
4451b03
offloading artifact removal
josenavas Apr 11, 2016
22085c9
Fixing tests
josenavas Apr 11, 2016
9877526
Merge pull request #1759 from squirrelo/fix-showing-metadata-header-p…
josenavas Apr 11, 2016
3dc2438
remove pass
squirrelo Apr 11, 2016
3f60461
indentation
squirrelo Apr 11, 2016
5ad25f0
use data attribute
squirrelo Apr 11, 2016
521f8af
Solving merge conflicts
josenavas Apr 11, 2016
d4af309
here we go ...
antgonza Apr 11, 2016
a2978d6
addressing @josenavas comments
antgonza Apr 11, 2016
4aef864
Merge pull request #1763 from antgonza/subdir-portals-antoniog
josenavas Apr 11, 2016
4f268fd
fixed processing_artifact.html
Apr 11, 2016
288930e
FIX: urls
mortonjt Apr 11, 2016
b9726e9
update for portals
squirrelo Apr 11, 2016
fc91318
Merge pull request #1766 from mortonjt/urls2
josenavas Apr 11, 2016
5e954b8
fixed import in processing_artifact
Apr 11, 2016
8492ecb
Merge pull request #1768 from squirrelo/share-analyses
antgonza Apr 11, 2016
b797495
Merge pull request #1767 from squirrelo/portals-1
josenavas Apr 11, 2016
f4b1d40
Merge pull request #1765 from tkosciol/subdir-portals-tomasz
josenavas Apr 11, 2016
44bcbb5
ENH:Update URLs in data_type_menu and prep_summary
ElDeveloper Apr 11, 2016
3e9525b
Merge pull request #1769 from ElDeveloper/subdir-portals-yoshiki
josenavas Apr 11, 2016
8fdab75
Fixing study base
josenavas Apr 11, 2016
94dba47
missing
josenavas Apr 11, 2016
a01fe32
Merge pull request #1770 from josenavas/subdir-portals-base
antgonza Apr 11, 2016
e50a7f7
update sharing for portals
squirrelo Apr 11, 2016
3d47374
update sharing for portals
squirrelo Apr 11, 2016
a2dcb69
add missing init
squirrelo Apr 11, 2016
ec1aa7e
Fixing sample_summary.html
josenavas Apr 11, 2016
cd16e14
BUG: Move admin tasks to the main portal only
ElDeveloper Apr 11, 2016
a105310
add missing portals calls
squirrelo Apr 11, 2016
4030341
Merge pull request #1773 from ElDeveloper/admin-portals
josenavas Apr 11, 2016
bd0ea05
Merge pull request #1772 from josenavas/subdir-portals-3
antgonza Apr 11, 2016
8751685
Merge pull request #1771 from squirrelo/sharing-portals-changes
josenavas Apr 11, 2016
921a886
QUOTES
squirrelo Apr 11, 2016
ef44f38
Merge pull request #1774 from squirrelo/sharing-portals-changes
josenavas Apr 11, 2016
b629203
remove URL from sharing
squirrelo Apr 11, 2016
b52311a
Merge pull request #1775 from squirrelo/sharing-portals-changes
josenavas Apr 11, 2016
0e81d94
remove url
squirrelo Apr 11, 2016
291fb69
fix message
squirrelo Apr 11, 2016
3a68699
Merge pull request #1776 from squirrelo/sharing-portals-changes
antgonza Apr 11, 2016
9cae18f
change portal config
squirrelo Apr 11, 2016
1c64740
move import back
squirrelo Apr 11, 2016
6c9c666
Adding the portal to the base url for the plugins
josenavas Apr 11, 2016
be58c8d
Merge pull request #1777 from squirrelo/sharing-portals-changes
antgonza Apr 11, 2016
542ebdb
Adding comments
josenavas Apr 11, 2016
4f2450d
Merge pull request #1778 from josenavas/subdir-portals-plugin
antgonza Apr 11, 2016
38c56ae
Fixing config file
josenavas Apr 11, 2016
c06bc90
Merge pull request #1648 from biocore/subdir-portals
antgonza Apr 12, 2016
e361f5b
Merge branch 'master' of https://github.com/biocore/qiita into test-p…
squirrelo Apr 12, 2016
30d1f95
Addressing merge conflicts
josenavas Apr 12, 2016
905a48d
Adapting the code to portals
josenavas Apr 12, 2016
6536665
fix #1704
antgonza Apr 13, 2016
ddf0652
fix #1690
antgonza Apr 13, 2016
2baf9f5
Fixing test
josenavas Apr 13, 2016
3f72a5f
Actually fixing the test
josenavas Apr 13, 2016
3e255cb
Merge pull request #1760 from squirrelo/test-patch-calls
antgonza Apr 13, 2016
4f7a238
Merge pull request #1779 from antgonza/fix-1704
josenavas Apr 13, 2016
0e08f1e
Merge pull request #1780 from antgonza/fix-1690
josenavas Apr 13, 2016
8e44b88
Merge pull request #1762 from josenavas/fix-1747
antgonza Apr 13, 2016
bf2f88a
fix 1746
josenavas Apr 13, 2016
e9cafc9
Adding docs
josenavas Apr 13, 2016
27d4da1
Adding tests
josenavas Apr 13, 2016
ccd6964
Merge pull request #1781 from josenavas/fix-1746
antgonza Apr 13, 2016
852570a
Fixing failing test
josenavas Apr 13, 2016
4ba403a
Merge pull request #1784 from josenavas/fixing-failing-test
antgonza Apr 13, 2016
1f9547b
upstream master
antgonza Apr 14, 2016
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
13 changes: 10 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,18 @@ install:
pyzmq networkx pyparsing natsort mock future libgfortran seaborn
'pandas>=0.15' 'matplotlib>=1.1.0' 'scipy>0.13.0' 'numpy>=1.7' 'h5py>=2.3.1'
- source activate env_name
- pip install sphinx sphinx-bootstrap-theme coveralls ipython[all]==2.4.1
- pip install sphinx sphinx-bootstrap-theme coveralls ipython[all]==2.4.1 HTTPretty requests
- pushd qiita_plugins/qiita_client
- travis_retry pip install .
- popd
- travis_retry pip install .
- pushd qiita_plugins/target_gene
- travis_retry pip install .
- popd
- pushd qiita_plugins/qiita_client
- pushd qiita_plugins/biom_type
- travis_retry pip install .
- popd
- pushd qiita_plugins/target_gene_type
- travis_retry pip install .
- popd
script:
Expand All @@ -45,7 +51,8 @@ script:
- qiita-env make --no-load-ontologies
- if [ ${TEST_ADD_STUDIES} == "True" ]; then test_data_studies/commands.sh ; fi
- if [ ${TEST_ADD_STUDIES} == "False" ]; then qiita-test-install ; fi
- if [ ${TEST_ADD_STUDIES} == "False" ]; then nosetests --with-doctest --with-coverage -v; fi
# - if [ ${TEST_ADD_STUDIES} == "False" ]; then nosetests --with-doctest --with-coverage -v qiita_plugins/* qiita_*; fi
- if [ ${TEST_ADD_STUDIES} == "False" ]; then nosetests --with-doctest --with-coverage -v qiita_plugins/*; fi
- flake8 qiita_* setup.py scripts/qiita scripts/qiita-env scripts/qiita-test-install
- ls -R /home/travis/miniconda3/envs/env_name/lib/python2.7/site-packages/qiita_pet/support_files/doc/
- qiita pet webserver
Expand Down
14 changes: 13 additions & 1 deletion qiita_core/configuration_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ class ConfigurationManager(object):
The VAMPS URL
conf_fp : str
The filepath for the configuration file that is loaded
portal : str
The portal under the Qiita instance is running under
portal_dir : str
The portal subdirectory used in the URL
portal_fp : str
The filepath to the portal styling config file
plugin_launcher : str
Expand Down Expand Up @@ -161,7 +165,6 @@ def _get_main(self, config):
self.working_dir)
self.max_upload_size = config.getint('main', 'MAX_UPLOAD_SIZE')
self.require_approval = config.getboolean('main', 'REQUIRE_APPROVAL')
self.portal = config.get('main', 'PORTAL')
self.plugin_launcher = config.get('main', 'PLUGIN_LAUNCHER')

self.valid_upload_extension = [ve.strip() for ve in config.get(
Expand Down Expand Up @@ -240,3 +243,12 @@ def _get_vamps(self, config):

def _get_portal(self, config):
self.portal_fp = config.get('portal', 'PORTAL_FP')
self.portal = config.get('portal', 'PORTAL')
self.portal_dir = config.get('portal', 'PORTAL_DIR')
if self.portal_dir:
if not self.portal_dir.startswith('/'):
self.portal_dir = "/%s" % self.portal_dir
if self.portal_dir.endswith('/'):
self.portal_dir = self.portal_dir[:-1]
else:
self.portal_dir = ""
10 changes: 7 additions & 3 deletions qiita_core/support_files/config_test.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ BASE_DATA_DIR =
# Valid upload extension, comma separated. Empty for no uploads
VALID_UPLOAD_EXTENSION = fastq,fastq.gz,txt,tsv,sff,fna,qual

# Portal the site is working under
PORTAL = QIITA

# Script used for launching plugins
PLUGIN_LAUNCHER = qiita-plugin-launcher

Expand Down Expand Up @@ -144,5 +141,12 @@ URL = https://vamps.mbl.edu/mobe_workshop/getfile.php

# ----------------------------- Portal settings -----------------------------
[portal]

# Portal the site is working under
PORTAL = QIITA

# Portal subdirectory
PORTAL_DIR =

# Full path to portal styling config file
PORTAL_FP =
Binary file modified qiita_core/support_files/config_test_travis.cfg.enc
Binary file not shown.
52 changes: 25 additions & 27 deletions qiita_db/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -683,13 +683,11 @@ def share(self, user):
user: User object
The user to share the analysis with
"""
with qdb.sql_connection.TRN:
self._lock_check()

# Make sure the analysis is not already shared with the given user
if user.id in self.shared_with:
return
# Make sure the analysis is not already shared with the given user
if user.id == self.owner or user.id in self.shared_with:
return

with qdb.sql_connection.TRN:
sql = """INSERT INTO qiita.analysis_users (analysis_id, email)
VALUES (%s, %s)"""
qdb.sql_connection.TRN.add(sql, [self._id, user.id])
Expand All @@ -704,8 +702,6 @@ def unshare(self, user):
The user to unshare the analysis with
"""
with qdb.sql_connection.TRN:
self._lock_check()

sql = """DELETE FROM qiita.analysis_users
WHERE analysis_id = %s AND email = %s"""
qdb.sql_connection.TRN.add(sql, [self._id, user.id])
Expand Down Expand Up @@ -933,9 +929,7 @@ def _build_biom_tables(self, grouped_samples, rarefaction_depth=None,
biom_table.filter(selected_samples, axis='sample',
inplace=True)
if len(biom_table.ids()) == 0:
raise RuntimeError(
"All samples filtered out from Artifact %s due "
"to selected samples" % aid)
continue

if rename_dup_samples:
ids_map = {_id: "%d.%s" % (aid, _id)
Expand All @@ -947,6 +941,12 @@ def _build_biom_tables(self, grouped_samples, rarefaction_depth=None,
else:
new_table = new_table.merge(biom_table)

if not new_table or len(new_table.ids()) == 0:
# if we get to this point the only reason for failure is
# rarefaction
raise RuntimeError("All samples filtered out from "
"analysis due to rarefaction level")

# add the metadata column for study the samples come from,
# this is useful in case the user download the bioms
study_md = {'study': artifact.study.title,
Expand Down Expand Up @@ -977,27 +977,15 @@ def _build_mapping_file(self, samples, rename_dup_samples=False):
"""Builds the combined mapping file for all samples
Code modified slightly from qiime.util.MetadataMap.__add__"""
with qdb.sql_connection.TRN:
# query to get the latest qiime mapping file
sql = """SELECT filepath
FROM qiita.filepath
JOIN qiita.prep_template_filepath USING (filepath_id)
JOIN qiita.prep_template USING (prep_template_id)
JOIN qiita.filepath_type USING (filepath_type_id)
WHERE filepath_type = 'qiime_map'
AND artifact_id IN (SELECT *
FROM qiita.find_artifact_roots(%s))
ORDER BY filepath_id DESC LIMIT 1"""
_, fp = qdb.util.get_mountpoint('templates')[0]

all_ids = set()
to_concat = []
for aid, samps in viewitems(samples):
qdb.sql_connection.TRN.add(sql, [aid])
qm_fp = qdb.sql_connection.TRN.execute_fetchindex()[0][0]
qiime_map_fp = qdb.artifact.Artifact(
aid).prep_templates[0].qiime_map_fp

# Parse the mapping file
qm = qdb.metadata_template.util.load_template_to_dataframe(
join(fp, qm_fp), index='#SampleID')
qiime_map_fp, index='#SampleID')

# if we are not going to merge the duplicated samples
# append the aid to the sample name
Expand All @@ -1011,6 +999,16 @@ def _build_mapping_file(self, samples, rename_dup_samples=False):
samps = set(samps) - all_ids
all_ids.update(samps)

# appending study metadata to the analysis
study = qdb.artifact.Artifact(aid).study
study_owner = study.owner
study_info = study.info
pi = study_info['principal_investigator']
qm['qiita_study_title'] = study.title
qm['qiita_study_alias'] = study.info['study_alias']
qm['qiita_owner'] = study_owner.info['name']
qm['qiita_principal_investigator'] = pi.name

qm = qm.loc[samps]
to_concat.append(qm)

Expand All @@ -1029,7 +1027,7 @@ def _build_mapping_file(self, samples, rename_dup_samples=False):
_, base_fp = qdb.util.get_mountpoint(self._table)[0]
mapping_fp = join(base_fp, "%d_analysis_mapping.txt" % self._id)
merged_map.to_csv(mapping_fp, index_label='#SampleID',
na_rep='unknown', sep='\t')
na_rep='unknown', sep='\t', encoding='utf-8')

self._add_file("%d_analysis_mapping.txt" % self._id, "plain_text")

Expand Down
7 changes: 2 additions & 5 deletions qiita_db/metadata_template/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,14 @@
'demultiplex': Restriction(
columns={'barcode': 'varchar',
'primer': 'varchar'},
error_msg="Demultiplexing disabled. You will not be able to "
"preprocess your raw data"),
error_msg="Demultiplexing disabled."),
# The following columns are required by Qiita to know how to execute split
# libraries using QIIME over a study with multiple illumina lanes
'demultiplex_multiple': Restriction(
columns={'barcode': 'varchar',
'primer': 'varchar',
'run_prefix': 'varchar'},
error_msg="Demultiplexing with multiple input files disabled. If your "
"raw data includes multiple raw input files, you will not "
"be able to preprocess your raw data")
error_msg="Demultiplexing with multiple input files disabled.")
}

# This list is useful to have if we want to loop through all the restrictions
Expand Down
7 changes: 5 additions & 2 deletions qiita_db/processing_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,12 @@ def _generate_cmd(self):
software = self.command.software
plugin_start_script = software.start_script
plugin_env_script = software.environment_script
# Appending the portal URL so the job requests the information from the
# portal server that submitted the job
url = "%s%s" % (qiita_config.base_url, qiita_config.portal_dir)
cmd = '%s "%s" "%s" "%s" "%s" "%s"' % (
qiita_config.plugin_launcher, plugin_env_script,
plugin_start_script, qiita_config.base_url, self.id, job_dir)
plugin_start_script, url, self.id, job_dir)
return cmd

def submit(self):
Expand All @@ -324,7 +327,7 @@ def submit(self):
raise qdb.exceptions.QiitaDBOperationNotPermittedError(
"Can't submit job, not in 'in_construction' or "
"'waiting' status. Current status: %s" % status)
self._set_status = 'queued'
self._set_status('queued')
cmd = self._generate_cmd()
p = Process(target=_job_submitter, args=(self, cmd))
p.start()
Expand Down
2 changes: 1 addition & 1 deletion qiita_db/support_files/populate_test_db.sql
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ INSERT INTO qiita.job (data_type_id, job_status_id, command_id, options, input_f
INSERT INTO qiita.job_results_filepath (job_id, filepath_id) VALUES (1, 13), (2, 14);

-- Insert Analysis
INSERT INTO qiita.analysis (email, name, description, analysis_status_id, pmid) VALUES ('test@foo.bar', 'SomeAnalysis', 'A test analysis', 1, '121112'), ('test@foo.bar', 'SomeSecondAnalysis', 'Another test analysis', 1, '22221112');
INSERT INTO qiita.analysis (email, name, description, analysis_status_id, pmid) VALUES ('test@foo.bar', 'SomeAnalysis', 'A test analysis', 1, '121112'), ('admin@foo.bar', 'SomeSecondAnalysis', 'Another test analysis', 1, '22221112');
INSERT INTO qiita.analysis_portal (analysis_id, portal_type_id) VALUES (1, 1), (2, 1);
-- Insert Analysis Workflow
INSERT INTO qiita.analysis_workflow (analysis_id, step) VALUES (1, 3), (2, 3);
Expand Down
Loading