Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
ZARP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
zavolan_group
pipelines
ZARP
Commits
cbd41cd0
Commit
cbd41cd0
authored
5 years ago
by
Dominik Burri
Browse files
Options
Downloads
Patches
Plain Diff
alfa biotypes integrated
parent
8c9ef971
No related branches found
No related tags found
1 merge request
!39
Alfa qc
Pipeline
#10232
passed
5 years ago
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
snakemake/Snakefile
+4
-3
4 additions, 3 deletions
snakemake/Snakefile
snakemake/paired_end.snakefile.smk
+64
-6
64 additions, 6 deletions
snakemake/paired_end.snakefile.smk
snakemake/single_end.snakefile.smk
+65
-6
65 additions, 6 deletions
snakemake/single_end.snakefile.smk
with
133 additions
and
15 deletions
snakemake/Snakefile
+
4
−
3
View file @
cbd41cd0
...
...
@@ -11,6 +11,7 @@ import pandas as pd
############################
samples_table = pd.read_csv(config["samples"], header=0, index_col=0, comment='#', engine='python', sep="\t")
directionality = {"--fr": "fr-firststrand", "--rv": "fr-secondstrand"}
localrules: finish
...
...
@@ -43,7 +44,7 @@ rule finish:
zip,
sample= [i for i in list(samples_table.index.values)],
seqmode= [samples_table.loc[i,"seqmode"] for i in list(samples_table.index.values)]),
alfa = expand(os.path.join(config["alfa_indexes"],"{organism}","{index_size}","ALFA", "sorted_genes.stranded.ALFA_index"),
alfa
_index
= expand(os.path.join(config["alfa_indexes"],"{organism}","{index_size}","ALFA", "sorted_genes.stranded.ALFA_index"),
zip,
organism= list(set([samples_table.loc[i,"organism"] for i in list(samples_table.index.values)])),
index_size= list(set([samples_table.loc[i,"index_size"] for i in list(samples_table.index.values)]))),
...
...
@@ -51,8 +52,8 @@ rule finish:
config["output_dir"],
"{seqmode}",
"{sample}",
"
star_rpm
",
"
STAR_Signal.Unique.str1.out.bg
"),
"
ALFA
",
"
ALFA_plots.Biotypes.pdf
"),
zip,
sample= [i for i in list(samples_table.index.values)],
seqmode= [samples_table.loc[i,"seqmode"] for i in list(samples_table.index.values)])
...
...
This diff is collapsed.
Click to expand it.
snakemake/paired_end.snakefile.smk
+
64
−
6
View file @
cbd41cd0
...
...
@@ -353,35 +353,35 @@ rule star_rpm_paired_end:
config["output_dir"],
"paired_end",
"{sample}",
"
star_rpm
",
"
ALFA
",
"STAR_Signal.Unique.str1.out.bg"),
os.path.join(
config["output_dir"],
"paired_end",
"{sample}",
"
star_rpm
",
"
ALFA
",
"STAR_Signal.UniqueMultiple.str1.out.bg")),
str2 = (os.path.join(
config["output_dir"],
"paired_end",
"{sample}",
"
star_rpm
",
"
ALFA
",
"STAR_Signal.Unique.str2.out.bg"),
os.path.join(
config["output_dir"],
"paired_end",
"{sample}",
"
star_rpm
",
"
ALFA
",
"STAR_Signal.UniqueMultiple.str2.out.bg"))
params:
out_dir = directory(os.path.join(config["output_dir"],
"paired_end",
"{sample}",
"
star_rpm
")),
"
ALFA
")),
prefix = os.path.join(config["output_dir"],
"paired_end",
"{sample}",
"
star_rpm
", "STAR_"),
"
ALFA
", "STAR_"),
stranded = "Stranded"
singularity:
"docker://zavolab/star:2.6.0a"
...
...
@@ -402,6 +402,64 @@ rule star_rpm_paired_end:
"""
rule alfa_bg_paired_end:
''' Run ALFA from stranded bedgraph files '''
input:
str1 = os.path.join(
config["output_dir"],
"paired_end",
"{sample}",
"ALFA",
"STAR_Signal.UniqueMultiple.str1.out.bg"),
str2 = os.path.join(
config["output_dir"],
"paired_end",
"{sample}",
"ALFA",
"STAR_Signal.UniqueMultiple.str2.out.bg"),
gtf = lambda wildcards: os.path.join(config["alfa_indexes"], samples_table.loc[wildcards.sample, "organism"],
str(samples_table.loc[wildcards.sample, "index_size"]), "ALFA", "sorted_genes.stranded.ALFA_index")
output:
biotypes = os.path.join(
config["output_dir"],
"paired_end",
"{sample}",
"ALFA",
"ALFA_plots.Biotypes.pdf"),
categories = os.path.join(
config["output_dir"],
"paired_end",
"{sample}",
"ALFA",
"ALFA_plots.Categories.pdf")
params:
out_dir = directory(os.path.join(
config["output_dir"],
"paired_end",
"{sample}",
"ALFA")),
in_file_str1 = "STAR_Signal.UniqueMultiple.str1.out.bg",
rename_str1 = "STAR_Signal.UniqueMultiple.out.plus.bg",
in_file_str2 = "STAR_Signal.UniqueMultiple.str2.out.bg",
rename_str2 = "STAR_Signal.UniqueMultiple.out.minus.bg",
genome_index = lambda wildcards: os.path.abspath(os.path.join(config["alfa_indexes"], samples_table.loc[wildcards.sample, "organism"],
str(samples_table.loc[wildcards.sample, "index_size"]), "ALFA", "sorted_genes")),
name = "{sample}",
orientation = lambda wildcards: directionality[samples_table.loc[wildcards.sample, "kallisto_directionality"]]
singularity:
"docker://zavolab/alfa:1.1.1"
log: os.path.abspath(os.path.join(config["local_log"], "paired_end", "{sample}", "alfa_bg_paired_end.log"))
shell:
"""
cd {params.out_dir}; \
cp {params.in_file_str1} {params.rename_str1}; \
cp {params.in_file_str2} {params.rename_str2}; \
(alfa -g {params.genome_index} \
--bedgraph {params.rename_str1} {params.rename_str2} {params.name} \
-s {params.orientation}) &> {log}; \
rm {params.rename_str1} {params.rename_str2}
"""
...
...
This diff is collapsed.
Click to expand it.
snakemake/single_end.snakefile.smk
+
65
−
6
View file @
cbd41cd0
...
...
@@ -279,35 +279,35 @@ rule star_rpm_single_end:
config["output_dir"],
"single_end",
"{sample}",
"
star_rpm
",
"
ALFA
",
"STAR_Signal.Unique.str1.out.bg"),
os.path.join(
config["output_dir"],
"single_end",
"{sample}",
"
star_rpm
",
"
ALFA
",
"STAR_Signal.UniqueMultiple.str1.out.bg")),
str2 = (os.path.join(
config["output_dir"],
"single_end",
"{sample}",
"
star_rpm
",
"
ALFA
",
"STAR_Signal.Unique.str2.out.bg"),
os.path.join(
config["output_dir"],
"single_end",
"{sample}",
"
star_rpm
",
"
ALFA
",
"STAR_Signal.UniqueMultiple.str2.out.bg"))
params:
out_dir = directory(os.path.join(config["output_dir"],
"single_end",
"{sample}",
"
star_rpm
")),
"
ALFA
")),
prefix = os.path.join(config["output_dir"],
"single_end",
"{sample}",
"
star_rpm
", "STAR_"),
"
ALFA
", "STAR_"),
stranded = "Stranded"
singularity:
"docker://zavolab/star:2.6.0a"
...
...
@@ -325,4 +325,63 @@ rule star_rpm_single_end:
--outWigStrand {params.stranded} \
--outWigNorm "RPM" \
--outFileNamePrefix {params.prefix}) &> {log}
"""
rule alfa_bg_single_end:
''' Run ALFA from stranded bedgraph files '''
input:
str1 = os.path.join(
config["output_dir"],
"single_end",
"{sample}",
"ALFA",
"STAR_Signal.UniqueMultiple.str1.out.bg"),
str2 = os.path.join(
config["output_dir"],
"single_end",
"{sample}",
"ALFA",
"STAR_Signal.UniqueMultiple.str2.out.bg"),
gtf = lambda wildcards: os.path.join(config["alfa_indexes"], samples_table.loc[wildcards.sample, "organism"],
str(samples_table.loc[wildcards.sample, "index_size"]), "ALFA", "sorted_genes.stranded.ALFA_index")
output:
biotypes = os.path.join(
config["output_dir"],
"single_end",
"{sample}",
"ALFA",
"ALFA_plots.Biotypes.pdf"),
categories = os.path.join(
config["output_dir"],
"single_end",
"{sample}",
"ALFA",
"ALFA_plots.Categories.pdf")
params:
out_dir = directory(os.path.join(
config["output_dir"],
"single_end",
"{sample}",
"ALFA")),
in_file_str1 = "STAR_Signal.UniqueMultiple.str1.out.bg",
rename_str1 = "STAR_Signal.UniqueMultiple.out.plus.bg",
in_file_str2 = "STAR_Signal.UniqueMultiple.str2.out.bg",
rename_str2 = "STAR_Signal.UniqueMultiple.out.minus.bg",
genome_index = lambda wildcards: os.path.abspath(os.path.join(config["alfa_indexes"], samples_table.loc[wildcards.sample, "organism"],
str(samples_table.loc[wildcards.sample, "index_size"]), "ALFA", "sorted_genes")),
name = "{sample}",
orientation = lambda wildcards: directionality[samples_table.loc[wildcards.sample, "kallisto_directionality"]]
singularity:
"docker://zavolab/alfa:1.1.1"
log: os.path.abspath(os.path.join(config["local_log"], "single_end", "{sample}", "alfa_bg_single_end.log"))
shell:
"""
cd {params.out_dir}; \
cp {params.in_file_str1} {params.rename_str1}; \
cp {params.in_file_str2} {params.rename_str2}; \
(alfa -g {params.genome_index} \
--bedgraph {params.rename_str1} {params.rename_str2} {params.name} \
-s {params.orientation}) &> {log}; \
rm {params.rename_str1} {params.rename_str2}
"""
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment