Skip to content

Commit

Permalink
some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
antgonza committed Dec 18, 2023
1 parent 30eb772 commit fee1900
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 6 deletions.
14 changes: 12 additions & 2 deletions qiita_db/metadata_template/prep_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -851,20 +851,30 @@ def _get_predecessors(workflow, node):
starting_job = None
pt_artifact = self.artifact.artifact_type

workflows = []
all_workflows = [wk for wk in qdb.software.DefaultWorkflow.iter()]
# are there any workflows with parameters?
check_requirements = False
default_parameters = {'prep': {}, 'sample': {}}
if [wk for wk in all_workflows if wk.parameters != default_parameters]:
check_requirements = True
ST = qdb.metadata_template.sample_template.SampleTemplate
for wk in qdb.software.DefaultWorkflow.iter():
workflows = []
for wk in all_workflows:
if wk.artifact_type == pt_artifact and pt_dt in wk.data_type:
if check_requirements and wk.parameters == default_parameters:
continue
wk_params = wk.parameters
reqs_satisfied = True

if wk_params['sample']:
check_requirements = True
df = ST(self.study_id).to_dataframe(samples=list(self))
for k, v in wk_params['sample'].items():
if k not in df.columns or v not in df[k].unique():
reqs_satisfied = False

if wk_params['prep']:
check_requirements = True
df = self.to_dataframe()
for k, v in wk_params['prep'].items():
if k not in df.columns or v not in df[k].unique():
Expand Down
14 changes: 12 additions & 2 deletions qiita_db/processing_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,9 @@ def submit(self, parent_job_id=None, dependent_jobs_list=None):
qdb.sql_connection.TRN.commit()

job_dir = join(qdb.util.get_work_base_dir(), self.id)
software = self.command.software
command = self.command
software = command.software
cname = command.name
plugin_start_script = software.start_script
plugin_env_script = software.environment_script

Expand All @@ -1011,7 +1013,15 @@ def submit(self, parent_job_id=None, dependent_jobs_list=None):
# case where we are going to execute some command and then wait for the
# plugin to return their own id (first implemented for
# fast-bowtie2+woltka)
if 'ENVIRONMENT' in plugin_env_script:
#
# This is the hardcoded lines described in issue:
# https://github.com/qiita-spots/qiita/issues/3340
# the idea is that in the future we shouldn't check specific command
# names to know if it should be executed differently and the
# plugin should let Qiita know that a specific command should be ran
# as job array or not
cnames_to_skip = {'Calculate Cell Counts'}
if 'ENVIRONMENT' in plugin_env_script and not cname in cnames_to_skip:
# the job has to be in running state so the plugin can change its`
# status
with qdb.sql_connection.TRN:
Expand Down
4 changes: 2 additions & 2 deletions qiita_pet/templates/workflows.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ <h3>Recommended Default Workflows</h3>
default Earth Microbiome Project protocol and so assumes the uploaded data are multiplexed sequences with the reversed barcodes in your mapping file and index sequence
file (<a href="https://earthmicrobiome.org/protocols-and-standards/" target="_blank">see here</a> for more details). Thus, if the protocol does not apply to your data
you can still use the Default Workflow, however, you should first manually process your data using the appropriate steps until you have a defined step; in our example,
demultiplexed your reads. After demultiplexing the Default Workflow is safe to use with any protocol.
demultiplex your reads. After demultiplexing, the Default Workflow is safe to use with any protocol.
<br/><br/>
If you have already manually performed one of the processing steps in the Defaul Workflow pipeline, the "Add Default Workflow" button will not re-select those steps but
If you have already manually performed one of the processing steps in the Default Workflow pipeline, the "Add Default Workflow" button will not re-select those steps but
instead will only select any remaining steps that have not been completed. You can also add additional workflows on top of the recommended Default Workflow at any time.
<br/><br/>
Note that this is not a full inclusive list of data types accepted by Qiita but only those that have a defined workflow.
Expand Down

0 comments on commit fee1900

Please sign in to comment.