Giter Site home page Giter Site logo

brechtmann / mmsplice Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gagneurlab/mmsplice_mtsplice

0.0 0.0 0.0 48.41 MB

Variant effect predictions on splicing

License: MIT License

Makefile 1.18% Python 33.37% Jupyter Notebook 59.17% Perl 5.76% Dockerfile 0.53%

mmsplice's Introduction

mmsplice

CircleCI pypi

Predict splicing variant effect from VCF

Paper: Cheng et al. https://doi.org/10.1101/438986

MMSplice

Installation


External dependencies:

pip install cyvcf2 cython

Conda installation is recommended:

conda install cyvcf2 cython -y
pip install mmsplice

Run MMSplice Online

You can run mmsplice using the following google colab notebook online:

Preparation


1. Prepare annotation (gtf) file

Standard human gene annotation files in GTF format can be downloaded from ensembl or gencode. MMSplice can work directly with those files, however, some filtering is higly recommended.

  • Filter for protein coding genes.

2. Prepare variant (VCF) file

A correctly formatted VCF file will work with MMSplice, however the following steps will make it less prone to false positives:

  • Quality filtering, as low quality variants lead to unreliable predictions.
  • Avoid presenting multiple variants in one line by splitting them into multiple lines. Example code to do it:
    bcftools norm -m-both -o out.vcf in.vcf.gz
  • Left-normalization. For instance, GGCA-->GG is not left-normalized while GCA-->G is. Details for unified representations of genetic variants can be found in Tan et al.
    bcftools norm -f reference.fasta -o out.vcf in.vcf

3. Prepare reference genome (fasta) file

Human reference fasta files can be downloaded from ensembl/gencode. Make sure the chromosome names matche the ones in the GTF annotation file in use.

Example code


Check notebooks/example.ipynb

To score variants (including indels), we suggest to use primarily the deltaLogitPSI predictions, which is the default output. The differential splicing efficiency (dse) model was trained from MMSplice modules and exonic variants from MaPSy, thus only the predictions for exonic variants are calibrated.

# Import
from mmsplice.vcf_dataloader import SplicingVCFDataloader
from mmsplice import MMSplice, predict_all_table
from mmsplice.utils import max_varEff

# example files
gtf = 'tests/data/test.gtf'
vcf = 'tests/data/test.vcf.gz'
fasta = 'tests/data/hg19.nochr.chr17.fa'
csv = 'pred.csv'

# dataloader to load variants from vcf
dl = SplicingVCFDataloader(gtf, fasta, vcf)

# Specify model
model = MMSplice()

# predict and save to csv file
predict_save(model, dl, csv, pathogenicity=True, splicing_efficiency=True)

# Or predict and return as df
predictions = predict_all_table(model, dl, pathogenicity=True, splicing_efficiency=True)

# Summerize with maximum effect size
predictionsMax = max_varEff(predictions)

Output

Output of MMSplice is an tabular data which contains following described columns:

  • ID: id string of the variant
  • delta_logit_psi: The main score is predicted by MMSplice, which shows the effect of the variant on the inclusion level (PSI percent spliced in) of the exon. The score is on a logit scale. If the score is positive, it shows that variant leads higher inclusion rate for the exon. If the score is negative, it shows that variant leads higher exclusion rate for the exon. If delta_logit_psi is bigger than 2 or smaller than -2, the effect of variant can be considered strong.
  • exons: Genetics location of exon whose inclusion rate is effected by variant
  • exon_id: Genetic id of exon whose inclusion rate is effected by variant
  • gene_id: Genetic id of the gene which the exon belongs to.
  • gene_name: Name of the gene which the exon belongs to.
  • transcript_id: Genetic id of the transcript which the exon belongs to.
  • ref_acceptorIntron: acceptor intron score of the reference sequence
  • ref_acceptor: acceptor score of the reference sequence
  • ref_exon: exon score of the reference sequence
  • ref_donor: donor score of the reference sequence
  • ref_donorIntron: donor intron score of the reference sequence
  • alt_acceptorIntron: acceptor intron score of variant sequence
  • alt_acceptor: acceptor score of the sequence with variant
  • alt_exon: exon score of the sequence with variant
  • alt_donor: donor score of the sequence with variant
  • alt_donorIntron: donor intron score of the sequence with variant
  • pathogenicity: Potential pathogenic effect of the variant.
  • efficiency: The effect of the variant on the splicing efficiency of the exon.

VEP Plugin

The VEP plugin wraps the prediction function from the mmsplice python package. Please check documentation of vep plugin under VEP_plugin/README.md.

mmsplice's People

Contributors

muhammedhasan avatar s6juncheng avatar brechtmann avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.