-
Notifications
You must be signed in to change notification settings - Fork 17
/
ccm
executable file
·43 lines (43 loc) · 2.92 KB
/
ccm
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
#!/usr/bin/env python3
################################################################
# This file part of GALA Gap-free Long-reads Assembler #
# Auther: Mohamed awad #
# Company: Xiangchao Gan lab (MPIPZ) #
# Released under the (MIT) license (see LICENSE file) #
################################################################
import os
import sys
scr='src'
path=os.path.dirname(os.path.abspath(__file__))
absolute=os.path.join(path,scr)
sys.path.insert(0, absolute)
from scaffolding import scaffolding
import argparse
parser = argparse.ArgumentParser(prog="ccm",usage='%(prog)s -h [options] <path/to/mapping_files> <number of drafts>',description='CCM Contig Clustering Module, part of GALA Gap-free Long-reads Assembler')
parser.add_argument("mapping_files",nargs=1,type=str,help='mapping paf file \t [required]')
parser.add_argument("drafts",nargs=1,type=int,help='Number of drafts\t[required]')
parser.add_argument("-b",nargs=1, type=int, default=[5000], metavar='Alignment block length\t [default 5000]',dest="block")
parser.add_argument("-p",nargs=1, type=int, default=[70], metavar='Alignment identity percentage\t [default 70%]',dest="percent")
parser.add_argument("-c",nargs=1, type=int, default=[5000], metavar='Shortest contig length\t [default 5000]',dest="contig")
parser.add_argument("-q",nargs=1, type=int, default=[20], metavar='Mapping quality\t [default 20]',dest="qty")
parser.add_argument("-f",nargs=1, type=str, default=['scaffolds'], metavar='Output files name\t[default scaffolds]',dest="name")
parser.add_argument("-o",nargs=1, type=str, default=[os.getcwd()], metavar='output files path\t[default current directory]',dest="output")
parser.add_argument("--cut1",nargs=1, type=int, default=[50000], metavar='The length of the smallest discordance on contigs of length >= 1000000 \t[default 50000]\n\t\t Be very careful with this parameter',dest="diff_1")
parser.add_argument("--cut2",nargs=1, type=int, default=[25000], metavar='The length of the smallest discordance on contigs of length >= 100000 \t[default 25000]\n\t\t Be very careful with this parameter',dest="diff_2")
parser.add_argument("--cut3",nargs=1, type=int, default=[15000], metavar='The length of the smallest discordance on contigs of length >= 5000 \t[default 15000]\n\t\t Be very careful with this parameter',dest="diff_3")
parser.add_argument('-v','--version', action='version', version='%(prog)s 1.0.0')
args = parser.parse_args()
paf=args.mapping_files[0]
drafts=args.drafts[0]
block=args.block[0]
percent=args.percent[0]
qty=args.qty[0]
output=args.output[0]
name=args.name[0]
contig=args.contig[0]
diff_1=args.diff_1[0]
diff_2=args.diff_2[0]
diff_3=args.diff_3[0]
scaffolding(path=paf,number_of_drafts=drafts,block=block,percentage=percent,shortage_contig=contig,quality=qty,out_file=True,output_name=name,output=output,diff_1=diff_1,diff_2=diff_2,diff_3=diff_3)
if '-v':
parser.parse_args(['-v'])