<commit_before><tool id="samtools_view" name="Samtools view" version="@TOOL_VERSION@">
    <description>reformat, filter, or subsample</description>
    <macros>
    <import>macros.xml</import>
    </macros>
    <expand macro="requirements"/>
    <expand macro="stdio"/>
    <expand macro="version_command"/>
    <command><![CDATA[
        @ADDTHREADS@
        ## prepare reference data
        @PREPARE_FASTA_IDX@
        @PREPARE_IDX@

        ##call samtools view
        samtools view
        -@ \$addthreads

        #if $outtype == 'count':
            -c
        #elif $outtype == 'bam':
            -b
        #elif $outtype == 'cram':
            -C
        #end if

        ## filter options (regions filter is the last parameter)
        #if $cond_filter.select_filter == 'yes':
            #if $cond_filter.cond_region.select_region == 'bed' and str( $cond_filter.cond_region.bedfile ) != 'None'
                -L '$cond_filter.bedfile'
            #end if
            #if $cond_filter.cond_rg.select_rg == 'text':
                -r '$cond_filter.cond_rg.readgr'
            #else if $cond_filter.cond_rg.select_rg == 'file':
                -R '$cond_filter.cond_rg.rgfile'
            #end if
            #if str($cond_filter.quality) != '' and int( $cond_filter.quality ) > 0
                -q $cond_filter.quality
            #end if
            #if str( $cond_filter.library ) != ''
                -l '$cond_filter.library'
            #end if
            #if str( $cond_filter.cigarcons ) != ''
                -m $cond_filter.cigarcons
            #end if
            #if str($cond_filter.inclusive_filter) != 'None':
                #set $filter = $cond_filter.inclusive_filter
                @FLAGS@
                -f $flags
            #end if
            #if str($cond_filter.exclusive_filter) != 'None':
                #set $filter = $cond_filter.exclusive_filter
                @FLAGS@
                -F $flags
            #end if
            #if str($cond_filter.exclusive_filter_all) != 'None':
                #set $filter = $cond_filter.exclusive_filter_all
                @FLAGS@
                -G $flags
            #end if
            #for $i, $s in enumerate($cond_filter.readtags)
                -x '${s.readtag}'
            #end for
        #end if
        #if $cond_subsample.select_subsample == 'yes':
            #set fraction=str($cond_subsample.subsample).split('.')[1]
            #if str($cond_subsample.seed) == '':
                -s "\${RANDOM}".$fraction
            #else
                -s $cond_subsample.seed.$fraction
            #end if
        #end if

        ## output options
        $adv_output.header
        $adv_output.collapsecigar
        #if $adv_output.outputpassing == 'yes'
            -U inv_outfile
        #end if
        -o outfile

        ## additional reference data
        #if $reffa!=None:
            -T '$reffa'
            -t '$reffai'
        #else:    <commit_msg>samtools view: space<commit_after><tool id="samtools_view" name="Samtools view" version="@TOOL_VERSION@">
    <description>reformat, filter, or subsample</description>
    <macros>
    <import>macros.xml</import>
    </macros>
    <expand macro="requirements"/>
    <expand macro="stdio"/>
    <expand macro="version_command"/>
    <command><![CDATA[
        @ADDTHREADS@
        ## prepare reference data
        @PREPARE_FASTA_IDX@
        @PREPARE_IDX@

        ##call samtools view
        samtools view
        -@ \$addthreads

        #if $outtype == 'count':
            -c
        #elif $outtype == 'bam':
            -b
        #elif $outtype == 'cram':
            -C
        #end if

        ## filter options (regions filter is the last parameter)
        #if $cond_filter.select_filter == 'yes':
            #if $cond_filter.cond_region.select_region == 'bed' and str( $cond_filter.cond_region.bedfile ) != 'None'
                -L '$cond_filter.bedfile'
            #end if
            #if $cond_filter.cond_rg.select_rg == 'text':
                -r '$cond_filter.cond_rg.readgr'
            #else if $cond_filter.cond_rg.select_rg == 'file':
                -R '$cond_filter.cond_rg.rgfile'
            #end if
            #if str($cond_filter.quality) != '' and int( $cond_filter.quality ) > 0
                -q $cond_filter.quality
            #end if
            #if str( $cond_filter.library ) != ''
                -l '$cond_filter.library'
            #end if
            #if str( $cond_filter.cigarcons ) != ''
                -m $cond_filter.cigarcons
            #end if
            #if str($cond_filter.inclusive_filter) != 'None':
                #set $filter = $cond_filter.inclusive_filter
                @FLAGS@
                -f $flags
            #end if
            #if str($cond_filter.exclusive_filter) != 'None':
                #set $filter = $cond_filter.exclusive_filter
                @FLAGS@
                -F $flags
            #end if
            #if str($cond_filter.exclusive_filter_all) != 'None':
                #set $filter = $cond_filter.exclusive_filter_all
                @FLAGS@
                -G $flags
            #end if
            #for $i, $s in enumerate($cond_filter.readtags)
                -x '${s.readtag}'
            #end for
        #end if
        #if $cond_subsample.select_subsample == 'yes':
            #set fraction=str($cond_subsample.subsample).split('.')[1]
            #if str($cond_subsample.seed) == '':
                -s "\${RANDOM}".$fraction
            #else
                -s $cond_subsample.seed.$fraction
            #end if
        #end if

        ## output options
        $adv_output.header
        $adv_output.collapsecigar
        #if $adv_output.outputpassing == 'yes'
            -U inv_outfile
        #end if
        -o outfile

        ## additional reference data
        #if $reffa!=None:
            -T '$reffa'
            -t '$reffai'
        #else:
{'fraction_non_alphanumeric': 0.1245142760601453, 'fraction_numerical': 0.0006757898293630681, 'mean_word_length': 1.5396825396825398, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1459821', 'n_tokens_mistral': 1822, 'n_tokens_neox': 1751, 'n_words': 376}