Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
RMI2 pipelines
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
LBMC
RMI2
RMI2 pipelines
Commits
6fffaaee
Commit
6fffaaee
authored
5 years ago
by
elabaron
Browse files
Options
Downloads
Patches
Plain Diff
add src/norm_coverage and add coverage calcul to RNAseq worflow
parent
e6956614
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
src/RNAseq.nf
+21
-1
21 additions, 1 deletion
src/RNAseq.nf
src/norm_coverage.sh
+34
-0
34 additions, 0 deletions
src/norm_coverage.sh
with
55 additions
and
1 deletion
src/RNAseq.nf
+
21
−
1
View file @
6fffaaee
...
...
@@ -129,6 +129,7 @@ samtools index ${file_id}_sorted.bam
"""
}
sorted_bam_files
.
into
{
sorted_bam_htseq
,
sorted_bam_coverage
}
/* HTseq */
...
...
@@ -136,7 +137,7 @@ process sort_bam {
tag
"$file_id"
input:
set
file_id
,
file
(
bam
)
from
sorted_bam_
files
set
file_id
,
file
(
bam
)
from
sorted_bam_
htseq
output:
set
file_id
,
"*_htseq.bam"
into
sorted_bam_files_2
...
...
@@ -188,3 +189,22 @@ htseq-count ${bam[0]} ${gtf} \
"""
}
process
coverage
{
tag
"$file_id"
publishDir
"${params.output}/05_coverage/"
,
mode:
'copy'
input:
set
file_id
,
file
(
bam
)
from
sorted_bam_coverage
output:
file
"*.bw"
into
coverage_files
script:
"""
bash src/norm_coverage.sh -b ${bam} \
-o {file_id}.bw \
--binSize 1 \
-p ${cpus} 8
"""
}
This diff is collapsed.
Click to expand it.
src/norm_coverage.sh
0 → 100644
+
34
−
0
View file @
6fffaaee
#!/usr/bin/env bash
set
-e
usage
()
{
echo
"Usage:
$0
-b <bamfile.bam> -o <outputName> --binSize <int> -p <CPUs>"
1>&2
;
exit
1
;
}
cpus
=
4
binSize
=
1
while
getopts
"b:o:binSize:p:"
arg
;
do
case
$arg
in
-h
)
echo
"usage"
;;
-b
)
bam
=
$OPTARG
;;
-o
)
output
=
$OPTARG
;;
--binSize
)
binSize
=
$OPTARG
;;
-p
)
cpus
=
$OPTARG
;;
esac
done
hg38
=
$(
samtools view
${
bam
}
|
awk
'{print $1}'
|
sort
|
uniq
|
wc
-l
)
factor
=
$(
echo
"1000000/(
$hg38
)"
| bc
-l
)
echo
"hg38 counts :
$hg38
"
echo
"scaling factor :
$factor
\n
"
bamCoverage
-p
${
cpus
}
--scaleFactor
${
factor
}
--binSize
${
binSize
}
-b
${
bam
}
-o
${
output
}
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