Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def get_model_details(mtype, name):
inputs.append(cb_txt)
if "lr-bc" in model_dict:
lr_matches_tsv = f"{preproc_d}/scTagger/{sample}/{sample}.lr_matches.tsv.gz"
params_build.append(f"--lr-bc {lr_matches_tsv}")
params_build.append(f"--lr-br {lr_matches_tsv}")
inputs.append(lr_matches_tsv)
# Outputs / Run params
params_run.append(f"-a {Xpr_tsv}")
Expand All @@ -82,7 +82,7 @@ def get_model_details(mtype, name):
elif mtype == "Seq":
# Inputs / Build params
assert set(model_dict.keys()) <= {"sample", "params"}
paf = get_sample_paf(sample, "badread.cDNA")
paf = get_badread_paf(sample, "badread.cDNA")
params_build.append(f"--alignment {paf}")
inputs.append(paf)
fastqs = get_sample_fastqs(sample)
Expand Down Expand Up @@ -172,6 +172,9 @@ def get_sample_ref(sample, ref_type):
def get_sample_paf(sample, ref_type):
return f"{preproc_d}/minimap2/{sample}.{ref_type}.paf"

def get_badread_paf(sample, ref_type):
return f"{preproc_d}/minimap2/{sample}.{ref_type}.paf.gz"


def get_barcode_whitelist(name):
return config["refs"]["barcodes"][name]
Expand Down Expand Up @@ -541,9 +544,9 @@ rule model_sequence:
params:
model=lambda wc: models["Seq", wc.model_name].params_build,
shell:
"badread qscore_model {params.model} > {output.error_model}"
"badread error_model {params.model} > {output.error_model}"
" && "
"badread error_model {params.model} > {output.qscore_model}"
"badread qscore_model {params.model} > {output.qscore_model}"


### Preprocessing rules ###
Expand Down Expand Up @@ -611,16 +614,15 @@ rule minimap_cdna_for_badread_models:
reads=lambda wc: get_sample_fastqs(wc.sample),
ref=lambda wc: get_sample_ref(wc.sample, "cDNA"),
output:
paf=f"{preproc_d}/badread/{{sample}}.badread.cDNA.paf",
paf=f"{preproc_d}/minimap2/{{sample}}.badread.cDNA.paf.gz",
threads: 32
shell:
"minimap2"
" -t {threads}"
" -x map-ont"
" -c"
" -o {output.paf}"
" {input.ref}"
" {input.reads}"
" {input.reads} | gzip > {output.paf}"


rule cat_refs:
Expand All @@ -636,4 +638,4 @@ rule cat_refs:
if ref.endswith(".gz"):
shell("zcat {ref} >> {output.ref}")
else:
shell("cat {ref} >> {output.ref}")
shell("cat {ref} >> {output.ref}")
9 changes: 5 additions & 4 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ TS_experiments:
params: ""
model: "N1"
- plA:
params: ""
params: "--normal=15,7.5"
head_2:
pipeline:
- Tsb:
Expand All @@ -48,7 +48,7 @@ TS_experiments:
params: ""
model: "N1"
- plA:
params: ""
params: "--normal=15,7.5"
- SCB:
params: ""
- Tag:
Expand All @@ -65,7 +65,7 @@ TS_experiments:
- Flp:
params: "-p 0.5"
- Seq:
params: "--skip-qual-compute --badread-model nanopore2020"
params: "--skip-qual-compute --badread-error-model nanopore2023"

exec:
tksm: build/bin/tksm
Expand All @@ -81,6 +81,7 @@ refs:
GTF: data/refs/Homo_sapiens.GRCh38.108.chr21.gtf
barcodes:
10x: data/refs/3M-february-2018.txt.gz
10x: data/refs/3M-february-2018.txt.gz

samples:
"MCF7-sgnex":
Expand All @@ -104,4 +105,4 @@ models:
N1_cb-gen:
sample: N1
cb-txt: 10x
params: "--cb-count 500"
params: "--cb-count 500"