Skip to content

Commit

Permalink
Refactor get_group_for_sample function in helpers.py to handle missin…
Browse files Browse the repository at this point in the history
…g samples in normalisation groups
  • Loading branch information
alsmith151 committed Apr 17, 2024
1 parent 43aedb8 commit d21ecfd
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions seqnado/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,14 @@ def pepe_silvia():
def get_group_for_sample(wildcards, design: Union[Design, DesignIP]):
from seqnado.design import NormGroups

norm_groups = NormGroups.from_design(design)
group = norm_groups.get_sample_group(wildcards.sample)
return group
norm_groups = NormGroups.from_design(design, include_controls=True)

try:
group = norm_groups.get_sample_group(wildcards.sample)
return group
except KeyError:
logger.error(f"Sample {wildcards.sample} not found in normalisation groups.")
raise KeyError(f"Sample {wildcards.sample} not found in normalisation groups.")

def get_scale_method(config: Dict) -> Optional[str]:
"""
Expand Down

0 comments on commit d21ecfd

Please sign in to comment.