Skip to content

Commit 707ee43

Browse files
mrvollgerMitchell R. Vollger
andauthored
v0.1.2 (#36)
* update * check for no reads passing filters * Fix odd too many files open error in bigtools by not reading from stdin * bump version --------- Co-authored-by: Mitchell R. Vollger <mvollger@gmai.com>
1 parent a9ed365 commit 707ee43

File tree

4 files changed

+60
-43
lines changed

4 files changed

+60
-43
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## v0.1.2
6+
7+
- fix #34
8+
- fix #33
9+
- Update to pull test data from a new s3 bucket
10+
511
## v0.1.1
612

713
Added more informative error messages if an FDR distribution cannot be made or there is not enough coverage.

pixi.toml

Lines changed: 42 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -4,56 +4,58 @@ channels = ["conda-forge", "bioconda"]
44
description = "Add a short description here"
55
name = "FIRE"
66
platforms = ["osx-64", "linux-64"]
7-
version = "0.1.1"
7+
version = "0.1.2"
88

99
[tasks]
1010
fmt = "ruff format . && taplo format pixi.toml && snakefmt workflow/"
1111
test-data = { cmd = [
12-
"cd",
13-
"$INIT_CWD",
14-
"&&",
15-
"mkdir",
16-
"-p",
17-
"fire-test-data",
18-
"&&",
19-
"aws",
20-
"s3",
21-
"--no-sign-request",
22-
"sync",
23-
"s3://stergachis-public1/FIRE/test-data",
24-
"fire-test-data/",
12+
"cd",
13+
"$INIT_CWD",
14+
"&&",
15+
"mkdir",
16+
"-p",
17+
"fire-test-data",
18+
"&&",
19+
"aws",
20+
"s3",
21+
"--no-sign-request",
22+
"sync",
23+
"--endpoint-url",
24+
"https://s3.kopah.orci.washington.edu",
25+
"s3://stergachis/public/FIRE/test-data",
26+
"fire-test-data/",
2527
] }
2628
test = { cmd = [
27-
"cd",
28-
"$INIT_CWD/fire-test-data",
29-
"&&",
30-
"snakemake",
31-
"-s",
32-
"$PIXI_PROJECT_ROOT/workflow/Snakefile",
33-
"--configfile",
34-
"test.yaml",
35-
"-k",
36-
], depends_on = [
37-
"test-data",
29+
"cd",
30+
"$INIT_CWD/fire-test-data",
31+
"&&",
32+
"snakemake",
33+
"-s",
34+
"$PIXI_PROJECT_ROOT/workflow/Snakefile",
35+
"--configfile",
36+
"test.yaml",
37+
"-k",
38+
], depends-on = [
39+
"test-data",
3840
], clean-env = true }
3941

4042
fire = { cmd = [
41-
"cd",
42-
"$INIT_CWD",
43-
"&&",
44-
"snakemake",
45-
"-s",
46-
"$PIXI_PROJECT_ROOT/workflow/Snakefile",
43+
"cd",
44+
"$INIT_CWD",
45+
"&&",
46+
"snakemake",
47+
"-s",
48+
"$PIXI_PROJECT_ROOT/workflow/Snakefile",
4749
] }
4850
slurm = { cmd = [
49-
"cd",
50-
"$INIT_CWD",
51-
"&&",
52-
"snakemake",
53-
"-s",
54-
"$PIXI_PROJECT_ROOT/workflow/Snakefile",
55-
"--profile",
56-
"$PIXI_PROJECT_ROOT/profiles/slurm-executor",
51+
"cd",
52+
"$INIT_CWD",
53+
"&&",
54+
"snakemake",
55+
"-s",
56+
"$PIXI_PROJECT_ROOT/workflow/Snakefile",
57+
"--profile",
58+
"$PIXI_PROJECT_ROOT/profiles/slurm-executor",
5759
] }
5860

5961
[dependencies]
@@ -62,7 +64,7 @@ snakemake = "==8.21"
6264
snakemake-executor-plugin-slurm = ">=0.11.2"
6365
snakefmt = "*"
6466
ruff = "*"
65-
awscli = "2.22"
67+
awscli = "2.22.*"
6668
taplo = "*"
6769

6870
[pypi-dependencies]

workflow/rules/apply-model.smk

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ rule fire:
3636
--output-fmt-option embed_ref=1 \
3737
--input-fmt-option required_fields=0x1bff \
3838
--write-index -o {output.cram}
39+
40+
# check if the cram file has zero reads
41+
reads_in_header=$(samtools view {output.cram} | head | wc -l || true)
42+
if [ $reads_in_header -eq 0 ]; then
43+
printf "\nNo reads passed filters exiting...\n\nPlease review https://fiberseq.github.io/quick-start.html to make sure the input BAM has been correctly processed.\n\n"
44+
exit 1
45+
fi
3946
"""
4047

4148

workflow/rules/coverages.smk

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ rule unreliable_coverage_regions:
151151
output:
152152
bed="results/{sm}/additional-outputs-{v}/coverage/unreliable-coverage-regions.bed.gz",
153153
bed_tbi="results/{sm}/additional-outputs-{v}/coverage/unreliable-coverage-regions.bed.gz.tbi",
154+
tmp=temp("temp/{sm}/additional-outputs-{v}/unreliable-coverage-regions.bed"),
154155
bb="results/{sm}/trackHub-{v}/bb/unreliable-coverage-regions.bb",
155156
threads: 4
156157
params:
@@ -171,10 +172,11 @@ rule unreliable_coverage_regions:
171172
> {output.bed}
172173
173174
# bigbed
174-
bgzip -cd {output.bed} -@ {threads} \
175-
| bigtools bedtobigbed \
175+
# for some reason bigtools gives a too many files open error when reading from stdin
176+
bedtools merge -i {output.bed} > {output.tmp}
177+
bigtools bedtobigbed \
176178
-s start -a {params.bed3_as} \
177-
- {input.fai} {output.bb}
179+
{output.tmp} {input.fai} {output.bb}
178180
179181
# index
180182
tabix -f -p bed {output.bed}

0 commit comments

Comments
 (0)