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

Merge branch '23-rename_output' into 24-astrocyte

parents 8e9990bd 4aa91a5c
Branches
Tags
1 merge request!25Resolve "Test Astrocyte"
......@@ -125,11 +125,12 @@ def call_peaks_macs(experiment, xcor, control, prefix, genome_size, chrom_sizes)
# MACS2 sometimes calls features off the end of chromosomes.
# Remove coordinates outside chromosome sizes
narrowpeak_fn = '%s.narrowPeak' % (prefix)
int_narrowpeak_fn = '%s_peaks.narrowPeak' % (prefix)
narrowpeak_fn = '%s_peaks.narrowPeak' % (prefix)
clipped_narrowpeak_fn = 'clipped-%s' % (narrowpeak_fn)
steps = ['slopBed -i %s -g %s -b 0' % (narrowpeak_fn, chrom_sizes),
steps = ['slopBed -i %s -g %s -b 0' % (int_narrowpeak_fn, chrom_sizes),
'bedClip stdin %s %s' % (chrom_sizes, clipped_narrowpeak_fn)]
out, err = utils.run_pipe(steps)
......
......@@ -174,7 +174,7 @@ def main():
# Run enrichment
new_design_df = update_controls(design_df)
for row in new_design_df.iterrows():
for index, row in new_design_df.iterrows():
check_enrichment(
row['sample_id'],
row['control_id'],
......
......@@ -153,7 +153,7 @@ def dedup_mapped(bam, bam_basename, paired):
'''Use sambamba and samtools to remove duplicates.'''
# Markduplicates
dup_file_qc_filename = bam_basename + ".dup.qc"
dup_file_qc_filename = bam_basename + ".dedup.qc"
tmp_dup_mark_filename = bam_basename + ".dupmark.bam"
sambamba_params = "--hash-table-size=17592186044416" + \
" --overflow-list-size=20000000 --io-buffer-size=256"
......
......@@ -84,13 +84,18 @@ def motif_search(filename, genome, experiment, peak):
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)
# Sort Bed file and limit number of peaks
if peak == -1:
peak = utils.count_lines(filename)
peak_no = 'all'
else:
peak_no = peak
sorted_fn = '%s.%s.narrowPeak' % (file_basename, peak)
out, err = utils.run_pipe([
'sort -k %dgr,%dgr %s' % (5, 5, filename),
......
......@@ -25,7 +25,7 @@ logger.setLevel(logging.INFO)
# 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 = ['.gz', '.tagAlign', '.bedse', 'bedpe']
STRIP_EXTENSIONS = ['.gz', '.tagAlign', '.bedse', '.bedpe']
def get_args():
......@@ -93,7 +93,10 @@ def pool(tag_files, outfile, paired):
else:
file_extension = '.bedse.gz'
pooled_filename = outfile + file_extension
pool_basename = os.path.basename(
utils.strip_extensions(outfile, STRIP_EXTENSIONS))
pooled_filename = pool_basename + file_extension
# Merge files
out, err = utils.run_pipe([
......@@ -106,7 +109,7 @@ def pool(tag_files, outfile, paired):
def bedpe_to_tagalign(tag_file, outfile):
'''Convert read pairs to reads into standard tagAlign file.'''
se_tag_filename = outfile + "tagAlign.gz"
se_tag_filename = outfile + ".tagAlign.gz"
# Convert read pairs to reads into standard tagAlign file
tag_steps = ["zcat -f %s" % (tag_file)]
......
......@@ -26,7 +26,7 @@ logger.setLevel(logging.INFO)
# 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 = ['.gz', '.tagAlign', '.bedse', 'bedpe']
STRIP_EXTENSIONS = ['.gz', '.tagAlign', '.bedse', '.bedpe']
def get_args():
......@@ -113,6 +113,8 @@ def xcor(tag, paired):
cc_plot_filename, cc_scores_filename)
])
return cc_scores_filename
def main():
......
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