-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsegmentsGenerator.py
41 lines (30 loc) · 1.62 KB
/
segmentsGenerator.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
import sys
import logging
from argparse import ArgumentParser, RawTextHelpFormatter
from lib.SegGraphCreator import createSegments
description = \
"Description:\n\n" + \
"This subcommand breaks the preprocessed transcriptome into a set of maximal L-disjoint" + \
"segments (prepares the segments library)."
parser = ArgumentParser(description=description, formatter_class=RawTextHelpFormatter,
add_help=False)
parser.add_argument("-l", "--max-overlap", help="to create L-disjoint segments (typically equals to read length)",
required=True)
parser.add_argument("-o", "--output-name", help="specify name prefix of output files", required=False)
parser.add_argument("-ioe", "--events-annotation", nargs='*',
help="specify events annotation file(s) (.ioe file(s) generated by SUPPA)", required=False)
parser.add_argument("-m", "--mode", nargs='?', choices=['strict', 'flex'], default='flex',
help="specify mode for mapping segments to events", required=False)
parser.add_argument("-wd", "--work-dir", help="specify directory where the preprocessed annotation files " + \
"exist (same output directory used in the preprocess subcommand)")
def main():
args = parser.parse_args()
# Setting logging preferences
logger = logging.getLogger(__name__)
#print(args)
if not args.output_name:
args.output_name = "segs_"+args.max_overlap
createSegments(int(args.max_overlap), args.work_dir, args.output_name, args.events_annotation, False, args.mode)
logger.info("Done")
if __name__ == '__main__':
main()