I regularly use "NGS: SAM Tools/Filter SAM" tool. Filtering after
mapping with BWA is a required step. I feel my current approach to
reintroduce the header after filtering is very wasteful. Wouldn't be
great if this tool had an option to keep the header? This sounds
simple enough. In fact looking at the logic in the python script:
    for line in infile:
        line = line.rstrip( '\r\n' )
        if line and not line.startswith( '#' ) and not line.startswith( '@' ) :
            fields = line.split( '\t' )
            flags = int( fields[flag_col] )

            valid_line = True
            for index, opt_bool in used_indices:
                if bool(flags & 0x0001 << index) != opt_bool:
                    valid_line = False

            if valid_line:
                print line

It seems like it could be done by adding at most a couple of lines.

Also, most of the time after filtering what you really want is a
sorted BAM file. Most tools dealing with SAM/BAM files in Galaxy
already have the option to output a sorted BAM file. I think it would
be nice if "Filter SAM" followed the same path.

Are these enhances in the radar? Would you take a pull request
implementing them?

Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:


Reply via email to