From 4a9acea1b3033eca09d57dd4bc868921d614da8a Mon Sep 17 00:00:00 2001 From: shenwei356 Date: Wed, 24 Jun 2015 22:48:52 +0800 Subject: [PATCH] modify file_formats/bam2gff.py --- file_formats/bam2gff.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/file_formats/bam2gff.py b/file_formats/bam2gff.py index 39f5e2d..dd4237c 100755 --- a/file_formats/bam2gff.py +++ b/file_formats/bam2gff.py @@ -6,9 +6,13 @@ from collections import defaultdict import pysam -parser = argparse.ArgumentParser(description="bam2gff") +parser = argparse.ArgumentParser(description="bam2gff", + epilog="https://github.com/shenwei356/bio_scripts") parser.add_argument('bamfile', type=str, help='bam file') +parser.add_argument('-c', '--cache-size', type=int, default=1000, help='cache size [1000]') +parser.add_argument('-m', '--match-proportion', type=float, default=0.75, + help='minimum match proportion to define properly paired ends [0.75]') parser.add_argument("-v", "--verbose", help='verbosely print information', action="count", default=0) @@ -48,7 +52,7 @@ def pairs2gff(pairs): 'end': read.reference_end, 'ref': samfile.getrname(read.reference_id), 'reverse': read.is_reverse} - if len(pairs) > 1000: + if len(pairs) > args.cache_size: pairs2gff(pairs) samfile.close()