Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bioinfo_utils
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Blaise LI
bioinfo_utils
Commits
08f6f523
Commit
08f6f523
authored
4 years ago
by
Blaise Li
Browse files
Options
Downloads
Patches
Plain Diff
Accept methods outputs and genome config file.
parent
89dab599
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Data_submission/build_file_dicts.py
+16
-3
16 additions, 3 deletions
Data_submission/build_file_dicts.py
with
16 additions
and
3 deletions
Data_submission/build_file_dicts.py
+
16
−
3
View file @
08f6f523
...
@@ -229,10 +229,14 @@ def main():
...
@@ -229,10 +229,14 @@ def main():
assert
not
common_vars
,
f
"
Variable overwriting hazard!
\n
{
common_vars
}
"
assert
not
common_vars
,
f
"
Variable overwriting hazard!
\n
{
common_vars
}
"
vars_from_analyses
|=
set
(
analysis_config
.
keys
())
vars_from_analyses
|=
set
(
analysis_config
.
keys
())
# This may be needed for analysis types with configurable genome
# This may be needed for analysis types with configurable genome
genome
=
analysis_config
.
get
(
genome
_dict
=
analysis_config
.
get
(
"
genome_dict
"
,
"
genome_dict
"
,
# default genome name will be "C_elegans"
# default genome name will be "C_elegans"
{
"
name
"
:
"
C_elegans
"
})[
"
name
"
]
{
"
name
"
:
"
C_elegans
"
})
if
isinstance
(
genome_dict
,
(
str
,
bytes
)):
with
open
(
analysis_config
[
"
genome_dict
"
])
as
gendict_fh
:
genome_dict
=
yload
(
gendict_fh
)
genome
=
genome_dict
[
"
name
"
]
# Load the snakefile to get information
# Load the snakefile to get information
# about the rule making bigwig files
# about the rule making bigwig files
# Based on snakemake/__init__.py and snakemake/workflow.py
# Based on snakemake/__init__.py and snakemake/workflow.py
...
@@ -253,7 +257,16 @@ def main():
...
@@ -253,7 +257,16 @@ def main():
#after_loading_vars = list(recdir())
#after_loading_vars = list(recdir())
# Use pattern matching so that it fails if we have not exactly
# Use pattern matching so that it fails if we have not exactly
# one bigwig file in the output of the rule
# one bigwig file in the output of the rule
try
:
[
bw_pattern
]
=
sf
.
_rules
[
bw_rulename
].
output
[
bw_pattern
]
=
sf
.
_rules
[
bw_rulename
].
output
except
ValueError
:
try
:
# Sometimes, a rule may also output a "methods" file
[
bw_pattern
,
methods_pattern
]
=
sf
.
_rules
[
bw_rulename
].
output
assert
methods_pattern
.
endswith
(
"
_methods.txt
"
)
except
ValueError
:
print
(
analysis_snakefile
,
bw_rulename
,
file
=
sys
.
stderr
)
raise
#for varname in set(after_loading_vars) - set(before_loading_vars):
#for varname in set(after_loading_vars) - set(before_loading_vars):
# # https://stackoverflow.com/a/26545111/1878788
# # https://stackoverflow.com/a/26545111/1878788
# del globals()[varname]
# del globals()[varname]
...
...
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