Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
chipseq_analysis
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
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
Astrocyte
Workflows
BICF
chipseq_analysis
Commits
3d73714a
Commit
3d73714a
authored
7 years ago
by
Venkat Malladi
Browse files
Options
Downloads
Patches
Plain Diff
Add in fastqc step.
parent
8ef6e674
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
workflow/main.nf
+33
-3
33 additions, 3 deletions
workflow/main.nf
workflow/scripts/qc_fastq.py
+10
-10
10 additions, 10 deletions
workflow/scripts/qc_fastq.py
with
43 additions
and
13 deletions
workflow/main.nf
+
33
−
3
View file @
3d73714a
...
...
@@ -9,12 +9,11 @@ params.pairedEnd = false
params.designFile = "$baseDir/../test_data/design_ENCSR238SGC_SE.txt"
// Define List of Files
Channel
readsList =
Channel
.fromPath( params.reads )
.flatten()
.map { file -> [ file.getFileName().toString(), file.toString() ].join("\t")}
.collectFile( name: 'fileList.tsv', newLine: true )
.set { readsList }
// Define regular variables
pairedEnd = params.pairedEnd
...
...
@@ -37,7 +36,6 @@ process checkDesignFile {
if (pairedEnd) {
"""
echo $designFile
python $baseDir/scripts/check_design.py -d $designFile -f $readsList -p
"""
}
...
...
@@ -48,3 +46,35 @@ process checkDesignFile {
}
}
// Define channel for raw reads
if (pairedEnd) {
rawReads = designFilePaths
.splitCsv(sep: '\t', header: true)
.map { row -> [ row.sample_id, [row.fastq_read1, row.fastq_read2], row.biosample, row.factor, row.treatment, row.replicate, row.control_id ] }
} else {
rawReads = designFilePaths
.splitCsv(sep: '\t', header: true)
.map { row -> [ row.sample_id, [row.fastq_read1, row.fastq_read1], row.biosample, row.factor, row.treatment, row.replicate, row.control_id ] }
}
process fastQc {
tag "$sampleId-$replicate"
publishDir "$baseDir/output/", mode: 'copy',
saveAs: {filename -> filename.indexOf(".zip") > 0 ? "zips/$filename" : "$filename"}
input:
set sampleId, reads, biosample, factor, treatment, replicate, controlId from rawReads
output:
file '*_fastqc.{zip,html}' into fastqc_results
script:
"""
python $baseDir/scripts/qc_fastq.py -f $reads
"""
}
This diff is collapsed.
Click to expand it.
workflow/scripts/qc_fastq.py
+
10
−
10
View file @
3d73714a
...
...
@@ -17,10 +17,10 @@ For more details:
## SETTINGS
LOGGER
=
logging
.
getLogger
(
__name__
)
LOGGER
.
addHandler
(
logging
.
NullHandler
())
LOGGER
.
propagate
=
False
LOGGER
.
setLevel
(
logging
.
INFO
)
logger
=
logging
.
getLogger
(
__name__
)
logger
.
addHandler
(
logging
.
NullHandler
())
logger
.
propagate
=
False
logger
.
setLevel
(
logging
.
INFO
)
def
get_args
():
...
...
@@ -41,24 +41,24 @@ def get_args():
def
check_tools
():
'''
Checks for required componenets on user system
'''
LOGGER
.
info
(
'
Checking for required libraries and components on this system
'
)
logger
.
info
(
'
Checking for required libraries and components on this system
'
)
fastqc_path
=
shutil
.
which
(
"
fastqc
"
)
if
fastqc_path
:
LOGGER
.
info
(
'
Found fastqc: %s
'
,
fastqc_path
)
logger
.
info
(
'
Found fastqc: %s
'
,
fastqc_path
)
else
:
print
(
"
Please install
'
fastqc
'
before using the tool
"
)
sys
.
exit
(
)
logger
.
error
(
'
Missing fastqc
'
)
raise
Exception
(
'
Missing fastqc
'
)
def
check_qual_fastq
(
fastq
):
'''
Run fastqc on 1 or 2 files.
'''
qc_command
=
"
fastqc -t -f fastq
"
+
"
"
.
join
(
fastq
)
LOGGER
.
info
(
"
Running fastqc with %s
"
,
qc_command
)
logger
.
info
(
"
Running fastqc with %s
"
,
qc_command
)
qual_fastq
=
subprocess
.
Popen
(
qc_command
,
shell
=
True
)
qual_fastq
.
communicate
()
out
,
err
=
qual_fastq
.
communicate
()
def
main
():
...
...
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