Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
chipseq_analysis
Manage
Activity
Members
Labels
Plan
Issues
19
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
3
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
BICF
Astrocyte
chipseq_analysis
Merge requests
!20
Resolve "Use SampleIds/ Experiment Id as file names throughtout pipeline"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "Use SampleIds/ Experiment Id as file names throughtout pipeline"
23-rename_output
into
master
Overview
0
Commits
52
Pipelines
1
Changes
31
Merged
Venkat Malladi
requested to merge
23-rename_output
into
master
6 years ago
Overview
0
Commits
52
Pipelines
1
Changes
2
Expand
Closes
#23 (closed)
0
0
Merge request reports
Viewing commit
b1c3fb87
Prev
Next
Show latest version
2 files
+
75
−
1
Expand all files
Preferences
File browser
List view
Tree view
Compare changes
Inline
Side-by-side
Show whitespace changes
Show one file at a time
Search (e.g. *.vue) (Ctrl+P)
b1c3fb87
Add test for sample and experiment id conformance.
· b1c3fb87
Venkat Malladi
authored
6 years ago
workflow/scripts/check_design.py
+
41
−
0
Options
@@ -5,6 +5,7 @@
import
argparse
import
logging
import
pandas
as
pd
import
re
EPILOG
=
'''
For more details:
@@ -72,6 +73,46 @@ def check_design_headers(design, paired):
raise
Exception
(
"
Missing column headers: %s
"
%
list
(
missing_headers
))
def
check_samples
(
design
):
'''
Check if design file has the correct sample name mapping.
'''
logger
.
info
(
"
Running sample check.
"
)
samples
=
design
.
groupby
(
'
sample_id
'
)
\
.
apply
(
list
)
malformated_samples
=
[]
chars
=
set
(
'
-.
'
)
for
sample
in
samples
.
index
.
values
:
if
(
any
(
char
.
isspace
()
for
char
in
sample
)
|
any
((
char
in
chars
)
for
char
in
sample
)
):
malformated_samples
.
append
(
sample
)
if
len
(
malformated_samples
)
>
0
:
logger
.
error
(
'
Malformed samples from design file: %s
'
,
list
(
malformated_samples
))
raise
Exception
(
"
Malformed samples from design file: %s
"
%
list
(
malformated_samples
))
def
check_experiments
(
design
):
'''
Check if design file has the correct experiment name mapping.
'''
logger
.
info
(
"
Running experiment check.
"
)
experiments
=
design
.
groupby
(
'
experiment_id
'
)
\
.
apply
(
list
)
malformated_experiments
=
[]
chars
=
set
(
'
-.
'
)
for
experiment
in
experiments
.
index
.
values
:
if
(
any
(
char
.
isspace
()
for
char
in
experiment
)
|
any
((
char
in
chars
)
for
char
in
experiment
)
):
malformated_experiments
.
append
(
experiment
)
if
len
(
malformated_experiments
)
>
0
:
logger
.
error
(
'
Malformed experiment from design file: %s
'
,
list
(
malformated_experiments
))
raise
Exception
(
"
Malformed experiment from design file: %s
"
%
list
(
malformated_experiments
))
def
check_controls
(
design
):
'''
Check if design file has the correct control mapping.
'''