Skip to content

Commit 18e5d6b

Browse files
committed
working for PE data
1 parent 8e94b9a commit 18e5d6b

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

workflow/rules/damid.smk

+2
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ if config["plasmid_fasta"] == "none":
6666
idx=f"resources/bowtie2_index/{resources.genome}_{resources.build}_{maskedgenes}.masked/index",
6767
binsize=config["damidseq_pipeline"]["binsize"],
6868
normalization_method=config["damidseq_pipeline"]["normalization"],
69+
extension=".sorted.bam",
6970
extra=config["damidseq_pipeline"]["extra"],
7071
conda:
7172
"../envs/damid.yaml"
@@ -196,6 +197,7 @@ if config["plasmid_fasta"] == "none":
196197
idx=f"resources/bowtie2_index/{resources.genome}_{resources.build}_{maskedgenes}.masked/index",
197198
binsize=config["damidseq_pipeline"]["binsize"],
198199
normalization_method=config["damidseq_pipeline"]["normalization"],
200+
extension=".extended.bam",
199201
extra=config["damidseq_pipeline"]["extra"],
200202
conda:
201203
"../envs/damid.yaml"

workflow/scripts/damidseq_pipeline.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,13 @@ def move_files(extension):
3333

3434
# Load Snakemake variables
3535
bams = snakemake.input["bam"]
36-
bams = [os.path.join(cwd,x) for x in bams]
36+
bams = [os.path.join(cwd, x) for x in bams]
3737
gatc = os.path.join(cwd, snakemake.input["gatc"])
3838
threads = snakemake.threads
3939
bins = snakemake.params["binsize"]
4040
normalization_method = snakemake.params["normalization_method"]
4141
idx = os.path.join(cwd,snakemake.params["idx"])
42+
extension = snakemake.params["extension"]
4243
extra = snakemake.params["extra"]
4344
log = os.path.join(cwd, snakemake.log[0])
4445

@@ -57,8 +58,8 @@ def move_files(extension):
5758
damidseq_pipeline = os.path.join(cwd,"resources/damidseq_pipeline/damidseq_pipeline")
5859

5960
# Get dam bam
60-
dam_bam = [x for x in bams if re.search("dam.extended.bam$", x.lower())]
61-
assert len(dam_bam) == 1
61+
dam_bam = [x for x in bams if x.lower().endswith(f"dam{extension}")]
62+
assert len(dam_bam) == 1, "No Dam only bam file found..."
6263
# TO DO: allow for multiple Dam only bam files (i.e. multiple conditions)
6364

6465
# Get non-Dam bam files

0 commit comments

Comments
 (0)