Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
cb67d3d
Removing qiita ware code that will not be used anymore
josenavas Feb 9, 2017
5a5127d
Merge branch 'analysis-refactor' of https://github.com/biocore/qiita …
josenavas Feb 9, 2017
0033480
Organizing the handlers and new analysis description page
josenavas Feb 9, 2017
3809ad5
Connecting the analysis creation and making interface responsive
josenavas Feb 9, 2017
067f14f
Addressing @antgonza's comments
josenavas Feb 10, 2017
cf4862d
Solving merge conflicts
josenavas Feb 10, 2017
3b07151
Initial artifact GUI refactor
josenavas Feb 10, 2017
a6595a9
Removing unused code
josenavas Feb 10, 2017
6343b49
Merge branch 'analysis-refactor-gui-part2' into analysis-refactor-gui…
josenavas Feb 10, 2017
f731768
Adding can_edit call to the analysis
josenavas Feb 14, 2017
7542658
Fixing artifact rest API since not all artifacts have study
josenavas Feb 14, 2017
e0180e8
Adding can_be_publicized call to analysis
josenavas Feb 15, 2017
f55ca5c
Adding QiitaHTTPError to handle errors gracefully
josenavas Feb 15, 2017
1fa4b19
Adding safe_execution contextmanager
josenavas Feb 15, 2017
b61ae87
Fixing typo
josenavas Feb 15, 2017
bb68303
Adding qiita test checker
josenavas Feb 15, 2017
b31a025
Adapting some artifact handlers
josenavas Feb 15, 2017
378d7ff
Fixing merge conflicts
josenavas Feb 15, 2017
444da08
Merge branch 'analysis-refactor-gui-part2' into analysis-refactor-gui…
josenavas Feb 15, 2017
f6b4c46
Abstracting the graph reloading and adding some documentation
josenavas Feb 15, 2017
e9d3af3
Fixing typo
josenavas Feb 15, 2017
69b6412
Merge branch 'analysis-refactor-gui-part3' into analysis-refactor-gui…
josenavas Feb 15, 2017
60cd430
Fixing changing artifact visibility
josenavas Feb 15, 2017
be099cb
Fixing delete
josenavas Feb 15, 2017
819e9a5
Fixing artifact deletion
josenavas Feb 15, 2017
e941fa7
Adding default parameters to the commands
josenavas Feb 15, 2017
d6ebcb4
Fixing processing page
josenavas Feb 15, 2017
6ada2ba
Fixing variable name
josenavas Feb 15, 2017
e8ca9db
Changing bdiv metrics to single choice
josenavas Feb 15, 2017
6cdc574
Fixing patch
josenavas Feb 15, 2017
a77b040
Various small fixes to be able to run tests on the plugins
josenavas Mar 15, 2017
ff9eda9
Merging with master
josenavas Mar 15, 2017
6145976
Adding private module
josenavas Mar 15, 2017
7153efb
Fixing processing job completion
josenavas Mar 15, 2017
46dd73d
Fixing patch 52
josenavas Mar 16, 2017
08eafaa
Fixing call
josenavas Mar 16, 2017
b1a3e99
Fixing complete
josenavas Mar 17, 2017
c9580b7
small fixes
josenavas Mar 17, 2017
85d4aa7
Solving merge conflicts
josenavas Apr 24, 2017
1ffa231
Solving merge conflicts
josenavas Apr 24, 2017
9e14cc6
Merge branch 'analysis-refactor-gui-part5' into analysis-refactor-gui…
josenavas Apr 24, 2017
4cd34d2
Merge branch 'analysis-refactor-gui-part6' into analysis-refactor-gui…
josenavas Apr 24, 2017
bf33527
Solving merge conflicts
josenavas Apr 25, 2017
3529556
Adding processing handlers
josenavas Apr 25, 2017
ca5a331
Fixing url and bug on processing job workflow
josenavas May 1, 2017
b934d68
Adding the private script runner
josenavas May 1, 2017
fa00d60
Adding is_analysis column to the command
josenavas May 1, 2017
b2ac959
Adding retrieval of commands excluding analysis commands
josenavas May 1, 2017
0326a63
Addressing bug on retrieving information from redis
josenavas May 1, 2017
cd6b61c
Enabling the command register endpoint to provide if the command is a…
josenavas May 4, 2017
cccb1d4
Addressing @antgonza's comments
josenavas May 16, 2017
0a584f3
Addressing @wasade's comments
josenavas May 16, 2017
a33d14f
Supporting multiple choice
josenavas May 17, 2017
66986ab
Adding documentation
josenavas May 17, 2017
3e36212
Modifying handler to pass allow_change_optionals
josenavas May 22, 2017
e04d03d
Solving merge conflicts
josenavas May 22, 2017
dc3a51e
returning optional parameters
josenavas May 22, 2017
12235a7
Addressing bug found by @antgonza
josenavas May 22, 2017
f5c5811
Enabling changing the default parameters
josenavas May 22, 2017
08554e1
Adding correct class
josenavas May 22, 2017
04a0c26
Allowing user to change default parameters
josenavas May 24, 2017
4330dae
Fixing bug with commands listing
josenavas May 24, 2017
4afa539
Enabling arbitrary htmls in the summary
josenavas May 31, 2017
6a0c7fc
Prepping for merge hell
josenavas May 31, 2017
b6c11b8
Fixing merge conflicts
josenavas May 31, 2017
3b8acdc
Addressing @wasade's comments
josenavas May 31, 2017
389ea9f
Merge branch 'analysis-refactor-allow-users-change-dflt-params' into …
josenavas May 31, 2017
bdf7cb1
Merge branch 'analysis-refactor-embed-html' into analysis-refactor-sy…
josenavas May 31, 2017
b06e8b2
Fixing qiita_db tests
josenavas May 31, 2017
29b6acf
Merge branch 'analysis-refactor' of https://github.com/biocore/qiita …
josenavas Jun 1, 2017
b35e07c
Addressing @antgonza's comment
josenavas Jun 1, 2017
8128120
Merge branch 'analysis-refactor-embed-html' into analysis-refactor-sy…
josenavas Jun 1, 2017
145218e
Merge branch 'analysis-refactor-sync-w-master' into analysis-refactor…
josenavas Jun 1, 2017
ac700fd
Solving a few more tests
josenavas Jun 1, 2017
ddd50ad
Merge branch 'analysis-refactor' of https://github.com/biocore/qiita …
josenavas Jun 1, 2017
8ffc409
Merge branch 'analysis-refactor-sync-w-master' into analysis-refactor…
josenavas Jun 1, 2017
7a52c69
Moving tests around and deleting unused code
josenavas Jun 1, 2017
054c890
Solving merge conflicts
josenavas Jun 1, 2017
5478cba
Deleting unused code
josenavas Jun 1, 2017
c0dc6bb
Fixing travis
josenavas Jun 1, 2017
a5f23bf
Flake8-ing
josenavas Jun 1, 2017
896a8e0
Fixing travis
josenavas Jun 2, 2017
abeb5f1
Removing unused code
josenavas Jun 2, 2017
1d575ef
Trying one thing on travis
josenavas Jun 2, 2017
afe6277
Trying one thing on travis
josenavas Jun 2, 2017
f74c903
Trying to debug
josenavas Jun 2, 2017
0f31b15
Still debugging
josenavas Jun 2, 2017
0f688fb
...
josenavas Jun 2, 2017
3ddabb5
Config biom plugin
josenavas Jun 2, 2017
6d514eb
Creating the dir
josenavas Jun 2, 2017
f3bbdd1
Speed up server by not building the docs
josenavas Jun 2, 2017
d390eaf
More playing with travis
josenavas Jun 2, 2017
378be52
Fixing config file
josenavas Jun 2, 2017
f8c190c
Trying with a diff conf file
josenavas Jun 5, 2017
fc4efd7
Fixing path
josenavas Jun 5, 2017
5243c07
Adding a print to see the error
josenavas Jun 5, 2017
387e99d
Adding another print
josenavas Jun 5, 2017
50f39fb
Removing debugging bits
josenavas Jun 5, 2017
860012b
Runnning webserver only if running tests
josenavas Jun 5, 2017
38ed835
Fixing last failing errors
josenavas Jun 6, 2017
be42417
Removing debugging bits
josenavas Jun 6, 2017
fcbfe61
Fixing tests
josenavas Jun 6, 2017
a659118
fixing config
josenavas Jun 8, 2017
857efc6
Fixing stochastic tests
josenavas Jun 12, 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
16 changes: 15 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,15 @@ install:
- pip install sphinx sphinx-bootstrap-theme coveralls 'ipython[all]==2.4.1'
- travis_retry pip install . --process-dependency-links
- 'echo "backend: Agg" > matplotlibrc'
script:
# Install the biom plugin so we can run the analysis tests
- pip install https://github.com/qiita-spots/qiita_client/archive/master.zip
- pip install https://github.com/qiita-spots/qtp-biom/archive/master.zip --process-dependency-links
- export QIITA_SERVER_CERT=`pwd`/qiita_core/support_files/server.crt
- mkdir ~/.qiita_plugins
- cp $PWD/qiita_core/support_files/BIOM\ type_2.1.4.conf ~/.qiita_plugins
before_script:
# Some of the tests rely on the plugin system to complete successfuly.
# Thus, we need a qiita webserver running to be able to execute the tests.
- export MOI_CONFIG_FP=`pwd`/qiita_core/support_files/config_test.cfg
- if [ ${TRAVIS_PULL_REQUEST} == "false" ]; then
export QIITA_CONFIG_FP=`pwd`/qiita_core/support_files/config_test_travis.cfg;
Expand All @@ -39,6 +47,12 @@ script:
- ipython profile create qiita-general --parallel
- qiita-env start_cluster qiita-general
- qiita-env make --no-load-ontologies
- |
if [ ${TEST_ADD_STUDIES} == "False" ]; then
qiita pet webserver --no-build-docs start &
fi
script:
- sleep 5
- if [ ${TEST_ADD_STUDIES} == "True" ]; then test_data_studies/commands.sh ; fi
- if [ ${TEST_ADD_STUDIES} == "True" ]; then qiita-cron-job ; fi
- if [ ${TEST_ADD_STUDIES} == "False" ]; then qiita-test-install ; fi
Expand Down
13 changes: 13 additions & 0 deletions qiita_core/support_files/BIOM type_2.1.4.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[main]
NAME = BIOM type
VERSION = 2.1.4
DESCRIPTION = The Biological Observation Matrix format
ENVIRONMENT_SCRIPT = source activate qtp-biom
START_SCRIPT = start_biom
PLUGIN_TYPE = artifact definition
PUBLICATIONS =

[oauth2]
SERVER_CERT = /home/travis/miniconda3/envs/qiita/lib/python2.7/site-packages/qiita_core/support_files/server.crt
CLIENT_ID = dHgaXDwq665ksFPqfIoD3Jt8KRXdSioTRa4lGa5mGDnz6JTIBf
CLIENT_SECRET = xqx61SD4M2EWbaS0WYv3H1nIemkvEAMIn16XMLjy5rTCqi7opCcWbfLINEwtV48bQ
4 changes: 2 additions & 2 deletions qiita_core/support_files/config_test.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ LOG_DIR =
REQUIRE_APPROVAL = True

# Base URL: DO NOT ADD TRAILING SLASH
BASE_URL = https://localhost
BASE_URL = https://localhost:21174

# Download path files
UPLOAD_DATA_DIR = /tmp/
Expand All @@ -35,7 +35,7 @@ WORKING_DIR = /tmp/
MAX_UPLOAD_SIZE = 100

# Path to the base directory where the data files are going to be stored
BASE_DATA_DIR =
BASE_DATA_DIR = /home/travis/miniconda3/envs/qiita/lib/python2.7/site-packages/qiita_db/support_files/test_data/

# Valid upload extension, comma separated. Empty for no uploads
VALID_UPLOAD_EXTENSION = fastq,fastq.gz,txt,tsv,sff,fna,qual
Expand Down
34 changes: 15 additions & 19 deletions qiita_db/artifact.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,7 @@ def create(cls, filepaths, artifact_type, name=None, prep_template=None,
# them execute a set of common operations. Declare functions to avoid
# code duplication. These functions should not be used outside of the
# create function, hence declaring them here
def _common_creation_steps(atype, cmd_id, data_type, cmd_parameters,
fps, mv_files):
def _common_creation_steps(atype, cmd_id, data_type, cmd_parameters):
gen_timestamp = datetime.now()
visibility_id = qdb.util.convert_to_id("sandbox", "visibility")
atype_id = qdb.util.convert_to_id(atype, "artifact_type")
Expand All @@ -328,15 +327,6 @@ def _common_creation_steps(atype, cmd_id, data_type, cmd_parameters,
cmd_parameters, visibility_id, atype_id, False]
qdb.sql_connection.TRN.add(sql, sql_args)
a_id = qdb.sql_connection.TRN.execute_fetchlast()
# Associate the artifact with its filepaths
fp_ids = qdb.util.insert_filepaths(
fps, a_id, atype, "filepath",
move_files=mv_files, copy=(not mv_files))
sql = """INSERT INTO qiita.artifact_filepath
(artifact_id, filepath_id)
VALUES (%s, %s)"""
sql_args = [[a_id, fp_id] for fp_id in fp_ids]
qdb.sql_connection.TRN.add(sql, sql_args, many=True)
qdb.sql_connection.TRN.execute()

return cls(a_id)
Expand Down Expand Up @@ -398,8 +388,7 @@ def _associate_with_analysis(instance, analysis_id):

instance = _common_creation_steps(
artifact_type, processing_parameters.command.id,
dtypes.pop(), processing_parameters.dump(), filepaths,
move_files)
dtypes.pop(), processing_parameters.dump())

_associate_with_study(instance, study_id)
else:
Expand All @@ -411,8 +400,7 @@ def _associate_with_analysis(instance, analysis_id):
if len(dtypes) > 1 else dtypes.pop())
instance = _common_creation_steps(
artifact_type, processing_parameters.command.id,
data_type, processing_parameters.dump(), filepaths,
move_files)
data_type, processing_parameters.dump())
_associate_with_analysis(instance, analysis_id)

# Associate the artifact with its parents
Expand All @@ -436,20 +424,28 @@ def _associate_with_analysis(instance, analysis_id):
# This artifact is uploaded by the user in the
# processing pipeline
instance = _common_creation_steps(
artifact_type, None, prep_template.data_type(), None,
filepaths, move_files)
artifact_type, None, prep_template.data_type(), None)
# Associate the artifact with the prep template
prep_template.artifact = instance
# Associate the artifact with the study
_associate_with_study(instance, prep_template.study_id)
else:
# This artifact is an initial artifact of an analysis
instance = _common_creation_steps(
artifact_type, None, data_type, None, filepaths,
move_files)
artifact_type, None, data_type, None)
# Associate the artifact with the analysis
analysis.add_artifact(instance)

# Associate the artifact with its filepaths
fp_ids = qdb.util.insert_filepaths(
filepaths, instance.id, artifact_type, "filepath",
move_files=move_files, copy=(not move_files))
sql = """INSERT INTO qiita.artifact_filepath
(artifact_id, filepath_id)
VALUES (%s, %s)"""
sql_args = [[instance.id, fp_id] for fp_id in fp_ids]
qdb.sql_connection.TRN.add(sql, sql_args, many=True)

if name:
instance.name = name

Expand Down
4 changes: 3 additions & 1 deletion qiita_db/handlers/tests/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ def test_get(self):
'for performing microbiome analysis from raw DNA '
'sequencing data',
'commands': ['Split libraries FASTQ', 'Split libraries',
'Pick closed-reference OTUs'],
'Pick closed-reference OTUs', 'Summarize Taxa',
'Beta Diversity', 'Alpha Rarefaction',
'Single Rarefaction'],
'publications': [{'DOI': '10.1038/nmeth.f.303',
'PubMed': '20383131'}],
'default_workflows': ['FASTQ upstream workflow',
Expand Down
1 change: 0 additions & 1 deletion qiita_db/metadata_template/test/test_prep_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,6 @@ def test_create_data_type_id(self):
def test_create_warning(self):
"""Warns if a required columns is missing for a given functionality
"""
fp_count = qdb.util.get_count("qiita.filepath")
del self.metadata['barcode']
pt = npt.assert_warns(
qdb.exceptions.QiitaDBWarning,
Expand Down
12 changes: 2 additions & 10 deletions qiita_db/test/test_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ def tearDown(self):
def _wait_for_jobs(self, analysis):
for j in analysis.jobs:
wait_for_processing_job(j.id)
if j.status == 'error':
print j.log.msg

def _create_analyses_with_samples(self, user='demo@microbio.me',
merge=False):
Expand Down Expand Up @@ -129,21 +131,11 @@ def test_can_be_publicized(self):
analysis = qdb.analysis.Analysis(1)
self.assertFalse(analysis.can_be_publicized)
a4 = qdb.artifact.Artifact(4)
a5 = qdb.artifact.Artifact(5)
a6 = qdb.artifact.Artifact(6)

a4.visibility = 'public'
self.assertFalse(analysis.can_be_publicized)

a5.visibility = 'public'
self.assertFalse(analysis.can_be_publicized)

a6.visibility = 'public'
self.assertTrue(analysis.can_be_publicized)

a4.visibility = 'private'
a5.visibility = 'private'
a6.visibility = 'private'
self.assertFalse(analysis.can_be_publicized)

def test_add_artifact(self):
Expand Down
4 changes: 2 additions & 2 deletions qiita_db/test/test_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def test_study_experimental_factor(self):
self.assertEqual(get_count("qiita.study_experimental_factor"), 1)

def test_filepath(self):
self.assertEqual(get_count("qiita.filepath"), 26)
self.assertEqual(get_count("qiita.filepath"), 25)

def test_filepath_type(self):
self.assertEqual(get_count("qiita.filepath_type"), 21)
Expand Down Expand Up @@ -66,7 +66,7 @@ def test_analysis(self):
self.assertEqual(get_count("qiita.analysis"), 10)

def test_analysis_filepath(self):
self.assertEqual(get_count("qiita.analysis_filepath"), 2)
self.assertEqual(get_count("qiita.analysis_filepath"), 1)

def test_analysis_sample(self):
self.assertEqual(get_count("qiita.analysis_sample"), 31)
Expand Down
Loading