Skip to content

Commit

Permalink
fix: sample has umis (#265)
Browse files Browse the repository at this point in the history
Co-authored-by: Felix Mölder <[email protected]>
  • Loading branch information
FelixMoelder and FelixMoelder authored Aug 25, 2023
1 parent cc486d7 commit 914ddfa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions workflow/rules/common.smk
Original file line number Diff line number Diff line change
Expand Up @@ -392,9 +392,9 @@ def get_markduplicates_extra(wc):
c = config["params"]["picard"]["MarkDuplicates"]

if sample_has_umis(wc.sample):
b = ""
else:
b = "--BARCODE_TAG RX"
else:
b = ""

if is_activated("calc_consensus_reads"):
d = "--TAG_DUPLICATE_SET_MEMBERS true"
Expand Down Expand Up @@ -898,7 +898,7 @@ def get_umi_fastq(wildcards):


def sample_has_umis(sample):
return pd.isna(samples.loc[sample, "umi_read"])
return pd.notna(samples.loc[sample, "umi_read"])


def get_umi_read_structure(wildcards):
Expand Down
4 changes: 2 additions & 2 deletions workflow/rules/mapping.smk
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ rule annotate_umis:

rule mark_duplicates:
input:
bams=lambda wc: "results/mapped/{sample}.bam"
bams=lambda wc: "results/mapped/{sample}.annotated.bam"
if sample_has_umis(wc.sample)
else "results/mapped/{sample}.annotated.bam",
else "results/mapped/{sample}.bam",
output:
bam=temp("results/dedup/{sample}.bam"),
metrics="results/qc/dedup/{sample}.metrics.txt",
Expand Down

0 comments on commit 914ddfa

Please sign in to comment.