Function imports


In [12]:
%matplotlib inline
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import rcParams
import seaborn as sns
from sys import argv

Pathways and genes of interest from Kiel and Shu


In [13]:
gene_dict = {
    'Phosphate': ['VF_A1087', 'VF_A1090', 'VF_1611', 'VF_A1057', 'VF_1610', 'VF_1613', 'VF_1612', 'VF_A1089'],
    'Flagellar': ['VF_1851', 'VF_2079', 'VF_1842', 'VF_2317', 'VF_1843', 'VF_1863', 'VF_1841'],
    'LipidPerox': ['VF_1081', 'VF_1082', 'VF_1083', 'VF_A1049', 'VF_A1050'],
    'LuxOperon': ['VF_A0918', 'VF_A0919', 'VF_A0920', 'VF_A0924', 'VF_A0921', 'VF_A0922', 'VF_A0923', 'VF_A0924'],
    'LuxIregulated': ['VF_A0985', 'VF_1161', 'VF_1162', 'VF_1725', 'VF_A0090', 'VF_A0622', 'VF_A1058'],
    'GGDEFdomain': ['VF_A0879', 'VF_A0343', 'VF_A0342', 'VF_A0476'],

#     'TMAOreductase': ['VF_A0188', 'VF_A0189'],
#     'FatCatabolism': ['VF_0533'],
#     'AminoAcid': ['VF_1585', 'VF_1586', 'VF_A0840'],
#     'PTSsugars': ['VF_A0747', 'VF_A1189', 'VF_A0941', 'VF_A0942'],
#     'NonPTSsugars': ['VF_A0799']
    }

Import data


In [14]:
path = 'results_plk_swt_vnt.csv' # argv[8]

In [15]:
df = pd.read_csv(path, index_col=0)

In [16]:
with open("ko_plk_vnt_kiel.txt", "w") as text_file:
    for pathway in gene_dict.keys():
        for gene in gene_dict[pathway]:
            if df['Plk-vs-Vnt_log2fc'][gene] > 0:
                text_file.write('%s #2c6fbb\n' % df['KO_number'][gene]) # medium blue
            else:
                text_file.write('%s #39ad48\n' % df['KO_number'][gene]) # medium green

In [17]:
with open("ko_plk_vnt_padj001.txt", "w") as text_file:
    for row in df.iterrows():
        gene = row[0]
        if df['Plk-vs-Swt_padj'][gene] < 0.001:
            if df['Plk-vs-Vnt_log2fc'][gene] > 0:
                text_file.write('%s #2c6fbb\n' % df['KO_number'][gene]) # medium blue
            else:
                text_file.write('%s #39ad48\n' % df['KO_number'][gene]) # medium green

In [18]:
with open("ko_plk_vnt_padj001_log2fc3.txt", "w") as text_file:
    for row in df.iterrows():
        gene = row[0]
        if (df['Plk-vs-Swt_padj'][gene] < 0.001) & (df['Plk-vs-Swt_log2fc'][gene] > 3):
            if df['Plk-vs-Vnt_log2fc'][gene] > 0:
                text_file.write('%s #2c6fbb\n' % df['KO_number'][gene]) # medium blue
            else:
                text_file.write('%s #39ad48\n' % df['KO_number'][gene]) # medium green

In [ ]: