Skip to content

Commit

Permalink
formating
Browse files Browse the repository at this point in the history
  • Loading branch information
SilasK committed Oct 10, 2023
1 parent 9094c46 commit 2b19af7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
15 changes: 10 additions & 5 deletions workflow/rules/qc.smk
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,12 @@ if not SKIP_QC:
maxns=config.get("preprocess_max_ns", PREPROCESS_MAX_NS),
prealloc=config.get("preallocate_ram", PREALLOCATE_RAM),
inputs=lambda wc, input: io_params_for_tadpole(input.reads),
outputs= io_params_for_tadpole(output.reads,key="out",allow_singletons=False),
outputs=io_params_for_tadpole(
output.reads, key="out", allow_singletons=False
),
log:
stout="{sample}/logs/QC/quality_filter.log",
sterr = "{sample}/logs/QC/quality_filter.err",
sterr="{sample}/logs/QC/quality_filter.err",
conda:
"%s/required_packages.yaml" % CONDAENV
threads: config.get("threads", 1)
Expand Down Expand Up @@ -371,8 +373,12 @@ if not SKIP_QC:
ambiguous=config.get("contaminant_ambiguous", CONTAMINANT_AMBIGUOUS),
k=config.get("contaminant_kmer_length", CONTAMINANT_KMER_LENGTH),
paired="true" if PAIRED_END else "false",
inputs= io_params_for_tadpole(output.reads,key="in",allow_singletons=False),
outputs= io_params_for_tadpole(output.reads,key="outu",allow_singletons=False),
inputs=io_params_for_tadpole(
output.reads, key="in", allow_singletons=False
),
outputs=io_params_for_tadpole(
output.reads, key="outu", allow_singletons=False
),
log:
sterr="{sample}/logs/QC/decontamination.err",
stout="{sample}/logs/QC/decontamination.log",
Expand Down Expand Up @@ -400,7 +406,6 @@ if not SKIP_QC:
" -Xmx{resources.java_mem}G "
" 1> {log.stout} "
" 2> {log.sterr} "


PROCESSED_STEPS.append("QC")

Expand Down
8 changes: 5 additions & 3 deletions workflow/rules/sample_table.smk
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sampleTable = load_sample_table()
validate_bingroup_size(sampleTable, config, logger)


def io_params_for_tadpole(io, key="in",allow_singletons=True):
def io_params_for_tadpole(io, key="in", allow_singletons=True):
"""This function generates the input flag needed for bbwrap/tadpole for all cases
possible for get_quality_controlled_reads.
Expand All @@ -27,8 +27,10 @@ def io_params_for_tadpole(io, key="in",allow_singletons=True):
flag = f"{key}1={io[0]},{io[2]} {key}2={io[1]}"
logger.error("Using singletons reads will be deprecated.")
if not allow_singletons:
raise IOError("Got an input object with 3 files, but allow_singletons is False")

raise IOError(
"Got an input object with 3 files, but allow_singletons is False"
)

else:
logger.error(
(
Expand Down

0 comments on commit 2b19af7

Please sign in to comment.