Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gga_load_data
Manage
Activity
Members
Labels
Plan
Issues
12
Issue boards
Milestones
Wiki
Code
Merge requests
5
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
abims
e-infra
gga_load_data
Commits
15c2b3be
Commit
15c2b3be
authored
3 years ago
by
Loraine Gueguen
Browse files
Options
Downloads
Patches
Plain Diff
Update to wf_v7: sync in wf
parent
5e79ead4
No related branches found
No related tags found
1 merge request
!28
WIP: Fix empty strain sex
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
constants_phaeo.py
+7
-7
7 additions, 7 deletions
constants_phaeo.py
gga_run_workflow_phaeo.py
+1
-1
1 addition, 1 deletion
gga_run_workflow_phaeo.py
gga_run_workflow_phaeo_jbrowse.py
+80
-52
80 additions, 52 deletions
gga_run_workflow_phaeo_jbrowse.py
with
88 additions
and
60 deletions
constants_phaeo.py
+
7
−
7
View file @
15c2b3be
...
@@ -32,19 +32,19 @@ WF_LOAD_GFF_JB_2_ORG_INPUT_GFF_ORG2 = "4"
...
@@ -32,19 +32,19 @@ WF_LOAD_GFF_JB_2_ORG_INPUT_GFF_ORG2 = "4"
WF_LOAD_GFF_JB_2_ORG_INPUT_PROTEINS_ORG2
=
"
5
"
WF_LOAD_GFF_JB_2_ORG_INPUT_PROTEINS_ORG2
=
"
5
"
WF_LOAD_GFF_JB_2_ORG_STEP_LOAD_FASTA_ORG1
=
"
6
"
WF_LOAD_GFF_JB_2_ORG_STEP_LOAD_FASTA_ORG1
=
"
6
"
WF_LOAD_GFF_JB_2_ORG_STEP_JBROWSE_ORG1
=
"
7
"
WF_LOAD_GFF_JB_2_ORG_STEP_JBROWSE_ORG1
=
"
7
"
WF_LOAD_GFF_JB_2_ORG_STEP_J
R
BOWSE_ORG2
=
"
8
"
WF_LOAD_GFF_JB_2_ORG_STEP_JB
R
OWSE_ORG2
=
"
8
"
WF_LOAD_GFF_JB_2_ORG_STEP_LOAD_GFF_ORG1
=
"
9
"
WF_LOAD_GFF_JB_2_ORG_STEP_LOAD_GFF_ORG1
=
"
9
"
WF_LOAD_GFF_JB_2_ORG_STEP_JB_TO_CONTAINER
=
"
10
"
WF_LOAD_GFF_JB_2_ORG_STEP_JB_TO_CONTAINER
=
"
10
"
WF_LOAD_GFF_JB_2_ORG_STEP_SYNC_FEATURE_ORG1
=
"
11
"
WF_LOAD_GFF_JB_2_ORG_STEP_SYNC_FEATURE_ORG1
=
"
11
"
WF_LOAD_GFF_JB_2_ORG_STEP_LOAD_FASTA_ORG2
=
"
12
"
WF_LOAD_GFF_JB_2_ORG_STEP_LOAD_FASTA_ORG2
=
"
12
"
WF_LOAD_GFF_JB_2_ORG_STEP_LOAD_GFF_ORG2
=
"
13
"
WF_LOAD_GFF_JB_2_ORG_STEP_LOAD_GFF_ORG2
=
"
13
"
WF_LOAD_GFF_JB_2_ORG_STEP_SYNC_FEATURE_ORG2
=
"
14
"
WF_LOAD_GFF_JB_2_ORG_STEP_SYNC_FEATURE_ORG2
=
"
14
"
WF_LOAD_GFF_JB_
1
_ORG_STEP_SYNC_ORG1
=
"
15
"
WF_LOAD_GFF_JB_
2
_ORG_STEP_SYNC_ORG1
=
"
15
"
WF_LOAD_GFF_JB_
1
_ORG_STEP_SYNC_ORG2
=
"
16
"
WF_LOAD_GFF_JB_
2
_ORG_STEP_SYNC_ORG2
=
"
16
"
WF_LOAD_GFF_JB_
1
_ORG_STEP_SYNC_GENOME_ANALYSIS_ORG1
=
"
17
"
WF_LOAD_GFF_JB_
2
_ORG_STEP_SYNC_GENOME_ANALYSIS_ORG1
=
"
17
"
WF_LOAD_GFF_JB_
1
_ORG_STEP_SYNC_OGS_ANALYSIS_ORG1
=
"
18
"
WF_LOAD_GFF_JB_
2
_ORG_STEP_SYNC_OGS_ANALYSIS_ORG1
=
"
18
"
WF_LOAD_GFF_JB_
1
_ORG_STEP_SYNC_GENOME_ANALYSIS_ORG2
=
"
19
"
WF_LOAD_GFF_JB_
2
_ORG_STEP_SYNC_GENOME_ANALYSIS_ORG2
=
"
19
"
WF_LOAD_GFF_JB_
1
_ORG_STEP_SYNC_OGS_ANALYSIS_ORG2
=
"
20
"
WF_LOAD_GFF_JB_
2
_ORG_STEP_SYNC_OGS_ANALYSIS_ORG2
=
"
20
"
WF_LOAD_GFF_JB_2_ORG_STEP_POPULATE_VIEWS
=
"
21
"
WF_LOAD_GFF_JB_2_ORG_STEP_POPULATE_VIEWS
=
"
21
"
WF_LOAD_GFF_JB_2_ORG_STEP_INDEX
=
"
22
"
WF_LOAD_GFF_JB_2_ORG_STEP_INDEX
=
"
22
"
...
...
This diff is collapsed.
Click to expand it.
gga_run_workflow_phaeo.py
+
1
−
1
View file @
15c2b3be
...
@@ -136,7 +136,7 @@ class RunWorkflow(species_data.SpeciesData):
...
@@ -136,7 +136,7 @@ class RunWorkflow(species_data.SpeciesData):
:return:
:return:
"""
"""
self
.
add_analysis_if_needed
(
analyses_dict_list
,
analysis_name
,
analysis_programversion
,
analysis_sourcename
)
analysis_id
=
self
.
add_analysis_if_needed
(
analyses_dict_list
,
analysis_name
,
analysis_programversion
,
analysis_sourcename
)
# Synchronize analysis in Tripal
# Synchronize analysis in Tripal
logging
.
info
(
"
Synchronizing analysis %s in Tripal
"
%
analysis_name
)
logging
.
info
(
"
Synchronizing analysis %s in Tripal
"
%
analysis_name
)
...
...
This diff is collapsed.
Click to expand it.
gga_run_workflow_phaeo_jbrowse.py
+
80
−
52
View file @
15c2b3be
...
@@ -131,7 +131,7 @@ class RunWorkflowJbrowse(gga_run_workflow_phaeo.RunWorkflow):
...
@@ -131,7 +131,7 @@ class RunWorkflowJbrowse(gga_run_workflow_phaeo.RunWorkflow):
logging
.
info
(
"
Success: individual tools versions and changesets validated
"
)
logging
.
info
(
"
Success: individual tools versions and changesets validated
"
)
def
add_organism_
and_sync
(
self
):
def
add_organism_
if_needed
(
self
):
get_organisms_tool_dataset
=
utilities_bioblend
.
run_tool_and_download_single_output_dataset
(
get_organisms_tool_dataset
=
utilities_bioblend
.
run_tool_and_download_single_output_dataset
(
instance
=
self
.
instance
,
instance
=
self
.
instance
,
...
@@ -283,7 +283,7 @@ def prepare_history_and_get_wf_param(sp_dict_list, main_dir, config):
...
@@ -283,7 +283,7 @@ def prepare_history_and_get_wf_param(sp_dict_list, main_dir, config):
analyses_dict_list
=
run_workflow_for_current_organism
.
get_analyses
()
analyses_dict_list
=
run_workflow_for_current_organism
.
get_analyses
()
org_id
=
run_workflow_for_current_organism
.
add_organism_
and_sync
()
org_id
=
run_workflow_for_current_organism
.
add_organism_
if_needed
()
genome_analysis_id
=
run_workflow_for_current_organism
.
add_analysis_if_needed
(
genome_analysis_id
=
run_workflow_for_current_organism
.
add_analysis_if_needed
(
analyses_dict_list
=
analyses_dict_list
,
analyses_dict_list
=
analyses_dict_list
,
analysis_name
=
run_workflow_for_current_organism
.
genome_analysis_name
,
analysis_name
=
run_workflow_for_current_organism
.
genome_analysis_name
,
...
@@ -405,17 +405,28 @@ if __name__ == "__main__":
...
@@ -405,17 +405,28 @@ if __name__ == "__main__":
# Set the workflow parameters (individual tools runtime parameters in the workflow)
# Set the workflow parameters (individual tools runtime parameters in the workflow)
workflow_parameters
=
{}
workflow_parameters
=
{}
# Input files have no parameters (they are set via assigning the hda IDs in the datamap parameter of the bioblend method)
workflow_parameters
[
constants_phaeo
.
WF_LOAD_GFF_JB_1_ORG_STEP_LOAD_FASTA
]
=
{
workflow_parameters
[
constants_phaeo
.
WF_LOAD_GFF_JB_1_ORG_STEP_LOAD_FASTA
]
=
{
"
organism
"
:
org_wf_param
.
org_id
,
"
organism
"
:
org_wf_param
.
org_id
,
"
analysis_id
"
:
org_wf_param
.
genome_analysis_id
,
"
analysis_id
"
:
org_wf_param
.
genome_analysis_id
,
"
do_update
"
:
"
true
"
}
"
do_update
"
:
"
true
"
}
workflow_parameters
[
constants_phaeo
.
WF_LOAD_GFF_JB_1_ORG_STEP_JBROWSE
]
=
{}
workflow_parameters
[
constants_phaeo
.
WF_LOAD_GFF_JB_1_ORG_STEP_JBROWSE
]
=
{}
workflow_parameters
[
constants_phaeo
.
WF_LOAD_GFF_JB_1_ORG_STEP_LOAD_GFF
]
=
{
workflow_parameters
[
constants_phaeo
.
WF_LOAD_GFF_JB_1_ORG_STEP_LOAD_GFF
]
=
{
"
organism
"
:
org_wf_param
.
org_id
,
"
organism
"
:
org_wf_param
.
org_id
,
"
analysis_id
"
:
org_wf_param
.
ogs_analysis_id
}
"
analysis_id
"
:
org_wf_param
.
ogs_analysis_id
}
workflow_parameters
[
constants_phaeo
.
WF_LOAD_GFF_JB_1_ORG_STEP_SYNC_FEATURE
]
=
{
workflow_parameters
[
constants_phaeo
.
WF_LOAD_GFF_JB_1_ORG_STEP_SYNC_FEATURE
]
=
{
"
organism_id
"
:
org_wf_param
.
org_id
}
"
organism_id
"
:
org_wf_param
.
org_id
}
workflow_parameters
[
constants_phaeo
.
WF_LOAD_GFF_JB_1_ORG_STEP_SYNC_ORG
]
=
{
"
organism_id
"
:
org_wf_param
.
org_id
}
workflow_parameters
[
constants_phaeo
.
WF_LOAD_GFF_JB_1_ORG_STEP_SYNC_GENOME_ANALYSIS
]
=
{
"
analysis_id
"
:
org_wf_param
.
genome_analysis_id
}
workflow_parameters
[
constants_phaeo
.
WF_LOAD_GFF_JB_1_ORG_STEP_SYNC_OGS_ANALYSIS
]
=
{
"
analysis_id
"
:
org_wf_param
.
ogs_analysis_id
}
workflow_parameters
[
constants_phaeo
.
WF_LOAD_GFF_JB_1_ORG_STEP_POPULATE_VIEWS
]
=
{}
workflow_parameters
[
constants_phaeo
.
WF_LOAD_GFF_JB_1_ORG_STEP_POPULATE_VIEWS
]
=
{}
workflow_parameters
[
constants_phaeo
.
WF_LOAD_GFF_JB_1_ORG_STEP_INDEX
]
=
{}
workflow_parameters
[
constants_phaeo
.
WF_LOAD_GFF_JB_1_ORG_STEP_INDEX
]
=
{}
...
@@ -485,50 +496,67 @@ if __name__ == "__main__":
...
@@ -485,50 +496,67 @@ if __name__ == "__main__":
logging
.
info
(
"
Input organism %s: 2 species detected in input dictionary
"
%
genus_species
)
logging
.
info
(
"
Input organism %s: 2 species detected in input dictionary
"
%
genus_species
)
strain_sex_org1
=
strains_list
[
0
]
strain_sex_org1
=
strains_list
[
0
]
strain_sex_org2
=
strains_list
[
1
]
strain_sex_org2
=
strains_list
[
1
]
sp
_wf_param_org1
=
strains
[
strain_sex_org1
]
org
_wf_param_org1
=
strains
[
strain_sex_org1
]
sp
_wf_param_org2
=
strains
[
strain_sex_org2
]
org
_wf_param_org2
=
strains
[
strain_sex_org2
]
# Set workflow path (2 organisms)
# Set workflow path (2 organisms)
workflow_path
=
os
.
path
.
join
(
os
.
path
.
abspath
(
script_dir
),
constants_phaeo
.
WORKFLOWS_PATH
,
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_FILE
)
workflow_path
=
os
.
path
.
join
(
os
.
path
.
abspath
(
script_dir
),
constants_phaeo
.
WORKFLOWS_PATH
,
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_FILE
)
# Check if the versions of tools specified in the workflow are installed in galaxy
# Check if the versions of tools specified in the workflow are installed in galaxy
utilities_bioblend
.
install_workflow_tools
(
workflow_path
=
workflow_path
,
instance
=
sp
_wf_param_org1
.
instance
)
utilities_bioblend
.
install_workflow_tools
(
workflow_path
=
workflow_path
,
instance
=
org
_wf_param_org1
.
instance
)
# Set the workflow parameters (individual tools runtime parameters in the workflow)
# Set the workflow parameters (individual tools runtime parameters in the workflow)
workflow_parameters
=
{}
workflow_parameters
=
{}
# Input files have no parameters (they are set via assigning the hda IDs in the datamap parameter of the bioblend method)
workflow_parameters
[
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_INPUT_GENOME_ORG1
]
=
{}
workflow_parameters
[
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_INPUT_GFF_ORG1
]
=
{}
workflow_parameters
[
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_INPUT_PROTEINS_ORG1
]
=
{}
workflow_parameters
[
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_INPUT_GENOME_ORG2
]
=
{}
workflow_parameters
[
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_INPUT_GFF_ORG2
]
=
{}
workflow_parameters
[
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_INPUT_PROTEINS_ORG2
]
=
{}
# Organism 1
# Organism 1
workflow_parameters
[
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_STEP_LOAD_FASTA_ORG1
]
=
{
workflow_parameters
[
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_STEP_LOAD_FASTA_ORG1
]
=
{
"
organism
"
:
sp_wf_param_org1
.
org_id
,
"
organism
"
:
org_wf_param_org1
.
org_id
,
"
analysis_id
"
:
sp_wf_param_org1
.
genome_analysis_id
,
"
analysis_id
"
:
org_wf_param_org1
.
genome_analysis_id
,
"
do_update
"
:
"
true
"
}
"
do_update
"
:
"
true
"
}
# workflow_parameters[JBROWSE_ORG1] = {"jbrowse_menu_url": jbrowse_menu_url_org1}
# workflow_parameters[JBROWSE_ORG1] = {"jbrowse_menu_url": jbrowse_menu_url_org1}
# workflow_parameters[JRBOWSE_ORG2] = {"jbrowse_menu_url": jbrowse_menu_url_org2}
workflow_parameters
[
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_STEP_JBROWSE_ORG1
]
=
{}
workflow_parameters
[
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_STEP_JBROWSE_ORG1
]
=
{}
workflow_parameters
[
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_STEP_JBROWSE_ORG2
]
=
{}
workflow_parameters
[
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_STEP_LOAD_GFF_ORG1
]
=
{
workflow_parameters
[
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_STEP_LOAD_GFF_ORG1
]
=
{
"
organism
"
:
sp_wf_param_org1
.
org_id
,
"
organism
"
:
org_wf_param_org1
.
org_id
,
"
analysis_id
"
:
sp_wf_param_org1
.
ogs_analysis_id
}
"
analysis_id
"
:
org_wf_param_org1
.
ogs_analysis_id
}
workflow_parameters
[
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_STEP_JB_TO_CONTAINER
]
=
{}
workflow_parameters
[
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_STEP_SYNC_FEATURE_ORG1
]
=
{
workflow_parameters
[
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_STEP_SYNC_FEATURE_ORG1
]
=
{
"
organism_id
"
:
sp_wf_param_org1
.
org_id
}
"
organism_id
"
:
org_wf_param_org1
.
org_id
}
# workflow_parameters[JBROWSE_CONTAINER] = {"organisms": [{"name": org1_full_name, "unique_id": org1_species_folder_name, }, {"name": org2_full_name, "unique_id": org2_species_folder_name}]}
# workflow_parameters[JBROWSE_CONTAINER] = {"organisms": [{"name": org1_full_name, "unique_id": org1_species_folder_name, }, {"name": org2_full_name, "unique_id": org2_species_folder_name}]}
workflow_parameters
[
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_STEP_JB_TO_CONTAINER
]
=
{}
# Organism 2
# Organism 2
workflow_parameters
[
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_STEP_LOAD_FASTA_ORG2
]
=
{
workflow_parameters
[
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_STEP_LOAD_FASTA_ORG2
]
=
{
"
organism
"
:
sp_wf_param_org2
.
org_id
,
"
organism
"
:
org_wf_param_org2
.
org_id
,
"
analysis_id
"
:
sp_wf_param_org2
.
genome_analysis_id
,
"
analysis_id
"
:
org_wf_param_org2
.
genome_analysis_id
,
"
do_update
"
:
"
true
"
}
"
do_update
"
:
"
true
"
}
workflow_parameters
[
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_STEP_LOAD_GFF_ORG2
]
=
{
workflow_parameters
[
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_STEP_LOAD_GFF_ORG2
]
=
{
"
organism
"
:
sp_wf_param_org2
.
org_id
,
"
organism
"
:
org_wf_param_org2
.
org_id
,
"
analysis_id
"
:
sp_wf_param_org2
.
ogs_analysis_id
}
"
analysis_id
"
:
org_wf_param_org2
.
ogs_analysis_id
# workflow_parameters[JRBOWSE_ORG2] = {"jbrowse_menu_url": jbrowse_menu_url_org2}
}
workflow_parameters
[
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_STEP_JRBOWSE_ORG2
]
=
{}
workflow_parameters
[
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_STEP_SYNC_FEATURE_ORG2
]
=
{
workflow_parameters
[
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_STEP_SYNC_FEATURE_ORG2
]
=
{
"
organism_id
"
:
sp_wf_param_org2
.
org_id
}
"
organism_id
"
:
org_wf_param_org2
.
org_id
}
workflow_parameters
[
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_STEP_SYNC_ORG1
]
=
{
"
organism_id
"
:
org_wf_param_org1
.
org_id
}
workflow_parameters
[
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_STEP_SYNC_ORG2
]
=
{
"
organism_id
"
:
org_wf_param_org2
.
org_id
}
workflow_parameters
[
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_STEP_SYNC_GENOME_ANALYSIS_ORG1
]
=
{
"
analysis_id
"
:
org_wf_param_org1
.
genome_analysis_id
}
workflow_parameters
[
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_STEP_SYNC_OGS_ANALYSIS_ORG1
]
=
{
"
analysis_id
"
:
org_wf_param_org1
.
ogs_analysis_id
}
workflow_parameters
[
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_STEP_SYNC_GENOME_ANALYSIS_ORG2
]
=
{
"
analysis_id
"
:
org_wf_param_org2
.
genome_analysis_id
}
workflow_parameters
[
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_STEP_SYNC_OGS_ANALYSIS_ORG2
]
=
{
"
analysis_id
"
:
org_wf_param_org2
.
ogs_analysis_id
}
# POPULATE + INDEX DATA
# POPULATE + INDEX DATA
workflow_parameters
[
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_STEP_POPULATE_VIEWS
]
=
{}
workflow_parameters
[
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_STEP_POPULATE_VIEWS
]
=
{}
workflow_parameters
[
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_STEP_INDEX
]
=
{}
workflow_parameters
[
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_STEP_INDEX
]
=
{}
...
@@ -536,13 +564,13 @@ if __name__ == "__main__":
...
@@ -536,13 +564,13 @@ if __name__ == "__main__":
# Set datamap (mapping of input files in the workflow)
# Set datamap (mapping of input files in the workflow)
datamap
=
{}
datamap
=
{}
# Organism 1
# Organism 1
datamap
[
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_INPUT_GENOME_ORG1
]
=
{
"
src
"
:
"
hda
"
,
"
id
"
:
sp
_wf_param_org1
.
genome_hda_id
}
datamap
[
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_INPUT_GENOME_ORG1
]
=
{
"
src
"
:
"
hda
"
,
"
id
"
:
org
_wf_param_org1
.
genome_hda_id
}
datamap
[
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_INPUT_GFF_ORG1
]
=
{
"
src
"
:
"
hda
"
,
"
id
"
:
sp
_wf_param_org1
.
gff_hda_id
}
datamap
[
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_INPUT_GFF_ORG1
]
=
{
"
src
"
:
"
hda
"
,
"
id
"
:
org
_wf_param_org1
.
gff_hda_id
}
datamap
[
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_INPUT_PROTEINS_ORG1
]
=
{
"
src
"
:
"
hda
"
,
"
id
"
:
sp
_wf_param_org1
.
proteins_hda_id
}
datamap
[
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_INPUT_PROTEINS_ORG1
]
=
{
"
src
"
:
"
hda
"
,
"
id
"
:
org
_wf_param_org1
.
proteins_hda_id
}
# Organism 2
# Organism 2
datamap
[
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_INPUT_GENOME_ORG2
]
=
{
"
src
"
:
"
hda
"
,
"
id
"
:
sp
_wf_param_org2
.
genome_hda_id
}
datamap
[
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_INPUT_GENOME_ORG2
]
=
{
"
src
"
:
"
hda
"
,
"
id
"
:
org
_wf_param_org2
.
genome_hda_id
}
datamap
[
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_INPUT_GFF_ORG2
]
=
{
"
src
"
:
"
hda
"
,
"
id
"
:
sp
_wf_param_org2
.
gff_hda_id
}
datamap
[
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_INPUT_GFF_ORG2
]
=
{
"
src
"
:
"
hda
"
,
"
id
"
:
org
_wf_param_org2
.
gff_hda_id
}
datamap
[
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_INPUT_PROTEINS_ORG2
]
=
{
"
src
"
:
"
hda
"
,
"
id
"
:
sp
_wf_param_org2
.
proteins_hda_id
}
datamap
[
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_INPUT_PROTEINS_ORG2
]
=
{
"
src
"
:
"
hda
"
,
"
id
"
:
org
_wf_param_org2
.
proteins_hda_id
}
with
open
(
workflow_path
,
'
r
'
)
as
ga_in_file
:
with
open
(
workflow_path
,
'
r
'
)
as
ga_in_file
:
...
@@ -559,54 +587,54 @@ if __name__ == "__main__":
...
@@ -559,54 +587,54 @@ if __name__ == "__main__":
else
:
else
:
root_url
=
config
[
constants
.
CONF_JBROWSE_MENU_URL
]
root_url
=
config
[
constants
.
CONF_JBROWSE_MENU_URL
]
# Set "Genus" and "species" as they are given in the add_organism tool (with spaces replaced by "_")
# Set "Genus" and "species" as they are given in the add_organism tool (with spaces replaced by "_")
species_strain_sex_org1
=
sp
_wf_param_org1
.
chado_species_name
.
replace
(
"
"
,
"
-
"
)
species_strain_sex_org1
=
org
_wf_param_org1
.
chado_species_name
.
replace
(
"
"
,
"
-
"
)
species_strain_sex_org2
=
sp
_wf_param_org2
.
chado_species_name
.
replace
(
"
"
,
"
-
"
)
species_strain_sex_org2
=
org
_wf_param_org2
.
chado_species_name
.
replace
(
"
"
,
"
-
"
)
jbrowse_menu_url_org1
=
"
{root_url}/sp/{genus_sp}/feature/{Genus}/{species}/mRNA/{id}
"
.
format
(
jbrowse_menu_url_org1
=
"
{root_url}/sp/{genus_sp}/feature/{Genus}/{species}/mRNA/{id}
"
.
format
(
root_url
=
root_url
,
root_url
=
root_url
,
genus_sp
=
genus_species
,
genus_sp
=
genus_species
,
Genus
=
sp
_wf_param_org1
.
genus_uppercase
,
Genus
=
org
_wf_param_org1
.
genus_uppercase
,
species
=
species_strain_sex_org1
,
species
=
species_strain_sex_org1
,
id
=
"
{id}
"
)
id
=
"
{id}
"
)
jbrowse_menu_url_org2
=
"
{root_url}/sp/{genus_sp}/feature/{Genus}/{species}/mRNA/{id}
"
.
format
(
jbrowse_menu_url_org2
=
"
{root_url}/sp/{genus_sp}/feature/{Genus}/{species}/mRNA/{id}
"
.
format
(
root_url
=
root_url
,
root_url
=
root_url
,
genus_sp
=
genus_species
,
genus_sp
=
genus_species
,
Genus
=
sp
_wf_param_org2
.
genus_uppercase
,
Genus
=
org
_wf_param_org2
.
genus_uppercase
,
species
=
species_strain_sex_org2
,
species
=
species_strain_sex_org2
,
id
=
"
{id}
"
)
id
=
"
{id}
"
)
# Replace values in the workflow dictionary
# Replace values in the workflow dictionary
workflow_dict
[
"
steps
"
][
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_STEP_JBROWSE_ORG1
][
"
tool_state
"
]
=
\
workflow_dict
[
"
steps
"
][
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_STEP_JBROWSE_ORG1
][
"
tool_state
"
]
=
\
workflow_dict
[
"
steps
"
][
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_STEP_JBROWSE_ORG1
][
"
tool_state
"
]
\
workflow_dict
[
"
steps
"
][
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_STEP_JBROWSE_ORG1
][
"
tool_state
"
]
\
.
replace
(
"
__MENU_URL_ORG1__
"
,
jbrowse_menu_url_org1
)
.
replace
(
"
__MENU_URL_ORG1__
"
,
jbrowse_menu_url_org1
)
workflow_dict
[
"
steps
"
][
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_STEP_J
R
BOWSE_ORG2
][
"
tool_state
"
]
=
\
workflow_dict
[
"
steps
"
][
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_STEP_JB
R
OWSE_ORG2
][
"
tool_state
"
]
=
\
workflow_dict
[
"
steps
"
][
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_STEP_J
R
BOWSE_ORG2
][
"
tool_state
"
]
\
workflow_dict
[
"
steps
"
][
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_STEP_JB
R
OWSE_ORG2
][
"
tool_state
"
]
\
.
replace
(
"
__MENU_URL_ORG2__
"
,
jbrowse_menu_url_org2
)
.
replace
(
"
__MENU_URL_ORG2__
"
,
jbrowse_menu_url_org2
)
# The UNIQUE_ID is specific to a combination genus_species_strain_sex so every combination should have its unique workflow
# The UNIQUE_ID is specific to a combination genus_species_strain_sex so every combination should have its unique workflow
# in galaxy --> define a naming method for these workflows
# in galaxy --> define a naming method for these workflows
workflow_dict
[
"
steps
"
][
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_STEP_JB_TO_CONTAINER
][
"
tool_state
"
]
=
\
workflow_dict
[
"
steps
"
][
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_STEP_JB_TO_CONTAINER
][
"
tool_state
"
]
=
\
workflow_dict
[
"
steps
"
][
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_STEP_JB_TO_CONTAINER
][
"
tool_state
"
]
\
workflow_dict
[
"
steps
"
][
constants_phaeo
.
WF_LOAD_GFF_JB_2_ORG_STEP_JB_TO_CONTAINER
][
"
tool_state
"
]
\
.
replace
(
"
__DISPLAY_NAME_ORG1__
"
,
sp
_wf_param_org1
.
full_name
)
\
.
replace
(
"
__DISPLAY_NAME_ORG1__
"
,
org
_wf_param_org1
.
full_name
)
\
.
replace
(
"
__UNIQUE_ID_ORG1__
"
,
sp
_wf_param_org1
.
species_folder_name
)
\
.
replace
(
"
__UNIQUE_ID_ORG1__
"
,
org
_wf_param_org1
.
species_folder_name
)
\
.
replace
(
"
__DISPLAY_NAME_ORG2__
"
,
sp
_wf_param_org2
.
full_name
)
\
.
replace
(
"
__DISPLAY_NAME_ORG2__
"
,
org
_wf_param_org2
.
full_name
)
\
.
replace
(
"
__UNIQUE_ID_ORG2__
"
,
sp
_wf_param_org2
.
species_folder_name
)
.
replace
(
"
__UNIQUE_ID_ORG2__
"
,
org
_wf_param_org2
.
species_folder_name
)
# Import the workflow in galaxy as a dict
# Import the workflow in galaxy as a dict
sp
_wf_param_org1
.
instance
.
workflows
.
import_workflow_dict
(
workflow_dict
=
workflow_dict
)
org
_wf_param_org1
.
instance
.
workflows
.
import_workflow_dict
(
workflow_dict
=
workflow_dict
)
# Get its attributes
# Get its attributes
workflow_dict_list
=
sp
_wf_param_org1
.
instance
.
workflows
.
get_workflows
(
name
=
workflow_name
)
workflow_dict_list
=
org
_wf_param_org1
.
instance
.
workflows
.
get_workflows
(
name
=
workflow_name
)
# Then get its ID (required to invoke the workflow)
# Then get its ID (required to invoke the workflow)
workflow_id
=
workflow_dict_list
[
0
][
"
id
"
]
# Index 0 is the most recently imported workflow (the one we want)
workflow_id
=
workflow_dict_list
[
0
][
"
id
"
]
# Index 0 is the most recently imported workflow (the one we want)
logging
.
debug
(
"
Workflow ID: %s
"
%
workflow_id
)
logging
.
debug
(
"
Workflow ID: %s
"
%
workflow_id
)
# Check if the workflow is found
# Check if the workflow is found
try
:
try
:
show_workflow
=
sp
_wf_param_org1
.
instance
.
workflows
.
show_workflow
(
workflow_id
=
workflow_id
)
show_workflow
=
org
_wf_param_org1
.
instance
.
workflows
.
show_workflow
(
workflow_id
=
workflow_id
)
except
bioblend
.
ConnectionError
:
except
bioblend
.
ConnectionError
:
logging
.
warning
(
"
Error finding workflow %s
"
%
workflow_name
)
logging
.
warning
(
"
Error finding workflow %s
"
%
workflow_name
)
# Finally, invoke the workflow alogn with its datamap, parameters and the history in which to invoke it
# Finally, invoke the workflow alogn with its datamap, parameters and the history in which to invoke it
sp
_wf_param_org1
.
instance
.
workflows
.
invoke_workflow
(
org
_wf_param_org1
.
instance
.
workflows
.
invoke_workflow
(
workflow_id
=
workflow_id
,
workflow_id
=
workflow_id
,
history_id
=
sp
_wf_param_org1
.
history_id
,
history_id
=
org
_wf_param_org1
.
history_id
,
params
=
workflow_parameters
,
params
=
workflow_parameters
,
inputs
=
datamap
,
inputs
=
datamap
,
allow_tool_state_corrections
=
True
)
allow_tool_state_corrections
=
True
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment