<jupyter_start><jupyter_text>Data science in Python- Course GitHub repo: https://github.com/pycam/python-data-science- Python website: https://www.python.org/  Session 2.3 live: Biological data with BioPython**REMIND** participants to use red/pink post-it if they are lost during the live coding session to get help for the other trainer.<jupyter_code>import pandas 
mouse = pandas.read_csv('data/GRCm38.gff3', sep = '\t')
print(mouse.columns)
mouse[mouse['type']=='exon']
mouse.head()
mouse.info()
mouse.isna().sum()
mouse.dropna(inplace = True)
mouse.isna().sum()
mouse.info()
exon_mouse = mouse[mouse['type']=='exon']
exon_mouse
exon_mouse['gbid'].iloc[0]
from Bio import Entrez
from Bio import SeqIO
from Bio.SeqUtils import GC, molecular_weight

Entrez.email = '<EMAIL>'
handle = Entrez.efetch(db = 'nucleotide', id = exon_mouse["gbid"].iloc[0], rettype = 'gb')
seq_record = SeqIO.read(handle, 'gb')
print(molecular_weight(seq_record.seq))
handle.close()
exon_mouse10 = exon_mouse.iloc[0:10,:]
exon_mouse10.reset_index(drop=True, inplace=True)
mws = []
for gbid in exon_mouse10["gbid"]:
    handle = Entrez.efetch(db = 'nucleotide', id = gbid, rettype = 'gb')
    seq_record = SeqIO.read(handle, 'gb')
    mws.append(molecular_weight(seq_record.seq))
    handle.close()

exon_mouse10.insert(len(exon_mouse10.columns), 'mw', mws)
exon_mouse10<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15188953488372092, 'fraction_numerical': 0.015988372093023256, 'mean_word_length': 6.061538461538461, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 2, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '393178', 'license': 'Unlicense', 'n_tokens_mistral': 532, 'n_tokens_neox': 496, 'n_words': 109, 'path': '23_live_python_data.ipynb', 'repo_name': 'abotzki/python-data-science', 'size': '1386'}