<jupyter_start><jupyter_text>Covid Escape Data Analysis  Imports<jupyter_code>import pandas as pd
import plotly.express as px<jupyter_output><empty_output><jupyter_text>Reading data<jupyter_code>files = [
  'data/AZ_cocktail_raw_data.txt',
  'data/Ellebedy_invivo_raw_data.txt',
  'data/MAP_paper_antibodies_raw_data.txt',
  'data/REGN_and_LY-CoV016_raw_data.txt',
  'data/human_sera_raw_data.txt',
]

dfs = dict()
for filepath in files:
  dfs[filepath] = pd.read_csv(filepath)<jupyter_output><empty_output><jupyter_text>Stats by file `mut_escape` value stats:<jupyter_code>for df_name, df in dfs.items():
  print(df_name + '\n')
  print(df['mut_escape'].describe())
  print('\n')<jupyter_output><empty_output><jupyter_text>and corresponding histograms:<jupyter_code>for df in dfs.values():
  fig = px.histogram(df, x="mut_escape", nbins=100)
  fig.show()<jupyter_output><empty_output><jupyter_text>Stats by condition Obtaining a list of conditions:<jupyter_code>conditions = []
for df in dfs.values():
  conditions.extend(df.condition.unique())

conditions = list(set(conditions))
conditions = sorted(conditions)

print('Conditions:\n\t{}'.format('\n\t'.join(conditions)))
print()
print('Number of conditions: {}'.format(len(conditions)))<jupyter_output><empty_output><jupyter_text>Splitting all the data by the condition type:<jupyter_code>df_by_condition = dict()

for condition in conditions:
  current_df = pd.DataFrame()
  
  for df in dfs.values():
    current_df = current_df.append(df[df['condition'] == condition], ignore_index=True)
  
  df_by_condition[condition] = current_df<jupyter_output><empty_output><jupyter_text>Plot histogram of `mut_escape` for each condition type:<jupyter_code>for condition, df in df_by_condition.items():
  fig = px.histogram(df, x="mut_escape", nbins=100, title=condition)
  fig.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13616792249730894, 'fraction_numerical': 0.004843918191603875, 'mean_word_length': 7.6465116279069765, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '512214', 'license': 'MIT', 'n_tokens_mistral': 702, 'n_tokens_neox': 684, 'n_words': 112, 'path': 'escape_mutations/covid_escape_data_analysis.ipynb', 'repo_name': 'sberbank-ai-lab/viral-mutation', 'size': '1858'}