forked from sbotond/paper-rgasp3-cov
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathsrc_annoparse.py
More file actions
23 lines (18 loc) · 853 Bytes
/
src_annoparse.py
File metadata and controls
23 lines (18 loc) · 853 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
def parse_arguments():
""" Parse arguments """
parser = argparse.ArgumentParser(description='Parse and pickle annotation.')
parser.add_argument('-g', metavar='gtf', type=str, help='Annotation in GFF format.', required=True)
parser.add_argument('-l', metavar='chromlens', type=str, help='Chromosome list file (lengths ignored).', required=True)
parser.add_argument('-p', metavar='pickle_name', type=str, help='Output pickle file.', required=True)
parser.add_argument('-s', action='store_true' ,default=False, help='Toggle stranded mode.')
args = parser.parse_args()
return args
args = parse_arguments()
L = Log()
gff_file = args.g
chroms_file = args.l
pickle_name = args.p
stranded = args.s
parser = Annotation(L)
annot = parser.load(gff_file, chroms_file, stranded)
pickle_dump(annot, pickle_name)