-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_mmsplice.py
executable file
·58 lines (42 loc) · 1.71 KB
/
run_mmsplice.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/env python
"""
run_misplice.py is a simple wrapper to start MMsplice from the commandline.
See https://github.com/gagneurlab/MMSplice_MTSplice
"""
epilog="""
2020-06-06 Jonas Ibn-Salem, TRON gGmbH <jonas.ibn-salem@tron-mainz.de>
"""
# Import
import argparse
from mmsplice.vcf_dataloader import SplicingVCFDataloader
from mmsplice import MMSplice, predict_save
from mmsplice.utils import max_varEff
def run_mmsplice(vcf, gtf, fasta, csv):
print("INFO: Executing `run_mmsplice.py` with the following input parameters:")
print("INFO: vcf: " + vcf)
print("INFO: gtf: " + gtf)
print("INFO: fasta: " + fasta)
print("INFO: csv: " + 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)
def commandline():
parser = argparse.ArgumentParser(description=__doc__,
formatter_class=argparse.RawDescriptionHelpFormatter,
epilog=epilog)
parser.add_argument("-i", "--input_file", type=str, required=True, help="Input VCF file with variants.")
parser.add_argument("-o", "--output_file", type=str, required=True, help="Output file in format from MMsplice.")
parser.add_argument("-g", "--genome_seq", type=str, required=True, help="Reference genome sequence in FASTA format.")
parser.add_argument("-gtf", "--gtf_file", type=str, required=True, help="Reference GTF file with transcript annotations.")
return parser.parse_args()
if __name__ == "__main__":
args = commandline()
run_mmsplice(
args.input_file,
args.gtf_file,
args.genome_seq,
args.output_file
)