<jupyter_start><jupyter_text>Function imports<jupyter_code>%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<jupyter_output><empty_output><jupyter_text>Pathways and genes of interest from Kiel and Shu<jupyter_code>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']
    }<jupyter_output><empty_output><jupyter_text>Import data<jupyter_code>path = 'results_plk_swt_vnt.csv' # argv[8]
df = pd.read_csv(path, index_col=0)<jupyter_output><empty_output><jupyter_text>Print KO and "blue" (up in plk rel to vnt) or "green" (down in plk rel to vnt) to copy to http://www.genome.jp/kegg/tool/map_pathway2.html (search against ko or vfi)<jupyter_code>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
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
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<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1777217015140591, 'fraction_numerical': 0.08904109589041095, 'mean_word_length': 3.991007194244604, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '571148', 'license': 'MIT', 'n_tokens_mistral': 1330, 'n_tokens_neox': 1185, 'n_words': 213, 'path': 'vibrio-fischeri-transcriptomics/code/ipynb/vibrio_pathways.ipynb', 'repo_name': 'cuttlefishh/papers', 'size': '2774'}