Skip to content

Commit

Permalink
Merge pull request #402 from genomic-medicine-sweden/missing_files_ha…
Browse files Browse the repository at this point in the history
…ndling

fix: handle missing files better
  • Loading branch information
jonca79 authored Feb 29, 2024
2 parents 6bf62f8 + 7d7c904 commit bdde526
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions workflow/rules/common_references.smk
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ __license__ = "GPL-3"

import pandas as pd
import yaml
import logging
from snakemake.utils import validate
from snakemake.utils import min_version

Expand All @@ -13,6 +14,8 @@ from hydra_genetics.utils.resources import load_resources
from hydra_genetics.utils.samples import *
from hydra_genetics.utils.units import *

log = logging.getLogger()

min_version("7.18.0")

### Set and validate config file
Expand Down Expand Up @@ -142,10 +145,11 @@ def get_cnvkit_antitarget(units: pandas.DataFrame, name: str) -> typing.List[str

def get_files(units: pandas.DataFrame, name: str, string_path: str):
types = []
sample_list = get_samples(samples)
for i in output_spec["files"]:
if i["name"] == name:
types = i["types"]
data = [string_path % (t.sample, t.type) for t in units[units["type"].isin(types)].itertuples()]
data = [string_path % (t.sample, t.type) for t in units[units["type"].isin(types)].itertuples() if t.sample in sample_list]
if not data:
raise Exception(f"Couldn't create file list using name: {name}, {string_path}")
log.warning(f"No files matching the output files found for rules using name: {name}, {string_path}")
return set(data)

0 comments on commit bdde526

Please sign in to comment.