Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
chipathlon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
Holland Computing Center
chipathlon
Commits
bc25810e
Commit
bc25810e
authored
7 years ago
by
aknecht2
Browse files
Options
Downloads
Patches
Plain Diff
Removed duplicate unnecessary _make_call_pairs function.
parent
8e1fceff
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
chipathlon/generators/peak_call_generator.py
+0
-46
0 additions, 46 deletions
chipathlon/generators/peak_call_generator.py
with
0 additions
and
46 deletions
chipathlon/generators/peak_call_generator.py
+
0
−
46
View file @
bc25810e
...
...
@@ -125,52 +125,6 @@ class PeakCallGenerator(ModuleGenerator):
additional_inputs
=
{}
return
(
self
.
get_markers
(
run
),
inputs
,
additional_inputs
)
def
_make_call_pairs
(
self
,
run
,
file_list
):
"""
:param run: The run currently being processed.
:type run: dict
:param file_list: A list of bed files and associated metadata.
:type file_list: list
Construct a list of file tuples where the first file is the treatment
and the second is a control. This function is a little gross,
but makes our lives easier later. We need to randomly pair up control
and treatment samples that are from the same experiment. Each run
has two different experiments so we keep them separate from each other.
If an experiment has the same number of control and treatment samples
we pair them up 1-1. If an experiment has more controls than
treatments, we randomly select from the controls for the treatment
files. If an experiment has less controls than treatments, we use
all controls, then randomly select duplicates to match to the other
treatment files.
"""
experiment_files
=
[]
control_files
=
[]
peak_data
=
{}
for
output_file
in
file_list
:
for
experiment_id
in
run
[
"
experiments
"
]:
if
experiment_id
not
in
peak_data
:
peak_data
[
experiment_id
]
=
{
"
control
"
:
[],
"
experiment
"
:
[]
}
if
output_file
[
"
prefix
"
][:
len
(
experiment_id
)]
==
experiment_id
:
if
output_file
[
"
control_sample_ids
"
]:
peak_data
[
experiment_id
][
"
control
"
].
append
(
output_file
)
else
:
peak_data
[
experiment_id
][
"
experiment
"
].
append
(
output_file
)
for
experiment_id
in
peak_data
:
experiment_files
+=
peak_data
[
experiment_id
][
"
experiment
"
]
if
len
(
peak_data
[
experiment_id
][
"
experiment
"
])
<
len
(
peak_data
[
experiment_id
][
"
control
"
]):
control_files
+=
[
random
.
choice
(
peak_data
[
experiment_id
][
"
control
"
])
for
i
in
range
(
len
(
peak_data
[
experiment_id
][
"
experiment
"
]))]
elif
len
(
peak_data
[
experiment_id
][
"
experiment
"
])
>
len
(
peak_data
[
experiment_id
][
"
control
"
]):
control_files
+=
peak_data
[
experiment_id
][
"
control
"
]
control_files
+=
[
random
.
choice
(
peak_data
[
experiment_id
][
"
control
"
])
for
i
in
range
(
len
(
peak_data
[
experiment_id
][
"
experiment
"
])
-
len
(
peak_data
[
experiment_id
][
"
control
"
]))]
else
:
control_files
+=
peak_data
[
experiment_id
][
"
control
"
]
return
zip
(
experiment_files
,
control_files
)
def
_make_call_pairs
(
self
,
run
,
result_list
):
"""
:param run: The run currently being processed.
...
...
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