<jupyter_start><jupyter_text>Extracting data about zebrafish disease models from ZFINPotentially interesting targets for UniProt annotation.<NAME>. August 2018.<jupyter_code>import pandas as pd<jupyter_output><empty_output><jupyter_text>The fish_model_disease.txt file provides [Disease Ontology](https://disease-ontology.org/) cross references and associated PubMed ids.<jupyter_code>zfin_models = pd.read_csv('https://zfin.org/downloads/fish_model_disease.txt',
                          sep='\t',
                          header=None,
                          dtype=str,
                          names=['zfin_fish_id', 'zfin_env_id', 'is_a_model', 'do_id', 'do_name', 'zfin_pub', 'pmid',
                                 'evidence_code'])
zfin_models.head()
zfin_models.info()<jupyter_output><class 'pandas.core.frame.DataFrame'>
RangeIndex: 3056 entries, 0 to 3055
Data columns (total 8 columns):
 #   Column         Non-Null Count  Dtype 
---  ------         --------------  ----- 
 0   zfin_fish_id   1595 non-null   object
 1   zfin_env_id    1595 non-null   object
 2   is_a_model     1595 non-null   object
 3   do_id          3056 non-null   object
 4   do_name        3056 non-null   object
 5   zfin_pub       3056 non-null   object
 6   pmid           3054 non-null   object
 7   evidence_code  3056 non-null   object
dtypes: object(8)
memory usage: 191.1+ KB<jupyter_text>The zfin_pubs.txt file contains complete information about the papers curated in the database including title and journal citation.<jupyter_code>zfin_bib = pd.read_csv('https://zfin.org/downloads/zfinpubs.txt', sep='\t', header=None,
                       names=['zfin_pub', 'pmid', 'authors', 'title', 'journal', 'year', 'vol', 'pages'],
                       dtype=str)
zfin_bib.head()
zfin_bib[['pmid', 'title']].head()<jupyter_output><empty_output><jupyter_text>In the disease models table, we are mainly interested in the DO name and identifier, and the PubMed id.<jupyter_code>zfin_models[['zfin_fish_id', 'do_id', 'do_name', 'pmid']].head()<jupyter_output><empty_output><jupyter_text>Merge the bibliography with relevant columns from the disease models dataframe.<jupyter_code>zf = zfin_models[['zfin_fish_id', 'do_id', 'do_name', 'pmid']].merge(zfin_bib[['zfin_pub', 'pmid', 'title']], on='pmid')
zf.head()<jupyter_output><empty_output><jupyter_text>To map gene symbols to the disease models, we need the gene_publication.txt mapping table.<jupyter_code>zfin_gene_pub = pd.read_csv('https://zfin.org/downloads/gene_publication.txt',
                            sep='\t',
                            dtype=str,
                            header=None,
                            names=['gene', 'gene_id', 'zfin_pub', 'pub_type', 'pmid'])
zfin_gene_pub.head()<jupyter_output><empty_output><jupyter_text>Merge the gene mapping table with the previously generated dataframe.<jupyter_code>zfin_disease = zf.merge(zfin_gene_pub[['gene', 'zfin_pub']], on='zfin_pub')
zfin_disease.info()
zfin_disease.head()
zfin_disease.gene.nunique()
zfin_disease.groupby('title').count()
zfin_disease[zfin_disease['title'] == 'Zebrafish deficient for Muscleblind-like 2 exhibit features of myotonic dystrophy']<jupyter_output><empty_output><jupyter_text>Export data to tsv file.<jupyter_code>zfin_disease.to_csv('zebrafish_disease_models.tsv', sep='\t')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1258554001785183, 'fraction_numerical': 0.017851829812555786, 'mean_word_length': 3.512751677852349, 'pattern_counts': {'":': 0, '<': 34, '<?xml version=': 0, '>': 34, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '8', 'dir': 'jupyter-structured-clean-dedup', 'id': '36634', 'license': 'MIT', 'n_tokens_mistral': 1206, 'n_tokens_neox': 1120, 'n_words': 231, 'path': 'zebrafish_disease_models.ipynb', 'repo_name': 'ehatton/zebrafish_disease_models', 'size': '3372'}