# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# makeTagDirectory genome hg19 -update -checkGC

import os
os.chdir('../')
print(os.getcwd())
import pandas as pd
import numpy as np

import matplotlib.pyplot as plt
import matplotlib.lines as mlines
from matplotlib.colors import ListedColormap
from matplotlib import cm


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()


# +
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)
# -



StarcoderdataJupyterScriptsDedupFiltered