# HG changeset patch # User rnateam # Date 1448888016 18000 # Node ID 570a7de9f151fb125a9e8d06703c4e318781aa84 # Parent 258b6f9e19ab6c466138e5c9976de17a513edec2 read from bam; fix header issue diff -r 258b6f9e19ab -r 570a7de9f151 extract_aln_ends.py --- a/extract_aln_ends.py Fri Nov 27 04:33:02 2015 -0500 +++ b/extract_aln_ends.py Mon Nov 30 07:53:36 2015 -0500 @@ -14,7 +14,7 @@ By default output is written to stdout. Input: -* sam file containing alignments (paired-end sequencing) +* alignments in SAM or BAM format (paired-end sequencing) Output: * bed6 file containing outer coordinates (sorted by read id) @@ -57,8 +57,8 @@ formatter_class=DefaultsRawDescriptionHelpFormatter) # positional arguments parser.add_argument( - "sam", - help="Path to sam file containing alignments.") + "infile", + help="Path to alignments in SAM or BAM format.") # optional arguments parser.add_argument( "-o", "--outfile", @@ -75,7 +75,7 @@ parser.add_argument( '--version', action='version', - version='0.1.0') + version='0.2.0') args = parser.parse_args() @@ -86,7 +86,7 @@ else: logging.basicConfig(format="%(filename)s - %(levelname)s - %(message)s") logging.info("Parsed arguments:") -logging.info(" sam: '{}'".format(args.sam)) +logging.info(" infile: '{}'".format(args.infile)) if args.outfile: logging.info(" outfile: enabled writing to file") logging.info(" outfile: '{}'".format(args.outfile)) @@ -103,7 +103,7 @@ # sort by id logging.debug("calling samtools sort") - pysam.sort(args.sam, "-n", "-o{}".format(fn_sorted), "-T sortprefix") + pysam.sort(args.infile, "-n", "-o{}".format(fn_sorted), "-T sortprefix") # fix mate information # also removes secondary and unmapped reads diff -r 258b6f9e19ab -r 570a7de9f151 extract_aln_ends.xml --- a/extract_aln_ends.xml Fri Nov 27 04:33:02 2015 -0500 +++ b/extract_aln_ends.xml Mon Nov 30 07:53:36 2015 -0500 @@ -14,7 +14,7 @@ > $default]]> - +