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

Show cutoffs for H3K4me3 and H3K27ac marks.

parent 905de27d
Branches
Tags
No related merge requests found
H3K27ac_distribution.png

26.8 KiB

H3K4me3_distribution.png

24.5 KiB

#!/usr/bin/env python
# -*- coding: latin-1 -*-
'''Take an TSV file make a plot graph'''
EPILOG = '''
For more details:
%(prog)s --help
'''
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import argparse
import seaborn as sns
def get_args():
parser = argparse.ArgumentParser(
description=__doc__, epilog=EPILOG,
formatter_class=argparse.RawDescriptionHelpFormatter,
)
parser.add_argument('-r', '--rpkm',
help="The file with RPKM values.",
required = True)
parser.add_argument('-c','--color',
help="The hex color to make the graph",
required = True)
parser.add_argument('-f','--factor',
help="Factor that is being analyzed.",
required = True)
parser.add_argument('-l','--limit',
help="The RPKM limit to plot",
type=int,
required = True)
args = parser.parse_args()
return args
def main():
sns.set_style("white")
sns.set_style("ticks")
args = get_args()
rpkm_file = pd.read_csv(args.rpkm, sep='\t')
locations = np.array(rpkm_file['ES_D0'])
locations = np.append(locations, np.array(rpkm_file['ES_D2']))
locations = np.append(locations, np.array(rpkm_file['ES_D5']))
locations = np.append(locations, np.array(rpkm_file['ES_D7']))
locations = np.append(locations, np.array(rpkm_file['ES_D10']))
sns.kdeplot(np.log2(locations[locations !=0 ] + 0.00001),color=args.color)
sns.despine()
plt.axvline(np.log2(args.limit), color='black', linestyle='dashed', linewidth=1)
plt.savefig(args.factor + '_distribution.png')
plt.clf()
if __name__ == '__main__':
main()
......@@ -42,3 +42,9 @@ bedtools intersect -a /Volumes/project/GCRB/Lee_Lab/s163035/Matrix_analysis_PMIT
# Get RPKM
./rpkm.py --peaks universe_enhancer_H3K27ac.bed --experiments h3k27ac_list.csv -f H3K27ac
./rpkm.py --peaks universe_enhancer_H3K27ac.bed --experiments h3k27ac_list.csv -f H3K27ac_all --minimum 0
# Graph cutoffs
./cutoff_analysis.py --rpkm H3K27ac_all_filtered_peaks.tsv --color '#008D14' --factor H3K27ac -l 1
......@@ -35,3 +35,7 @@ rm /project/GCRB/Lee_Lab/s163035/Matrix_analysis_PMIT_25842977/ChIP-seq/universe
# Get RPKM
./rpkm.py --peaks /Volumes/project/GCRB/Lee_Lab/s163035/Matrix_analysis_PMIT_25842977/ChIP-seq/universe_h3k4me3/universe_peaks.merge.bed --experiments h3k4me3_list.csv -f H3K4me3
./rpkm.py --peaks /Volumes/project/GCRB/Lee_Lab/s163035/Matrix_analysis_PMIT_25842977/ChIP-seq/universe_h3k4me3/universe_peaks.merge.bed --experiments h3k4me3_list.csv -f H3K4me3_all --minimum 0
# Graph cutoffs
./cutoff_analysis.py --rpkm H3K4me3_all_filtered_peaks.tsv --color '#FF7C21' --factor H3K4me3 -l 1
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