Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
RNA-seq
Manage
Activity
Members
Labels
Plan
Issues
12
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
GUDMAP_RBK
RNA-seq
Commits
e32cb502
Commit
e32cb502
authored
5 years ago
by
Gervaise Henry
Browse files
Options
Downloads
Patches
Plain Diff
Parse metadata
parent
710a67d9
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!37
v0.0.1
,
!14
Resolve "process_createManifest"
Pipeline
#5727
failed with stages
in 27 minutes and 57 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
workflow/nextflow.config
+1
-1
1 addition, 1 deletion
workflow/nextflow.config
workflow/rna-seq.nf
+33
-9
33 additions, 9 deletions
workflow/rna-seq.nf
workflow/scripts/parseMeta.py
+38
-2
38 additions, 2 deletions
workflow/scripts/parseMeta.py
with
72 additions
and
12 deletions
workflow/nextflow.config
+
1
−
1
View file @
e32cb502
...
...
@@ -21,7 +21,7 @@ process {
container
=
'bicf/trimgalore:1.1'
}
withName
:
parseMetadata
{
container
=
'bicf/python:1.3'
container
=
'bicf/python
3
:1.3'
}
}
...
...
This diff is collapsed.
Click to expand it.
workflow/rna-seq.nf
+
33
−
9
View file @
e32cb502
...
...
@@ -97,23 +97,49 @@ process getData {
*/
process parseMetadata {
tag "${repRID_parseMetadata}"
publishDir "${logsDir}
/parseMetadata
", mode: '
symlink
', pattern: "${repRID_parseMetadata}.parseMetadata.err"
publishDir "${logsDir}", mode: '
copy
', pattern: "${repRID_parseMetadata}.parseMetadata.err"
input:
val repRID_parseMetadata
file
fileMeta
file
experimentSettingsMeta
file
experimentMeta
path
fileMeta
path
experimentSettingsMeta
path
experimentMeta
output:
val ends
val stranded
val spike
val specie
script:
"""
hostname >>${repRID_parseMetadata}.parseMetadata.err
ulimit -a >>${repRID_parseMetadata}.parseMetadata.err
python ${baseDir}/scripts/parseMeta.py -r ${repRID_parseMetadata} -m ${fileMeta} -p repRID
# Check replicate RID metadata
rep=\$(python ${baseDir}/scripts/parseMeta.py -r ${repRID_parseMetadata} -m "${fileMeta}" -p repRID)
echo "LOG: replicate RID metadata parsed: \${rep}" >>${repRID_parseMetadata}.parseMetadata.err
# Get endedness metadata
ends=\$(python3 ${baseDir}/scripts/parseMeta.py -r ${repRID_parseMetadata} -m "${experimentSettingsMeta}" -p ends)
echo "LOG: endedness metadata parsed: \${ends}" >>${repRID_parseMetadata}.parseMetadata.err
# Get strandedness metadata
stranded=\$(python3 ${baseDir}/scripts/parseMeta.py -r ${repRID_parseMetadata} -m "${experimentSettingsMeta}" -p stranded)
echo "LOG: strandedness metadata parsed: \${stranded}" >>${repRID_parseMetadata}.parseMetadata.err
# Get spike-in metadata
spike=\$(python3 ${baseDir}/scripts/parseMeta.py -r ${repRID_parseMetadata} -m "${experimentSettingsMeta}" -p spike)
echo "LOG: spike-in metadata parsed: \${spike}" >>${repRID_parseMetadata}.parseMetadata.err
# Get species metadata
specie=\$(python3 ${baseDir}/scripts/parseMeta.py -r ${repRID_parseMetadata} -m "${experimentMeta}" -p specie)
echo "LOG: species metadata parsed: \${specie}" >>${repRID_parseMetadata}.parseMetadata.err
"""
}
ends.set {
ends_trimData
}
/*
...
...
@@ -126,10 +152,10 @@ process trimData {
input:
val repRID_trimData
file(fastq) from fastqs
val ends_trimData
output:
path ("*.fq.gz") into fastqs_trimmed
val ends
file ("${repRID_trimData}.trimData.log")
file ("${repRID_trimData}.trimData.err")
...
...
@@ -141,12 +167,10 @@ process trimData {
else
ncore=`nproc`
fi
if [ '${
fastq[1]
}' == '
null
' ]
if [ '${
ends_trimData
}' == '
se
' ]
then
ends='se'
trim_galore --gzip -q 25 --illumina --length 35 --basename ${repRID_trimData} -j \${ncore} ${fastq[0]} 1>>${repRID_trimData}.trimData.log 2>>${repRID_trimData}.trimData.err;
else
ends='pe'
trim_galore --gzip -q 25 --illumina --length 35 --paired --basename ${repRID_trimData} -j \${ncore} ${fastq[0]} ${fastq[1]} 1>>${repRID_trimData}.trimData.log 2>>${repRID_trimData}.trimData.err;
fi
"""
...
...
This diff is collapsed.
Click to expand it.
workflow/scripts/parseMeta.py
+
38
−
2
View file @
e32cb502
...
...
@@ -23,11 +23,47 @@ def main():
print
(
"
Replicate RID in metadata does not match run parameters:
"
+
metaFile
.
Replicate_RID
.
unique
()
+
"
vs
"
+
args
.
repRID
)
exit
(
1
)
else
:
print
(
metaFile
[
"
Replicate_RID
"
].
unique
())
rep
=
metaFile
[
"
Replicate_RID
"
].
unique
()[
0
]
print
(
rep
)
if
(
len
(
metaFile
[
metaFile
[
"
File_Type
"
]
==
"
FastQ
"
])
>
2
):
print
(
"
There are more then 2 fastq
'
s in the metadata:
"
+
"
"
.
join
(
metaFile
[
metaFile
[
"
File_Type
"
]
==
"
FastQ
"
].
RID
))
exit
(
1
)
if
(
args
.
parameter
==
"
ends
"
):
if
(
metaFile
.
Paired_End
.
unique
()
==
"
Single End
"
):
ends
=
"
se
"
elif
(
metaFile
.
Paired_End
.
unique
()
==
"
Paired End
"
):
ends
=
"
pe
"
else
:
print
(
"
Ends metadata not match expected options:
"
+
metaFile
.
Paired_End
.
unique
())
exit
(
1
)
print
(
ends
)
if
(
args
.
parameter
==
"
stranded
"
):
if
(
metaFile
.
Has_Strand_Specific_Information
.
unique
()
==
"
yes
"
):
stranded
=
"
stranded
"
elif
(
metaFile
.
Has_Strand_Specific_Information
.
unique
()
==
"
no
"
):
stranded
=
"
unstranded
"
else
:
print
(
"
Stranded metadata not match expected options:
"
+
metaFile
.
Has_Strand_Specific_Information
.
unique
())
exit
(
1
)
print
(
stranded
)
if
(
args
.
parameter
==
"
spike
"
):
if
(
metaFile
.
Used_Spike_Ins
.
unique
()
==
"
yes
"
):
spike
=
"
yes
"
elif
(
metaFile
.
Used_Spike_Ins
.
unique
()
==
"
no
"
):
spike
=
"
no
"
else
:
print
(
"
Spike-ins metadata not match expected options:
"
+
metaFile
.
Used_Spike_Ins
.
unique
())
exit
(
1
)
print
(
spike
)
if
(
args
.
parameter
==
"
specie
"
):
if
(
metaFile
.
Species
.
unique
()
==
"
Mus musculus
"
):
specie
=
"
Mus musculus
"
elif
(
metaFile
.
Species
.
unique
()
==
"
Homo sapiens
"
):
specie
=
"
Homo sapiens
"
else
:
print
(
"
Species metadata not match expected options:
"
+
metaFile
.
Species
.
unique
())
exit
(
1
)
print
(
specie
)
if
__name__
==
'
__main__
'
:
main
()
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
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