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
e4972452
Commit
e4972452
authored
6 years ago
by
Blaise Li
Browse files
Options
Downloads
Patches
Plain Diff
Trying to fix niceload quoting issues.
parent
af80020a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bam2bigwig.sh
+4
-3
4 additions, 3 deletions
bam2bigwig.sh
small_RNA-seq/small_RNA-seq.snakefile
+31
-24
31 additions, 24 deletions
small_RNA-seq/small_RNA-seq.snakefile
with
35 additions
and
27 deletions
bam2bigwig.sh
+
4
−
3
View file @
e4972452
...
@@ -126,16 +126,17 @@ samtools view -H ${bam} \
...
@@ -126,16 +126,17 @@ samtools view -H ${bam} \
compute_coverage
()
compute_coverage
()
{
{
cmd
=
"niceload --noswap
-q
bedtools genomecov -bg -split
${
orient_filter
}
${
scaling
}
-ibam
${
bam
}
"
cmd
=
"niceload --noswap bedtools genomecov -bg -split
${
orient_filter
}
${
scaling
}
-ibam
${
bam
}
"
eval
${
cmd
}
\
eval
${
cmd
}
\
| mawk
'{ print $1"\t"$2"\t"$3"\tid-"NR"\t"$4; }'
| sort-bed -
\
| mawk
'{ print $1"\t"$2"\t"$3"\tid-"NR"\t"$4; }'
| sort-bed -
\
||
error_exit
"compute_coverage failed"
||
error_exit
"compute_coverage failed"
#|| cleanup && error_exit "compute_coverage failed"
#|| cleanup && error_exit "compute_coverage failed"
}
}
# TODO: find how to run this with niceload (there may be an issue with the quoting)
make_bins
()
make_bins
()
{
{
cmd
=
"
niceload --noswap -q
bedmap --faster --echo --mean --delim
\"\t\"
--skip-unmapped
${
bin_file
}
-"
cmd
=
"bedmap --faster --echo --mean --delim
\"\t\"
--skip-unmapped
${
bin_file
}
-"
eval
${
cmd
}
||
error_exit
"make_bins failed"
eval
${
cmd
}
||
error_exit
"make_bins failed"
#eval ${cmd} || cleanup && error_exit "make_bins failed"
#eval ${cmd} || cleanup && error_exit "make_bins failed"
}
}
...
@@ -145,7 +146,7 @@ compute_coverage | make_bins \
...
@@ -145,7 +146,7 @@ compute_coverage | make_bins \
#> ${bedgraph} || cleanup && error_exit "generating bedgraph failed"
#> ${bedgraph} || cleanup && error_exit "generating bedgraph failed"
echo
"making bigwig"
echo
"making bigwig"
niceload
--noswap
-q
bedGraphToBigWig
${
bedgraph
}
${
genome_file
}
${
bigwig
}
||
error_exit
"bedGraphToBigWig failed"
niceload
--noswap
bedGraphToBigWig
${
bedgraph
}
${
genome_file
}
${
bigwig
}
||
error_exit
"bedGraphToBigWig failed"
#bedGraphToBigWig ${bedgraph} ${genome_file} ${bigwig} || cleanup && error_exit "bedGraphToBigWig failed"
#bedGraphToBigWig ${bedgraph} ${genome_file} ${bigwig} || cleanup && error_exit "bedGraphToBigWig failed"
echo
"removing
${
bedgraph
}
"
echo
"removing
${
bedgraph
}
"
...
...
This diff is collapsed.
Click to expand it.
small_RNA-seq/small_RNA-seq.snakefile
+
31
−
24
View file @
e4972452
...
@@ -1159,7 +1159,7 @@ rule feature_count_reads:
...
@@ -1159,7 +1159,7 @@ rule feature_count_reads:
shell:
shell:
"""
"""
tmpdir=$(TMPDIR=/var/tmp mktemp --tmpdir -d "feature_{wildcards.lib}_{wildcards.rep}_{wildcards.read_type}_{wildcards.mapping_type}_{wildcards.biotype}_{wildcards.orientation}_{wildcards.feature_type}.XXXXXXXXXX")
tmpdir=$(TMPDIR=/var/tmp mktemp --tmpdir -d "feature_{wildcards.lib}_{wildcards.rep}_{wildcards.read_type}_{wildcards.mapping_type}_{wildcards.biotype}_{wildcards.orientation}_{wildcards.feature_type}.XXXXXXXXXX")
cmd="niceload --noswap
-q
featureCounts {params.min_mapq} -a {params.annot} -o {output.counts} -t {wildcards.feature_type} -g "gene_id" -O -s {params.stranded} --fracOverlap 1 --tmpDir ${{tmpdir}} {input}"
cmd="niceload --noswap featureCounts {params.min_mapq} -a {params.annot} -o {output.counts} -t {wildcards.feature_type} -g "gene_id" -O -s {params.stranded} --fracOverlap 1 --tmpDir ${{tmpdir}} {input}"
featureCounts -v 2> {log.log}
featureCounts -v 2> {log.log}
echo ${{cmd}} 1>> {log.log}
echo ${{cmd}} 1>> {log.log}
eval ${{cmd}} 1>> {log.log} 2> {log.err} || error_exit "featureCounts failed"
eval ${{cmd}} 1>> {log.log} 2> {log.err} || error_exit "featureCounts failed"
...
@@ -1458,7 +1458,7 @@ rule small_RNA_seq_annotate:
...
@@ -1458,7 +1458,7 @@ rule small_RNA_seq_annotate:
mem_mb=19150
mem_mb=19150
shell:
shell:
"""
"""
niceload --noswap
-q
small_RNA_seq_annotate.py -p {threads} -b {input.sorted_bam} -g {input.merged_gtf} \\
niceload --noswap small_RNA_seq_annotate.py -p {threads} -b {input.sorted_bam} -g {input.merged_gtf} \\
-r {params.reads_out_dir} -o {params.counts_out_dir} -l {log.mapped_log}
-r {params.reads_out_dir} -o {params.counts_out_dir} -l {log.mapped_log}
"""
"""
...
@@ -1509,7 +1509,7 @@ rule small_RNA_seq_annotate_U:
...
@@ -1509,7 +1509,7 @@ rule small_RNA_seq_annotate_U:
mem_mb=14700
mem_mb=14700
shell:
shell:
"""
"""
niceload --noswap
-q
small_RNA_seq_annotate.py -p {threads} -b {input.sorted_bam} -u -g {input.merged_gtf} \\
niceload --noswap small_RNA_seq_annotate.py -p {threads} -b {input.sorted_bam} -u -g {input.merged_gtf} \\
-r {params.reads_out_dir} -o {params.counts_out_dir} -l {log.mapped_log}
-r {params.reads_out_dir} -o {params.counts_out_dir} -l {log.mapped_log}
"""
"""
...
@@ -2657,7 +2657,7 @@ your deepTools settings and check your input files.
...
@@ -2657,7 +2657,7 @@ your deepTools settings and check your input files.
#"""
#"""
try:
try:
shell("""
shell("""
cmd="niceload --noswap
-q
bamCoverage -b {input.bam} --skipNAs {params.orient_filter} \\
cmd="niceload --noswap bamCoverage -b {input.bam} --skipNAs {params.orient_filter} \\
-of=bigwig -bs 10 -p={threads} \\
-of=bigwig -bs 10 -p={threads} \\
-o {output.bigwig} \\
-o {output.bigwig} \\
1>> {log.log} 2>> {log.err}"
1>> {log.log} 2>> {log.err}"
...
@@ -2722,7 +2722,7 @@ bam2bigwig.sh: bedGraphToBigWig failed
...
@@ -2722,7 +2722,7 @@ bam2bigwig.sh: bedGraphToBigWig failed
"""
"""
try:
try:
shell("""
shell("""
niceload --noswap
-q
bam2bigwig.sh {input.bam} {params.genome_binned} \\
niceload --noswap bam2bigwig.sh {input.bam} {params.genome_binned} \\
{wildcards.lib}_{wildcards.rep} {wildcards.orientation} F \\
{wildcards.lib}_{wildcards.rep} {wildcards.orientation} F \\
%f {output.bigwig_norm} \\
%f {output.bigwig_norm} \\
> {log.log} 2> {log.err} \\
> {log.log} 2> {log.err} \\
...
@@ -3417,22 +3417,25 @@ rule plot_biotype_mean_meta_profile:
...
@@ -3417,22 +3417,25 @@ rule plot_biotype_mean_meta_profile:
shell:
shell:
"""
"""
tmpdir=$(TMPDIR=/var/tmp mktemp --tmpdir -d "plot_meta_profile_meta_scale_{wildcards.meta_scale}_{wildcards.read_type}_by_{wildcards.norm}_{wildcards.orientation}_{wildcards.type_set}_{wildcards.biotype}_{wildcards.min_len}_{wildcards.group_type}_{wildcards.lib_group}.XXXXXXXXXX")
tmpdir=$(TMPDIR=/var/tmp mktemp --tmpdir -d "plot_meta_profile_meta_scale_{wildcards.meta_scale}_{wildcards.read_type}_by_{wildcards.norm}_{wildcards.orientation}_{wildcards.type_set}_{wildcards.biotype}_{wildcards.min_len}_{wildcards.group_type}_{wildcards.lib_group}.XXXXXXXXXX")
niceload --noswap -q computeMatrix scale-regions -S {input.bws} \\
echo "tmpdir=\\"${{tmpdir}}\\"" 1> {log.log}
cmd="computeMatrix scale-regions -S {input.bws} \\
-R {input.bed} \\
-R {input.bed} \\
{params.meta_params} \\
{params.meta_params} \\
-p {threads} \\
-p {threads} \\
-out ${{tmpdir}}/meta_profile.gz \\
-out ${{tmpdir}}/meta_profile.gz"
1> {log.log} \\
echo "${{cmd}}" 1>> {log.log}
niceload --noswap ${{cmd}} \\
1>> {log.log} \\
2> {log.err} \\
2> {log.err} \\
|| error_exit "computeMatrix failed"
|| error_exit "computeMatrix failed"
cmd="plotProfile -m ${{tmpdir}}/meta_profile.gz -out {output} \\
cmd="plotProfile -m ${{tmpdir}}/meta_profile.gz -out {output} \\
-z {wildcards.read_type}_{wildcards.orientation}_on_{wildcards.biotype} \\
-z {wildcards.read_type}_{wildcards.orientation}_on_{wildcards.biotype} \\
-y \\
'
{params.y_label}\\
'
\\
-y \\
"
{params.y_label}\\
"
\\
--samplesLabel {params.labels} \\
--samplesLabel {params.labels} \\
--perGroup \\
--perGroup \\
--labelRotation 90"
--labelRotation 90"
echo ${{cmd}} 1>> {log.log}
\\
echo
"
${{cmd}}
"
1>> {log.log}
niceload --noswap
-q eval
${{cmd}} \\
niceload --noswap ${{cmd}} \\
1>> {log.log} \\
1>> {log.log} \\
2>> {log.err} \\
2>> {log.err} \\
|| error_exit "plotProfile failed"
|| error_exit "plotProfile failed"
...
@@ -3467,21 +3470,24 @@ rule plot_gene_list_mean_meta_profile:
...
@@ -3467,21 +3470,24 @@ rule plot_gene_list_mean_meta_profile:
shell:
shell:
"""
"""
tmpdir=$(TMPDIR=/var/tmp mktemp --tmpdir -d "plot_meta_profile_meta_scale_{wildcards.meta_scale}_{wildcards.read_type}_by_{wildcards.norm}_{wildcards.orientation}_{wildcards.type_set}_{wildcards.id_list}_{wildcards.group_type}_{wildcards.lib_group}.XXXXXXXXXX")
tmpdir=$(TMPDIR=/var/tmp mktemp --tmpdir -d "plot_meta_profile_meta_scale_{wildcards.meta_scale}_{wildcards.read_type}_by_{wildcards.norm}_{wildcards.orientation}_{wildcards.type_set}_{wildcards.id_list}_{wildcards.group_type}_{wildcards.lib_group}.XXXXXXXXXX")
niceload --noswap -q computeMatrix scale-regions -S {input.bws} \\
echo "tmpdir=\\"${{tmpdir}}\\"" 1> {log.log}
cmd="computeMatrix scale-regions -S {input.bws} \\
-R {input.bed} \\
-R {input.bed} \\
{params.meta_params} \\
{params.meta_params} \\
-p 1 \\
-p 1 \\
-out ${{tmpdir}}/meta_profile.gz \\
-out ${{tmpdir}}/meta_profile.gz"
1> {log.log} \\
echo "${{cmd}}" 1>> {log.log}
niceload --noswap ${{cmd}} \\
1>> {log.log} \\
2> {log.err} \\
2> {log.err} \\
|| error_exit "computeMatrix failed"
|| error_exit "computeMatrix failed"
cmd="plotProfile -m ${{tmpdir}}/meta_profile.gz -out {output} \\
cmd="plotProfile -m ${{tmpdir}}/meta_profile.gz -out {output} \\
-z {wildcards.read_type}_{wildcards.orientation}_on_{wildcards.id_list} \\
-z {wildcards.read_type}_{wildcards.orientation}_on_{wildcards.id_list} \\
-y \\
'
{params.y_label}\\
'
\\
-y \\
"
{params.y_label}\\
"
\\
--samplesLabel {params.labels} \\
--samplesLabel {params.labels} \\
--perGroup"
--perGroup"
echo ${{cmd}} 1>> {log.log}
echo
"
${{cmd}}
"
1>> {log.log}
niceload --noswap
-q eval
${{cmd}} \\
niceload --noswap ${{cmd}} \\
1>> {log.log} \\
1>> {log.log} \\
2>> {log.err} \\
2>> {log.err} \\
|| error_exit "plotProfile failed"
|| error_exit "plotProfile failed"
...
@@ -3578,8 +3584,9 @@ rule plot_pi_targets_profile:
...
@@ -3578,8 +3584,9 @@ rule plot_pi_targets_profile:
# We should compute -bs, -b, and -a from PI_MIN
# We should compute -bs, -b, and -a from PI_MIN
shell("""
shell("""
tmpdir=$(TMPDIR=/var/tmp mktemp --tmpdir -d "plot_pi_targets_profile_{wildcards.lib}_{wildcards.rep}_{wildcards.read_type}_by_{wildcards.norm}_{wildcards.orientation}_{wildcards.biotype}.XXXXXXXXXX")
tmpdir=$(TMPDIR=/var/tmp mktemp --tmpdir -d "plot_pi_targets_profile_{wildcards.lib}_{wildcards.rep}_{wildcards.read_type}_by_{wildcards.norm}_{wildcards.orientation}_{wildcards.biotype}.XXXXXXXXXX")
echo "tmpdir=\\"${{tmpdir}}\\"" 1> {log.log}
# 501 and 21 are multiples of 3
# 501 and 21 are multiples of 3
niceload --noswap
-q
computeMatrix scale-regions -S {input.bigwig} \\
niceload --noswap computeMatrix scale-regions -S {input.bigwig} \\
-R {input.bed} \\
-R {input.bed} \\
-bs 3 \\
-bs 3 \\
-b 1002 \\
-b 1002 \\
...
@@ -3587,15 +3594,15 @@ niceload --noswap -q computeMatrix scale-regions -S {input.bigwig} \\
...
@@ -3587,15 +3594,15 @@ niceload --noswap -q computeMatrix scale-regions -S {input.bigwig} \\
-a 1002 \\
-a 1002 \\
-p {threads} \\
-p {threads} \\
-out ${{tmpdir}}/meta_profile.gz \\
-out ${{tmpdir}}/meta_profile.gz \\
1> {log.log} \\
1>
>
{log.log} \\
2> {log.err} \\
2> {log.err} \\
|| error_exit "computeMatrix failed"
|| error_exit "computeMatrix failed"
cmd="plotProfile -m ${{tmpdir}}/meta_profile.gz -out {output.figure} \\
cmd="plotProfile -m ${{tmpdir}}/meta_profile.gz -out {output.figure} \\
-y \\
'
{params.y_label}\\
'
\\
-y \\
"
{params.y_label}\\
"
\\
--startLabel \\
'
\\
'
\\
--startLabel \\
"
\\
"
\\
--endLabel \\
'
\\
'
"
--endLabel \\
"
\\
"
"
echo ${{cmd}} 1>> {log.log}
echo
"
${{cmd}}
"
1>> {log.log}
niceload --noswap
-q eval
${{cmd}} \\
niceload --noswap ${{cmd}} \\
1>> {log.log} \\
1>> {log.log} \\
2>> {log.err} \\
2>> {log.err} \\
|| error_exit "plotProfile failed"
|| error_exit "plotProfile failed"
...
...
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