makeTagDirectory genome hg19 -update -checkGC


In [1]:
import os
os.chdir('../')
print(os.getcwd())
import pandas as pd
import numpy as np


/ifs/projects/adam/pipeline_tests/data/test1/test_chiptools.dir

In [2]:
import matplotlib.pyplot as plt
import matplotlib.lines as mlines
from matplotlib.colors import ListedColormap
from matplotlib import cm

In [3]:
def plotNeucleotideFreq(TagDir):
    
    TagFile = "tagFreq.txt"
    File = "homer/Tag.dir/" + TagDir + "/" + TagFile 
    data = pd.read_csv(File, sep="\t")
    x = data.columns[0]
    y = data.columns[1:5]

    data.plot(x,y)
    plt.xlabel("Distance from 5' end of reads")
    plt.ylabel("Nucleotide Freq")
    plt.title("Genomic Nucleotide Frequency relative to read positions")
    plt.show()

In [4]:
names = set()

design = pd.read_table('design.tsv')
samples = design.bamReads.values
for sample in samples:
    #print(sample.strip(".bam"))
    names.add(sample.strip(".bam"))

for (dirpath, dirnames, filenames) in os.walk(os.getcwd()):
    for dirname in dirnames:
        if dirname in names:
            plotNeucleotideFreq(dirname)



In [ ]: