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
a6974060
"session_1/git@gitbio.ens-lyon.fr:can/R_basis.git" did not exist on "0ac6c8143045814eb0edeade769547f3e110ed32"
Commit
a6974060
authored
4 years ago
by
elabaron
Browse files
Options
Downloads
Patches
Plain Diff
RNAseq.nf : fix beug on normalized coverage
parent
aa52ea7e
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.config
+16
-4
16 additions, 4 deletions
src/RNAseq.config
src/RNAseq.nf
+98
-45
98 additions, 45 deletions
src/RNAseq.nf
with
114 additions
and
49 deletions
src/RNAseq.config
+
16
−
4
View file @
a6974060
...
...
@@ -203,7 +203,7 @@ profiles {
container
=
"lbmc/fastqc:0.11.5"
cpus
=
4
}
withName
:
adaptor_removal
{
withName
:
trimming
{
container
=
"lbmc/cutadapt:2.1"
cpus
=
4
}
...
...
@@ -235,7 +235,7 @@ profiles {
container
=
"gcr.io/broad-cga-aarong-gtex/rnaseqc:latest"
cpus
=
1
}
withName
:
hisat2_post
G
enom
ic
{
withName
:
hisat2_post
g
enom
e
{
cpus
=
4
container
=
"lbmc/hisat2:2.1.0"
}
...
...
@@ -251,9 +251,21 @@ profiles {
container
=
"lbmc/multiqc:1.7"
cpus
=
1
}
withName
:
calc_scalingFactor
{
container
=
"lbmc/hisat2:2.1.0"
cpus
=
1
}
withName
:
coverage
{
container
=
"lbmc/deeptools:3.0.2"
cpus
=
8
container
=
"lbmc/deeptools:3.0.2"
cpus
=
8
}
withName
:
calc_scalingFactor_with_postgenome
{
container
=
"lbmc/hisat2:2.1.0"
cpus
=
1
}
withName
:
coverage_with_postgenome
{
container
=
"lbmc/deeptools:3.0.2"
cpus
=
16
}
}
}
...
...
This diff is collapsed.
Click to expand it.
src/RNAseq.nf
+
98
−
45
View file @
a6974060
...
...
@@ -462,7 +462,7 @@ rnaseqc ${gtf} ${bam[0]} -s ${file_id} ./ \
/* HISAT2 POST_GENOMIC */
/////////////////////////
process
hisat2_post
G
enom
ic
{
process
hisat2_post
g
enom
e
{
tag
"$file_id"
publishDir
"${params.output}/05_post_genome_hisat2/"
,
mode:
'copy'
...
...
@@ -569,52 +569,105 @@ process fastqc_postgenome {
/* Coverage */
//////////////
process
coverage_postgenome
{
tag
"$file_id"
publishDir
"${params.output}/07_coverage/"
,
mode:
'copy'
input:
set
file_id
,
file
(
bam
)
from
HISAT_ALIGNED_COV
set
file_id_2
,
file
(
post_genome
)
from
POSTGENOME_ALIGNED_COV
output:
file
"*.bigwig"
into
COVERAGE_OUTPUT
when:
params
.
do_postgenome
shell:
'''
genome=$(samtools view !{bam[0]} | awk '{print $1}' | sort | uniq | wc -l)
postgenome=$(samtools view !{post_genome[0]} | awk '{print $1}' | sort | uniq | wc -l)
total=$(($genome + $postgenome))
factor=$(awk -v c=$total 'BEGIN {print 1000000/c}')
bamCoverage -p !{task.cpus} --binSize 1 -b !{bam[0]} -o !{file_id}_genome.bigwig
bamCoverage -p !{task.cpus} --binSize 1 -b !{post_genome[0]} -o !{file_id}_postgenome.bigwig
'''
}
process
coverage
{
tag
"$file_id"
publishDir
"${params.output}/07_coverage/"
,
mode:
'copy'
input:
set
file_id
,
file
(
bam
)
from
HISAT_ALIGNED_COV_2
output:
file
"*.bigwig"
into
COVERAGE_OUTPUT_2
when:
params
.
do_postgenome
==
false
shell:
'''
genome=$(samtools view !{bam[0]} | awk '{print $1} | sort | uniq | wc -l)
factor=$(awk -v c=$genome 'BEGIN {print 1000000/c}')
bamCoverage -p !{task.cpus} --binSize 1 -b !{bam[0]} -o !{file_id}.bigwig
'''
if
(
params
.
do_postgenome
){
HISAT_ALIGNED_COV
.
join
(
POSTGENOME_ALIGNED_COV
)
.
into
{
COVERAGE_MERGED_VALUES
;
COVERAGE_MERGED_BAM
}
process
calc_scalingFactor_with_postgenome
{
tag
"$file_id"
input:
set
file_id
,
file
(
genome
),
file
(
post_genome
)
from
COVERAGE_MERGED_VALUES
output:
set
file_id
,
env
(
genome
),
env
(
postgenome
),
env
(
factor
)
into
COVERAGE_MERGED_FACTOR
shell:
'''
genome=$(samtools view !{genome[0]} | awk '{print $1}' | sort | uniq | wc -l)
postgenome=$(samtools view !{post_genome[0]} | awk '{print $1}' | sort | uniq | wc -l)
total=$(($genome + $postgenome))
factor=$(awk -v c=$total 'BEGIN {print 1000000/c}')
'''
}
COVERAGE_MERGED_FACTOR
.
join
(
COVERAGE_MERGED_BAM
)
.
set
{
COVERAGE_MERGED_BIGWIG
}
process
coverage_with_postgenome
{
tag
"$file_id"
publishDir
"${params.output}/07_coverage/"
,
mode:
'copy'
input:
set
file_id
,
val
(
genome
),
val
(
postgenome
),
val
(
factor
),
file
(
genome_bam
),
file
(
post_genome_bam
)
from
COVERAGE_MERGED_BIGWIG
output:
file
"*.bigwig"
into
COVERAGE_OUTPUT
file
"*.txt"
into
COVERAGE_LOG
shell:
'''
total=$((!{genome} + !{postgenome}))
echo "genome aligment : !{genome} counts" >> !{file_id}.txt
echo "postgenome aligment : !{postgenome} counts" >> !{file_id}.txt
echo "total counts : $total" >> !{file_id}.txt
echo "scaling factor : !{factor}" >> !{file_id}.txt
if [ !{genome} -gt 0 ]
then
bamCoverage -p !{task.cpus} --binSize 1 --scaleFactor !{factor} -b !{genome_bam[0]} -o !{file_id}_genome.bigwig
fi
if [ !{postgenome} -gt 0 ]
then
bamCoverage -p !{task.cpus} --binSize 1 --scaleFactor !{factor} -b !{post_genome_bam[0]} -o !{file_id}_postgenome.bigwig
fi
'''
}
}
else
{
HISAT_ALIGNED_COV
.
into
{
COVERAGE_MERGED_VALUES
;
COVERAGE_MERGED_BAM
}
process
calc_scalingFactor
{
tag
"$file_id"
input:
set
file_id
,
file
(
genome
)
from
COVERAGE_MERGED_VALUES
output:
set
file_id
,
env
(
genome
),
env
(
factor
)
into
COVERAGE_MERGED_FACTOR
shell:
'''
genome=$(samtools view !{genome[0]} | awk '{print $1}' | sort | uniq | wc -l)
factor=$(awk -v c=$genome 'BEGIN {print 1000000/c}')
'''
}
COVERAGE_MERGED_FACTOR
.
join
(
COVERAGE_MERGED_BAM
)
.
set
{
COVERAGE_MERGED_BIGWIG
}
process
coverage
{
tag
"$file_id"
publishDir
"${params.output}/07_coverage/"
,
mode:
'copy'
input:
set
file_id
,
val
(
genome
),
val
(
factor
),
file
(
genome_bam
)
from
COVERAGE_MERGED_BIGWIG
output:
file
"*.bigwig"
into
COVERAGE_OUTPUT
file
"*.txt"
into
COVERAGE_LOG
shell:
'''
echo "genome aligment : !{genome} counts" >> !{file_id}.txt
echo "scaling factor : !{factor}" >> !{file_id}.txt
if [ !{genome} -gt 0 ]
then
bamCoverage -p !{task.cpus} --binSize 1 --scaleFactor !{factor} -b !{genome_bam[0]} -o !{file_id}_genome.bigwig
fi
'''
}
}
/////////////
/* MultiQC */
/////////////
...
...
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