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
Branches
Tags
No related merge requests found
......@@ -424,7 +424,7 @@ process motifSearch {
output:
file "*memechip" into motifSearch
file "sorted-*" into filteredPeaks
file "*narrowPeak" into filteredPeaks
script:
......
......@@ -27,6 +27,13 @@ logger.propagate = False
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():
'''Define arguments.'''
......@@ -55,9 +62,11 @@ def run_wrapper(args):
motif_search(*args)
def motif_search(filename, genome, experiment, peak):
'''Run motif serach on peaks.'''
file_basename = os.path.basename(filename)
sorted_fn = 'sorted-%s' % (file_basename)
file_basename = os.path.basename(
utils.strip_extensions(filename, STRIP_EXTENSIONS))
sorted_fn = '%s.%d.narrowPeak' % (file_basename, peak)
out_fa = '%s.fa' % (experiment)
out_motif = '%s_memechip' % (experiment)
......
......@@ -14,7 +14,7 @@ test_output_path = os.path.dirname(os.path.abspath(__file__)) + \
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_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 utils.count_lines(peak_file_ENCSR238SGC) == 600
......@@ -22,6 +22,6 @@ def test_motif_search_singleend():
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_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 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