<commit_before><tool id="ococo" name="ococo" version="0.1.2.6" >
    <description>consensus caller on SAM/BAM</description>
    <requirements>
      <requirement type="package" version="0.1.2.6">ococo</requirement>
    </requirements>
    <command detect_errors="exit_code">
      <![CDATA[

    ococo -i '$input_alignment'


    #if $fasta_reference:
      --fasta-ref '$fasta_reference'
    #end if



    --counters $counters


    --strategy $strategy

    --min-MQ $min_mq
   
    --min-BQ $min_bq

    --ref-weight $ref_weight

    --min-cov $min_cov

    --maj-thres $maj_thres


    #for $out in str($save_output).split(','):
      #if str($out) == 'vcf':
         --vcf-cons $vcf_cons
      #elif str($out) == 'fasta':
         --fasta-cons $fasta_cons
      #elif str($out) == 'pileup':
         --pileup $pileup
      #end if
    #end for

      ]]>
    </command>


    <inputs>
      <param name="input_alignment" type="data" format="bam,sam" label="SAM/BAM dataset"/>
      <param name="fasta_reference" type="data" format="fasta" label="Select fasta reference" optional="True"/>
      <param name="counters" type="select" label="Counter configuration: [ococo16]">
        <option value="ococo16">ococo16 (3b/counter, 16b/position)</option>
        <option value="ococo32">ococo32 (7b/counter, 32b/position)</option>
        <option value="ococo64">ococo64 (15b/counter, 64b/position)</option>
      </param>
      <param name="strategy" type="select" label="Strategy for updates: [majority]">
        <option value="majority">Majority (update to majority base)</option>
        <option value="stochastic">stochastic (update to stochastically drawn base)</option>
      </param>

      <param name="save_output" type="select" label="Save output(s)" optional="False" multiple="True" help="Determine which output file(s) to keep">
        <option value="vcf">Consensus VCF</option>
        <option value="fasta">Consensus Fasta</option>
        <option value="pileup">Pileup</option>
      </param>
      
      <param name="min_mq" type="integer" label="Minimum mapping quality score" help="skip alignments with mapping quality smaller than INT [1]" value="1" argument="min-MQ"/>
      <param name="min_bq" type="integer" label="Minimum base quality score" help="skip bases with base quality smaller than INT [13]" value="13" argument="--min-BQ"/>
      <param name="ref_weight" type="integer" label="Initial nucleotides counter" help="initial counter value for nucleotides from ref [0]" value="0" argument='--ref-weight'/>
      <param name="min_cov" type="integer" label="Minimum coverage required" help="minimum coverage required for update [2]" value="2" argument="--min-cov"/>
      <param name="maj_thres" type="float" label="Majority consensus threshold [0.51]"  value="0.51" argument="--maj-thres"/>
    </inputs>

    <outputs>
      <data name="vcf_cons" format="vcf" label="VCF Consensus on ${input_alignment.name}">
        <filter>'vcf' in save_output</filter>
      </data>
      <data name="fasta_cons" format="fasta" label="Fasta Consensus on ${input_alignment.name}">
        <filter>'fasta' in save_output</filter>
      </data>
      <data name="pileup" format="pileup" label="Pileup on ${input_alignment.name}">
        <filter>'pileup' in save_output</filter>
      </data>
    </outputs>
    <tests>
      <test>
        <param name="input_alignment" value="alignment_A_2.sam"/>
        <param name="fasta_reference" value="reference.fa"/>
        <param name="save_output" value="vcf,fasta,pileup"/>
        <output name="fasta_cons" value="answer.fa"/>
        <output name="pileup" value="answer.pileup"/>
        <output name="vcf_cons">
          <assert_contents>
            <has_text text="AF=1.00;CS=2,0,0,0;COV=2"/>
          </assert_contents>
        </output>
      </test>
    </tests>
    <help>
      <![CDATA[

Documentation available @ https://github.com/karel-brinda/ococo

      ]]>      
    </help>
    <citations>
      <citation type="bibtex">
        @misc{1207.3907,
        Author = {<NAME>},
        Title = {Ococo: an online consensus caller},<commit_msg>more detailed help section<commit_after><tool id="ococo" name="ococo" version="0.1.2.6" >
    <description>consensus caller on SAM/BAM</description>
    <requirements>
      <requirement type="package" version="0.1.2.6">ococo</requirement>
    </requirements>
    <command detect_errors="exit_code">
      <![CDATA[

    ococo -i '$input_alignment'


    #if $fasta_reference:
      --fasta-ref '$fasta_reference'
    #end if



    --counters $counters


    --strategy $strategy

    --min-MQ $min_mq
   
    --min-BQ $min_bq

    --ref-weight $ref_weight

    --min-cov $min_cov

    --maj-thres $maj_thres


    #for $out in str($save_output).split(','):
      #if str($out) == 'vcf':
         --vcf-cons $vcf_cons
      #elif str($out) == 'fasta':
         --fasta-cons $fasta_cons
      #elif str($out) == 'pileup':
         --pileup $pileup
      #end if
    #end for

      ]]>
    </command>


    <inputs>
      <param name="input_alignment" type="data" format="bam,sam" label="SAM/BAM dataset"/>
      <param name="fasta_reference" type="data" format="fasta" label="Select fasta reference" optional="True"/>
      <param name="counters" type="select" label="Counter configuration: [ococo16]">
        <option value="ococo16">ococo16 (3b/counter, 16b/position)</option>
        <option value="ococo32">ococo32 (7b/counter, 32b/position)</option>
        <option value="ococo64">ococo64 (15b/counter, 64b/position)</option>
      </param>
      <param name="strategy" type="select" label="Strategy for updates: [majority]">
        <option value="majority">Majority (update to majority base)</option>
        <option value="stochastic">stochastic (update to stochastically drawn base)</option>
      </param>

      <param name="save_output" type="select" label="Save output(s)" optional="False" multiple="True" help="Determine which output file(s) to keep">
        <option value="vcf">Consensus VCF</option>
        <option value="fasta">Consensus Fasta</option>
        <option value="pileup">Pileup</option>
      </param>
      
      <param name="min_mq" type="integer" label="Minimum mapping quality score" help="skip alignments with mapping quality smaller than INT [1]" value="1" argument="min-MQ"/>
      <param name="min_bq" type="integer" label="Minimum base quality score" help="skip bases with base quality smaller than INT [13]" value="13" argument="--min-BQ"/>
      <param name="ref_weight" type="integer" label="Initial nucleotides counter" help="initial counter value for nucleotides from ref [0]" value="0" argument='--ref-weight'/>
      <param name="min_cov" type="integer" label="Minimum coverage required" help="minimum coverage required for update [2]" value="2" argument="--min-cov"/>
      <param name="maj_thres" type="float" label="Majority consensus threshold [0.51]"  value="0.51" argument="--maj-thres"/>
    </inputs>

    <outputs>
      <data name="vcf_cons" format="vcf" label="VCF Consensus on ${input_alignment.name}">
        <filter>'vcf' in save_output</filter>
      </data>
      <data name="fasta_cons" format="fasta" label="Fasta Consensus on ${input_alignment.name}">
        <filter>'fasta' in save_output</filter>
      </data>
      <data name="pileup" format="pileup" label="Pileup on ${input_alignment.name}">
        <filter>'pileup' in save_output</filter>
      </data>
    </outputs>
    <tests>
      <test>
        <param name="input_alignment" value="alignment_A_2.sam"/>
        <param name="fasta_reference" value="reference.fa"/>
        <param name="save_output" value="vcf,fasta,pileup"/>
        <output name="fasta_cons" value="answer.fa"/>
        <output name="pileup" value="answer.pileup"/>
        <output name="vcf_cons">
          <assert_contents>
            <has_text text="AF=1.00;CS=2,0,0,0;COV=2"/>
          </assert_contents>
        </output>
      </test>
    </tests>
    <help>
      <![CDATA[



**OCOCO - Online Consensus Caller**


**Command line parameters**

-----


**Input options:**


	-i, --input FILE
		input SAM/BAM file (- for standard input)

	-f, --fasta-ref FILE
		initial FASTA reference (otherwise seq of N's is used)
	-s, --stats-in FILE
		input statistics


**Output options:**

	-F, --fasta-cons FILE
		FASTA file with consensus
	-S, --stats-out FILE
		output statistics
	-V, --vcf-cons FILE
		VCF file with updates of consensus (- for standard output)
	-P, --pileup FILE
		truncated pileup (- for standard output)
	--verbose
		verbose mode (report every update of a counter)

**Parameters for consensus calling:**

	-x, --counters STR counter configuration: [ococo16]
		- ococo16 (3b/counter, 16b/position)
		- ococo32 (7b/counter, 32b/position)
		- ococo64 (15b/counter, 64b/position)

	-m, --mode STR mode: [batch]
		- real-time (updates reported immediately)
		- batch (updates reported after end of algn stream)
	-t, --strategy STR strategy for updates: [majority]
		- majority (update to majority base)
		- stochastic (update to stochastically drawn base)
		- no-updates (no updates, only counters updated)

	-q, --min-MQ INT
		skip alignments with mapping quality smaller than INT [1]

	-Q, --min-BQ INT
		skip bases with base quality smaller than INT [13]

	-w, --ref-weight INT
		initial counter value for nucleotides from ref [0]

	-c, --min-cov INT
		minimum coverage required for update [2]

	-M, --maj-thres FLOAT majority threshold [0.51]

Examples:
ococo -i test.bam -f test.fa -m real-time -V -
ococo -x ococo64 -i test.bam -f test.fa -P - -V variants.vcf
      ]]>      
    </help>
    <citations>
      <citation type="bibtex">
        @misc{1207.3907,
        Author = {<NAME>},
        Title = {Ococo: an online consensus caller},
{'fraction_non_alphanumeric': 0.1557804354492487, 'fraction_numerical': 0.01615046509250741, 'mean_word_length': 3.1528013582342953, 'pattern_counts': {'":': 0, '<': 153, '<?xml version=': 0, '>': 153, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, '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': '882232', 'n_tokens_mistral': 3358, 'n_tokens_neox': 3105, 'n_words': 794}