Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bioinfo_utils
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
Blaise LI
bioinfo_utils
Commits
eeec5bf1
Commit
eeec5bf1
authored
7 years ago
by
Blaise Li
Browse files
Options
Downloads
Patches
Plain Diff
More adaptable mapping wrapper.
parent
379e744e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
PRO-seq/PRO-seq.snakefile
+3
-0
3 additions, 0 deletions
PRO-seq/PRO-seq.snakefile
small_RNA-seq/small_RNA-seq.snakefile
+3
-1
3 additions, 1 deletion
small_RNA-seq/small_RNA-seq.snakefile
snakemake_wrappers/map_on_genome/wrapper.py
+25
-7
25 additions, 7 deletions
snakemake_wrappers/map_on_genome/wrapper.py
with
31 additions
and
8 deletions
PRO-seq/PRO-seq.snakefile
+
3
−
0
View file @
eeec5bf1
...
@@ -55,6 +55,8 @@ from libworkflows import read_htseq_counts, sum_htseq_counts
...
@@ -55,6 +55,8 @@ from libworkflows import read_htseq_counts, sum_htseq_counts
from libworkflows import read_feature_counts, sum_feature_counts
from libworkflows import read_feature_counts, sum_feature_counts
from smincludes import rules as irules
from smincludes import rules as irules
alignment_settings = {"bowtie2": ""},
#TRIMMERS = ["cutadapt", "fastx_clipper"]
#TRIMMERS = ["cutadapt", "fastx_clipper"]
TRIMMERS = ["cutadapt"]
TRIMMERS = ["cutadapt"]
COUNTERS = ["feature_count"]
COUNTERS = ["feature_count"]
...
@@ -312,6 +314,7 @@ rule map_on_genome:
...
@@ -312,6 +314,7 @@ rule map_on_genome:
sam = temp(OPJ(output_dir, "{trimmer}", aligner, "mapped_C_elegans", "{lib}_{rep}_{type}_on_C_elegans.sam")),
sam = temp(OPJ(output_dir, "{trimmer}", aligner, "mapped_C_elegans", "{lib}_{rep}_{type}_on_C_elegans.sam")),
nomap_fastq = OPJ(output_dir, "{trimmer}", aligner, "not_mapped_C_elegans", "{lib}_{rep}_{type}_unmapped_on_C_elegans.fastq.gz"),
nomap_fastq = OPJ(output_dir, "{trimmer}", aligner, "not_mapped_C_elegans", "{lib}_{rep}_{type}_unmapped_on_C_elegans.fastq.gz"),
params:
params:
aligner = aligner,
index = index,
index = index,
settings = "",
settings = "",
message:
message:
...
...
This diff is collapsed.
Click to expand it.
small_RNA-seq/small_RNA-seq.snakefile
+
3
−
1
View file @
eeec5bf1
...
@@ -129,6 +129,7 @@ from libworkflows import filter_combinator, sum_feature_counts, sum_htseq_counts
...
@@ -129,6 +129,7 @@ from libworkflows import filter_combinator, sum_feature_counts, sum_htseq_counts
from smincludes import rules as irules
from smincludes import rules as irules
strip = str.strip
strip = str.strip
alignment_settings = {"bowtie2": "-L 6 -i S,1,0.8 -N 0"},
# Positions in small RNA sequences for which to analyse nucleotide distribution
# Positions in small RNA sequences for which to analyse nucleotide distribution
#POSITIONS = ["first", "last"]
#POSITIONS = ["first", "last"]
...
@@ -733,8 +734,9 @@ rule map_on_genome:
...
@@ -733,8 +734,9 @@ rule map_on_genome:
sam = temp(OPJ(output_dir, aligner, "mapped_C_elegans", "{lib}_{rep}", "%s_on_C_elegans.sam" % size_selected)),
sam = temp(OPJ(output_dir, aligner, "mapped_C_elegans", "{lib}_{rep}", "%s_on_C_elegans.sam" % size_selected)),
nomap_fastq = OPJ(output_dir, aligner, "not_mapped_C_elegans", "{lib}_{rep}_%s_unmapped_on_C_elegans.fastq.gz" % size_selected),
nomap_fastq = OPJ(output_dir, aligner, "not_mapped_C_elegans", "{lib}_{rep}_%s_unmapped_on_C_elegans.fastq.gz" % size_selected),
params:
params:
aligner = aligner,
index = index,
index = index,
settings =
"-L 6 -i S,1,0.8 -N 0"
,
settings =
alignment_settings[aligner]
,
message:
message:
"Mapping {wildcards.lib}_{wildcards.rep}_%s on C. elegans genome." % size_selected
"Mapping {wildcards.lib}_{wildcards.rep}_%s on C. elegans genome." % size_selected
benchmark:
benchmark:
...
...
This diff is collapsed.
Click to expand it.
snakemake_wrappers/map_on_genome/wrapper.py
+
25
−
7
View file @
eeec5bf1
from
snakemake.shell
import
shell
from
snakemake.shell
import
shell
cmd
=
"""
def
mapping_command
(
aligner
):
genome_dir=
"
${{HOME}}/Genomes
"
"""
This function returns the shell commands to run given the *aligner*.
"""
genome=
"
C_elegans
"
if
aligner
==
"
hisat2
"
:
cmd=
"
bowtie2 --seed 123 -t {snakemake.params.settings} --mm -x {snakemake.params.index} -U {snakemake.input.fastq} --no-unal --un-gz {snakemake.output.nomap_fastq} -S {snakemake.output.sam}
"
shell_commands
=
"""
echo ${{cmd}} > {snakemake.log.log}
cmd=
"
hisat2 -p {snakemake.threads} --dta --seed 123 -t {snakemake.params.settings} --mm -x {snakemake.params.index} -U {snakemake.input.fastq} --no-unal --un-gz {snakemake.output.nomap_fastq} -S {snakemake.output.sam}
"
eval ${{cmd}} 1>> {snakemake.log.log} 2> {snakemake.log.err}
echo ${{cmd}} 1> {log.log}
eval ${{cmd}} 1>> {log.log} 2> {log.err}
"""
"""
elif
aligner
==
"
bowtie2
"
:
shell_commands
=
"""
cmd=
"
bowtie2 -p {snakemake.threads} --seed 123 -t {snakemake.params.settings} --mm -x {snakemake.params.index} -U {snakemake.input.fastq} --no-unal --un-gz {snakemake.output.nomap_fastq} -S {snakemake.output.sam}
"
echo ${{cmd}} > {snakemake.log.log}
eval ${{cmd}} 1>> {snakemake.log.log} 2> {snakemake.log.err}
"""
elif
aligner
==
"
crac
"
:
shell_commands
=
"""
cmd=
"
crac --nb-threads {snakemake.threads} --summary %s --all %s {snakemake.params.settings} -i {snakemake.params.index} -r {snakemake.input.fastq} --sam {snakemake.output.sam}
"
echo ${{cmd}} > {snakemake.log.log}
eval ${{cmd}} 1>> {snakemake.log.log} 2> {snakemake.log.err}
# TODO: extract non mappers from the sam output
> {snakemake.output.nomap_fastq}
"""
%
(
snakemake
.
output
.
nomap_fastq
.
split
(
"
_unmapped
"
)[
0
]
+
"
_summary.txt
"
,
snakemake
.
output
.
nomap_fastq
.
split
(
"
_unmapped
"
)[
0
]
+
"
_output.txt
"
)
else
:
raise
NotImplementedError
(
"
%s is not yet handled.
"
%
aligner
)
return
shell_commands
shell
(
cmd
)
shell
(
mapping_command
(
snakemake
.
params
.
aligner
)
)
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