<jupyter_start><jupyter_text>* Apply to autism variants from zhou et al., 2019 https://hb.flatironinstitute.org/asdbrowser/* The tsv file was converted to vcf format  Prepare data as VCF file<jupyter_code>import mmsplice
mmsplice.__version__
from mtsplice import get_data_dir
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt

from mtsplice.utils.vcf_utils import variant_name_convert

DATA = get_data_dir()<jupyter_output><empty_output><jupyter_text>Apply MMSplice first<jupyter_code>from mmsplice.vcf_dataloader import SplicingVCFDataloader
from mmsplice import MMSplice, predict_all_table
from mmsplice.utils import max_varEff
gtf = '/data/nasif12/home_if12/chengju/project/recods/Data/shared/Homo_sapiens.GRCh37.75.uniq_exon.gtf'
fasta = '/data/nasif12/home_if12/chengju/project/recods/Data/shared/hg19.nochr.fa'
vcf = DATA + "dis_asd.vcf"
dl = SplicingVCFDataloader(gtf, 
                          fasta,
                          vcf,
                          split_seq=True, 
                          overhang=(300, 300))
model = MMSplice()
import warnings
warnings.filterwarnings('ignore')

predictions = predict_all_table(model, dl, batch_size=1024)
predictions.shape
predictionsMax = max_varEff(predictions)
predictionsMax["ID"] = predictionsMax.ID.apply(variant_name_convert)
autism = pd.read_csv(f"{DATA}/dis_asd.tsv.gz", comment='#', sep='\t', index_col=None)
autism['ID'] = autism.Chr.map(str) + '_' + autism.Pos.map(str) + '_' + autism.Ref.map(str) + '_' + autism.Alt.map(str)
pred = pd.merge(predictionsMax, autism, on=['ID'])<jupyter_output><empty_output><jupyter_text>Intesect with Observed over Expected score<jupyter_code>oe = pd.read_csv(f"{DATA}/oe_clean.tsv", sep='\t')
pred_oe = pd.merge(pred, oe, left_on="RNA gene symbol", right_on="gene")
pred_oe['lof_gene'] = pred_oe.oe_lof_upper < 0.35
pred_oe.to_csv(DATA + "MMSplice_pred_oe.csv", index=None)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12097611630321911, 'fraction_numerical': 0.016095534787123573, 'mean_word_length': 4.911042944785276, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 13, 'https://': 1, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '565071', 'license': 'MIT', 'n_tokens_mistral': 765, 'n_tokens_neox': 726, 'n_words': 124, 'path': 'notebooks/Autism/autism-MMSplice.ipynb', 'repo_name': 'gagneurlab/mtsplice', 'size': '1926'}