<jupyter_start><jupyter_text>Check on metadata entries for duplicates or things that need cleaning<jupyter_code>sra_run_table.Organism.value_counts()
sra_run_table.source_name.value_counts()
sra_run_table['tissue'] = sra_run_table['source_name'].str.split('\\').str[0]
sra_run_table.tissue.value_counts()
sra_run_table.sex.value_counts()
sra_run_table.gender.value_counts()
sra_run_table['sex_cleaned'] = sra_run_table.apply(lambda x: x['gender'] if pd.isnull(x['sex']) else 'female', axis=1)
sra_run_table.sex_cleaned.value_counts()
sra_run_table
def sanitize_name(name):
    stripped = name.strip()
    no_spaces = stripped.replace(' ', '_')
    no_colons = no_spaces.replace(':', '')
    return no_colons

sra_run_table['sanitized_name'] = sra_run_table['Library Name'].map(sanitize_name)
sra_run_table['sanitized_name'].sample(5)
sra_run_table['sanitized_name_with_run'] = sra_run_table['Run'] + "_" + sra_run_table['sanitized_name']
sra_run_table['sanitized_name_with_run'].sample(5)
sra_run_table.to_csv("../metadata/brawand2011_metadata.csv", index=False)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14560439560439561, 'fraction_numerical': 0.007326007326007326, 'mean_word_length': 9.027522935779816, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '225677', 'license': 'MIT', 'n_tokens_mistral': 438, 'n_tokens_neox': 430, 'n_words': 48, 'path': 'notebooks/404_brawand_clean_metadata.ipynb', 'repo_name': 'czbiohub/kh-analysis', 'size': '1092'}