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

Making 1kb center histone data.

parent 8435e959
No related merge requests found
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#!/usr/bin/env python
# -*- coding: latin-1 -*-
'''Midpoint extend by 500 on either side of histone enhancers'''
EPILOG = '''
For more details:
%(prog)s --help
'''
import numpy
import pybedtools
import pybedtools.featurefuncs
import argparse
import os
from subprocess import Popen
def get_args():
parser = argparse.ArgumentParser(
description=__doc__, epilog=EPILOG,
formatter_class=argparse.RawDescriptionHelpFormatter,
)
parser.add_argument('-e', '--enhancers',
help="The enhancers",
required = True)
parser.add_argument('-o', '--outfile',
help="The outfile",
required = True)
args = parser.parse_args()
return args
def main():
args = get_args()
# Read in bedtools:
histone_bed = pybedtools.BedTool(args.enhancers)
chromsizes = pybedtools.helpers.chromsizes("hg19")
input_bed_mid = histone_bed.each(pybedtools.featurefuncs.midpoint)
input_extend = input_bed_mid.slop(b=500,g=chromsizes)
input_extend.saveas(args.outfile + '.bed')
if __name__ == '__main__':
main()
......@@ -27,7 +27,7 @@ axis[1].spines['top'].set_visible(False)
axis[0].xaxis.tick_top()
axis[0].tick_params(labeltop='off')
axis[1].xaxis.tick_bottom()
d = .02
d = .015
kwargs = dict(transform=axis[0].transAxes, color='#1E8EC9', clip_on=False)
axis[0].plot((-d,+d),(-d,+d), **kwargs)
axis[0].plot((1-d,1+d),(-d,+d), **kwargs)
......
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