-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtmp_scripts_using_pyGen.py
More file actions
executable file
·55 lines (39 loc) · 1.88 KB
/
tmp_scripts_using_pyGen.py
File metadata and controls
executable file
·55 lines (39 loc) · 1.88 KB
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
#! /usr/bin/env python
# IMPORT
#-------------------------------------------------------------------------------
import argparse
import logging as log
# FUNCTIONS
#-------------------------------------------------------------------------------
def snpAnalyse(gtf, vcf, gos, out_prefix, gq_thres):
import SNPs_annotator as snp
log.info("STARTING snps pipeline")
snp.snpPipe(gtf, vcf, gos, out_prefix, gq_thres)
# ARG PARSER
#-------------------------------------------------------------------------------
def parseArgs():
parser = argparse.ArgumentParser(description='Unified Bioinformatician', add_help=False)
parser.add_argument("-v","--verbose", action="store_true")
subparsers = parser.add_subparsers(dest="cmd")
snp_p = subparsers.add_parser("snps")
snp_p.add_argument("-s","--vcf",required=True, help="Path to the vcf file with snps")
snp_p.add_argument("-a","--gtf",required=True, help="Path to the gtf annotation file")
snp_p.add_argument("-g","--gos",required=True, help="Path to the csv file with GO terms annotations (from Ensembl)")
snp_p.add_argument("-o","--out",default="out_snps", help="Path prefix for the output files")
snp_p.add_argument("-q","--gq_thres",default=20, help="The genotype quality threshold value to apply for genotyping")
other_p = subparsers.add_parser("other")
other_p.add_argument("name")
args = parser.parse_args()
return args
# MAIN
#-------------------------------------------------------------------------------
args = parseArgs()
if args.verbose:
log.basicConfig(format="%(levelname)s: %(message)s", level=log.DEBUG)
else:
log.basicConfig(format="%(levelname)s: %(message)s")
# The dictionnary of commands to launch depending on the "cmd"
# specified in the parser
cmds_d = dict(snps = snpAnalyse(args.gtf, args.vcf, args.gos, args.out, args.gq_thres))
# The command launch
cmds_d[args.cmd]