Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix patch - 0.7.9-1 #304

Merged
merged 2 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions workflow/rules/bgc_analytics.smk
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ rule antismash_overview_gather:
bgc_overview=lambda wildcards: expand("data/interim/antismash/{version}/{strains}_bgc_overview.json",
name=wildcards.name,
version=wildcards.version,
strains=[s for s in set(PEP_PROJECTS[wildcards.name].sample_table.genome_id)],
strains=[s for s in PEP_PROJECTS[wildcards.name].sample_table.genome_id.unique()],
),
mapping_dir = "data/interim/bgcs/{name}/{version}",
output:
Expand Down Expand Up @@ -71,13 +71,13 @@ rule antismash_summary:
bgc_count=lambda wildcards: expand(
"data/interim/antismash/{version}/{strains}_bgc_counts.json",
version=wildcards.version,
strains=[s for s in set(PEP_PROJECTS[wildcards.name].sample_table.genome_id)],
strains=[s for s in PEP_PROJECTS[wildcards.name].sample_table.genome_id.unique()],
),
as_dir=lambda wildcards: expand(
"data/processed/{name}/antismash/{version}/{strains}",
name=wildcards.name,
version=wildcards.version,
strains=[s for s in set(PEP_PROJECTS[wildcards.name].sample_table.genome_id)],
strains=[s for s in PEP_PROJECTS[wildcards.name].sample_table.genome_id.unique()],
),
bgc_overview="data/processed/{name}/tables/df_regions_antismash_{version}.csv",
output:
Expand Down
13 changes: 7 additions & 6 deletions workflow/rules/common.smk
Original file line number Diff line number Diff line change
Expand Up @@ -346,14 +346,15 @@ def extract_project_information(config, project_variable="projects"):
)
# grab a bgcflow pep project
if p["name"].endswith(".yaml"):
pep_file = p["name"]
p = peppy.Project(p["name"], sample_table_index="genome_id")
assert len(workflow.configfiles) == 1, f"Only one config file is allowed. Found {workflow.configfiles}"
pep_file = Path(workflow.configfiles[0]).parent.parent / p["name"]
p = peppy.Project(str(pep_file), sample_table_index="genome_id")

# mask pipelines and rules as alias, use rules as default
if 'pipelines' in p.config.keys():
p.config['rules'] = p.config.pop("pipelines")

print(f" - Processing project [{p.name}]", file=sys.stderr)
print(f" - Processing project [{pep_file}]", file=sys.stderr)

# make sure each project has unique names
assert (
Expand Down Expand Up @@ -604,7 +605,8 @@ def get_dependency_version(dep, dep_key):
result {list} -- list of dependency version tags
"""
print(f"{dep_key} from: {dep[dep_key]}", file=sys.stderr)
with open(dep[dep_key]) as file:
conda_env_path = workflow.source_path(f"../../{dep[dep_key]}")
with open(conda_env_path) as file:
result = []
documents = yaml.full_load(file)
for i in documents["dependencies"]:
Expand Down Expand Up @@ -696,8 +698,7 @@ def get_project_outputs(
Returns:
final_output {list} -- list of final output files
"""

with open(rule_dict_path, "r") as file:
with open(workflow.source_path(f"../../{rule_dict_path}"), "r") as file:
rule_dict = yaml.safe_load(file)

selection = [
Expand Down