Skip to content
Snippets Groups Projects
Commit db7110cb authored by Venkat Malladi's avatar Venkat Malladi
Browse files

Fix names in motif search and adding summits files.

parent e1f7f61b
1 merge request!20Resolve "Use SampleIds/ Experiment Id as file names throughtout pipeline"
...@@ -424,7 +424,7 @@ process motifSearch { ...@@ -424,7 +424,7 @@ process motifSearch {
output: output:
file "*memechip" into motifSearch file "*memechip" into motifSearch
file "sorted-*" into filteredPeaks file "*narrowPeak" into filteredPeaks
script: script:
......
...@@ -27,6 +27,13 @@ logger.propagate = False ...@@ -27,6 +27,13 @@ logger.propagate = False
logger.setLevel(logging.INFO) logger.setLevel(logging.INFO)
# the order of this list is important.
# strip_extensions strips from the right inward, so
# the expected right-most extensions should appear first (like .gz)
# Modified from J. Seth Strattan
STRIP_EXTENSIONS = ['.narrowPeak', '.replicated' ]
def get_args(): def get_args():
'''Define arguments.''' '''Define arguments.'''
...@@ -55,9 +62,11 @@ def run_wrapper(args): ...@@ -55,9 +62,11 @@ def run_wrapper(args):
motif_search(*args) motif_search(*args)
def motif_search(filename, genome, experiment, peak): def motif_search(filename, genome, experiment, peak):
'''Run motif serach on peaks.'''
file_basename = os.path.basename(filename) file_basename = os.path.basename(
sorted_fn = 'sorted-%s' % (file_basename) utils.strip_extensions(filename, STRIP_EXTENSIONS))
sorted_fn = '%s.%d.narrowPeak' % (file_basename, peak)
out_fa = '%s.fa' % (experiment) out_fa = '%s.fa' % (experiment)
out_motif = '%s_memechip' % (experiment) out_motif = '%s_memechip' % (experiment)
......
...@@ -14,7 +14,7 @@ test_output_path = os.path.dirname(os.path.abspath(__file__)) + \ ...@@ -14,7 +14,7 @@ test_output_path = os.path.dirname(os.path.abspath(__file__)) + \
def test_motif_search_singleend(): def test_motif_search_singleend():
assert os.path.exists(os.path.join(test_output_path, 'ENCSR238SGC.fa')) assert os.path.exists(os.path.join(test_output_path, 'ENCSR238SGC.fa'))
assert os.path.exists(os.path.join(test_output_path, 'ENCSR238SGC_memechip', 'index.html')) assert os.path.exists(os.path.join(test_output_path, 'ENCSR238SGC_memechip', 'index.html'))
peak_file_ENCSR238SGC = test_output_path + 'sorted-ENCSR238SGC.replicated.narrowPeak' peak_file_ENCSR238SGC = test_output_path + 'ENCSR238SGC.600.narrowPeak'
assert os.path.exists(peak_file_ENCSR238SGC) assert os.path.exists(peak_file_ENCSR238SGC)
assert utils.count_lines(peak_file_ENCSR238SGC) == 600 assert utils.count_lines(peak_file_ENCSR238SGC) == 600
...@@ -22,6 +22,6 @@ def test_motif_search_singleend(): ...@@ -22,6 +22,6 @@ def test_motif_search_singleend():
def test_motif_search_pairedend(): def test_motif_search_pairedend():
assert os.path.exists(os.path.join(test_output_path, 'ENCSR729LGA.fa')) assert os.path.exists(os.path.join(test_output_path, 'ENCSR729LGA.fa'))
assert os.path.exists(os.path.join(test_output_path, 'ENCSR729LGA_memechip', 'index.html')) assert os.path.exists(os.path.join(test_output_path, 'ENCSR729LGA_memechip', 'index.html'))
peak_file_ENCSR729LGA= test_output_path + 'sorted-ENCSR729LGA.replicated.narrowPeak' peak_file_ENCSR729LGA= test_output_path + 'ENCSR729LGA.600.narrowPeak'
assert os.path.exists(peak_file_ENCSR729LGA) assert os.path.exists(peak_file_ENCSR729LGA)
assert utils.count_lines(peak_file_ENCSR729LGA) == 600 assert utils.count_lines(peak_file_ENCSR729LGA) == 600
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment