# HG changeset patch # User lomereiter # Date 1344838389 14400 # Node ID 668e187566d5bf20e085ba1be1a77b9682be22f2 uploaded xml wrapper diff -r 000000000000 -r 668e187566d5 sambamba_filter.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sambamba_filter.xml Mon Aug 13 02:13:09 2012 -0400 @@ -0,0 +1,90 @@ + + + sambamba + + + on flags, fields, and tags + + + #if $query != None: + #set $query = $query.replace('__sq__', '\'') + #set $query = $query.replace('__ob__', '[') + #set $query = $query.replace('__cb__', ']') + #set $query = $query.replace('__dq__', '"') + #set $query = $query.replace('__oc__', '{') + #set $query = $query.replace('__cc__', '}') + #set $query = $query.replace('__gt__', chr(62)) + #set $query = $query.replace('__lt__', chr(60)) + #end if + #if $outputformat.format == 'bam': + #set $header = '' + #else + #set $header = $outputformat.header + #end if + #if isinstance($input.datatype, $__app__.datatypes_registry.get_datatype_by_extension('bam').__class__): + #set $input1 = 'input.bam' + ln -s $input $input1 && + ln -s $input.metadata.bam_index input.bai && + sambamba view --filter="$query" -f $outputformat.format -o $outfile $input1 $header $region + #else + sambamba view -S --filter="$query" -f $outputformat.format -o $outfile $input $header + #end if + + + + + + +The syntax is described at sambamba wiki: https://github.com/lomereiter/sambamba/wiki/%5Bsambamba-view%5D-Filter-expression-syntax + + + + + + + + + + + + + + + + + + + + + The syntax is the same as in samtools, start and end coordinates are 1-based. + + + + + + + + + + + +**What it does** + +This tool uses sambamba view to filter BAM/SAM on flags, fields, tags, and region. +In order to install sambamba, visit its website_ and either download +a Debian package for your architecture, or build the tool from source. + +Input is SAM or BAM file, output is chosen by user. + +**Note** + +Filtering by region works only for coordinate-sorted BAM files. For SAM files this parameter is just ignored. + +----- + +.. _website: http://github.com/lomereiter/sambamba + + + + +