forked from djhn75/RNAEditor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
annoateVariants.py
29 lines (21 loc) · 966 Bytes
/
annoateVariants.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
#!/usr/bin/python
'''
This script takes several vcf files with editing sites and dertemines editing islands
Created on 24.09.17
@author: david
'''
import argparse, os, sys
from string import split
from VariantSet import VariantSet
from Genome import Genome
parser = argparse.ArgumentParser(description='reanalyze editing islands.')
parser.add_argument("-f", "--files", metavar="N",type=str, nargs="+", help="list of variant files (vcf)", required=True)
parser.add_argument("-g", "--genome", metavar="N",type=str, help="Genome file (GTF", required=True)
parser.add_argument("-o", "--out", metavar = "N", type = str, help = "outputDir", default = "./")
args = parser.parse_args()
genome = Genome(args.genome)
for file in args.files: # loop through all files
samplename=file[file.rfind('/')+1:file.rfind('.vcf')]
variants = VariantSet(file)
variants.annotateVariantDict(genome)
variants.printVariantDict(args.out + samplename +'.annotated.vcf')