<commit_before><tool id="cutesv" name="cuteSV" version="@WRAPPER_VERSION@">
    <description>detects long-read-based SVs</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <requirements>
        <requirement type="package" version="@TOOL_VERSION@">cutesv</requirement>
        <requirement type="package" version="1.10">samtools</requirement>
    </requirements>
    <command detect_errors="exit_code"><![CDATA[
        ln '$input_sample_file' ./sample.bam &&
        samtools index ./sample.bam ./sample.bam.bai &&

        #if str($reference_source.ref_selector) == 'history':
            ln -s '$reference_source.ref' ./genome.fa &&
            samtools faidx ./genome.fa 2>&1 || echo 'Error running samtools faidx for indexing fasta reference for cuteSV' >&2 &&
        #else:
            ln -s '$reference_source.ref.fields.path' ./genome.fa &&
            ln -s '${reference_source.ref.fields.path}.fai' ./genome.fa.fai &&
        #end if

        cuteSV ./sample.bam ./genome.fa ./output.vcf ./
            --threads \${GALAXY_SLOTS:-16}
            --batches '$sel_method.adv_settings.batches'
            #if $sample == "":
            --sample NULL
            #else:
            --sample '$sample'
            #end if
            #if $sel_method.adv_settings.report_readid:
            --report_readid
            #end if
            --max_split_parts '$sel_method.adv_settings.max_split_parts'
            --min_mapq '$sel_method.adv_settings.min_mapq'
            --min_read_len '$sel_method.adv_settings.min_read_len'
            --merge_del_threshold '$sel_method.adv_settings.merge_del_threshold'
            --merge_ins_threshold '$sel_method.adv_settings.merge_ins_threshold'
            --min_support '$sel_method.adv_settings.min_support'
            --min_size '$sel_method.adv_settings.min_size'
            --max_size '$sel_method.adv_settings.max_size'
            #if $sel_method.adv_settings.genotyping.genotype:
            --genotype
            #end if
            --gt_round '$sel_method.adv_settings.genotyping.gt_round'
            --max_cluster_bias_INS '$sel_method.adv_settings.seq_method.max_cluster_bias_INS'
            --diff_ratio_merging_INS '$sel_method.adv_settings.seq_method.diff_ratio_merging_INS'
            --max_cluster_bias_DEL '$sel_method.adv_settings.seq_method.max_cluster_bias_DEL'
            --diff_ratio_merging_DEL '$sel_method.adv_settings.seq_method.diff_ratio_merging_DEL'
            --max_cluster_bias_INV '$sel_method.adv_settings.max_cluster_bias_INV'
            --max_cluster_bias_DUP '$sel_method.adv_settings.max_cluster_bias_DUP'
            --max_cluster_bias_TRA '$sel_method.adv_settings.max_cluster_bias_TRA'
            --diff_ratio_filtering_TRA '$sel_method.adv_settings.diff_ratio_filtering_TRA'
    ]]></command>
    <inputs>
        <param name="input_sample_file" type="data" format="bam" multiple="false" label="Sample file" help="Sample file in .BAM format (sorted)." />
        <expand macro="reference_interface" />
        <param name="sample" type="text" value="Sample" label="Sample name/id" help="" />
        <conditional name="sel_method">
            <param name="meth_selector" type="select" label="Select the sequencing method of the input file" help="">
                <option value="pb_clr" selected="True">PacBio continuous long reads</option>
                <option value="pb_ccs">PacBio circular consensus sequencing (HiFi)</option>
                <option value="pb_ont">ONT</option>
                <option value="other">other method</option>
            </param>
            <when value="pb_clr">
                <section name="adv_settings" title="Advanced settings" expanded="false">
                    <expand macro="adv_shared_1" />
                    <expand macro="adv_pb_clr" />
                    <expand macro="adv_shared_2" />
                </section>
            </when>
            <when value="pb_ccs">
                <section name="adv_settings" title="Advanced settings" expanded="false">
                    <expand macro="adv_shared_1" />
                    <expand macro="adv_pb_ccs" />
                    <expand macro="adv_shared_2" />
                </section>
            </when>
            <when value="pb_ont">
                <section name="adv_settings" title="Advanced settings" expanded="false">
                    <expand macro="adv_shared_1" />
                    <expand macro="adv_ont" />
                    <expand macro="adv_shared_2" />
                </section>
            </when>
            <when value="other">
                <section name="adv_settings" title="Advanced settings" expanded="true">
                    <expand macro="adv_shared_1" />
                    <expand macro="adv_other" />
                    <expand macro="adv_shared_2" />
                </section>
            </when>
        </conditional>
    </inputs>
    <outputs>
        <data name="out_sample" format="vcf" label="${tool.name} on ${on_string}: output" from_work_dir="output.vcf" />
    </outputs>
    <tests>
    </tests>
    <help><![CDATA[
cuteSV
=============

Long-read sequencing enables the comprehensive discovery of structural variations (SVs). However, it is still non-trivial to achieve high sensitivity and performance simultaneously due to the complex SV characteristics implied by noisy long reads. Therefore, we propose cuteSV, a sensitive, fast and scalable long-read-based SV detection approach. cuteSV uses tailored methods to collect the signatures of various types of SVs and employs a clustering-and-refinement method to analyze the signatures to implement sensitive SV detection. Benchmarks on real Pacific Biosciences (PacBio) and Oxford Nanopore Technology (ONT) datasets demonstrate that cuteSV has better yields and scalability than state-of-the-art tools.

For more information see the cuteSV documentation_.

.. _documentation: https://github.com/tjiangHIT/cuteSV

    ]]></help>
     <citations>
         <citation type="doi">10.1186/s13059-020-02107-y</citation>
    </citations>
</tool><commit_msg>Add tests<commit_after><tool id="cutesv" name="cuteSV" version="@WRAPPER_VERSION@">
    <description>detects long-read-based SVs</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <requirements>
        <requirement type="package" version="@TOOL_VERSION@">cutesv</requirement>
        <requirement type="package" version="1.10">samtools</requirement>
    </requirements>
    <command detect_errors="exit_code"><![CDATA[
        ln '$input_sample_file' ./sample.bam &&
        samtools index ./sample.bam ./sample.bam.bai &&

        #if str($reference_source.ref_selector) == 'history':
            ln -s '$reference_source.ref' ./genome.fa &&
            samtools faidx ./genome.fa 2>&1 || echo 'Error running samtools faidx for indexing fasta reference for cuteSV' >&2 &&
        #else:
            ln -s '$reference_source.ref.fields.path' ./genome.fa &&
            ln -s '${reference_source.ref.fields.path}.fai' ./genome.fa.fai &&
        #end if

        cuteSV ./sample.bam ./genome.fa ./output.vcf ./
            --threads \${GALAXY_SLOTS:-16}
            --batches '$sel_method.adv_settings.batches'
            #if $sample == "":
            --sample NULL
            #else:
            --sample '$sample'
            #end if
            #if $sel_method.adv_settings.report_readid:
            --report_readid
            #end if
            --max_split_parts '$sel_method.adv_settings.max_split_parts'
            --min_mapq '$sel_method.adv_settings.min_mapq'
            --min_read_len '$sel_method.adv_settings.min_read_len'
            --merge_del_threshold '$sel_method.adv_settings.merge_del_threshold'
            --merge_ins_threshold '$sel_method.adv_settings.merge_ins_threshold'
            --min_support '$sel_method.adv_settings.min_support'
            --min_size '$sel_method.adv_settings.min_size'
            --max_size '$sel_method.adv_settings.max_size'
            #if $sel_method.adv_settings.genotyping.genotype:
            --genotype
            #end if
            --gt_round '$sel_method.adv_settings.genotyping.gt_round'
            --max_cluster_bias_INS '$sel_method.adv_settings.seq_method.max_cluster_bias_INS'
            --diff_ratio_merging_INS '$sel_method.adv_settings.seq_method.diff_ratio_merging_INS'
            --max_cluster_bias_DEL '$sel_method.adv_settings.seq_method.max_cluster_bias_DEL'
            --diff_ratio_merging_DEL '$sel_method.adv_settings.seq_method.diff_ratio_merging_DEL'
            --max_cluster_bias_INV '$sel_method.adv_settings.max_cluster_bias_INV'
            --max_cluster_bias_DUP '$sel_method.adv_settings.max_cluster_bias_DUP'
            --max_cluster_bias_TRA '$sel_method.adv_settings.max_cluster_bias_TRA'
            --diff_ratio_filtering_TRA '$sel_method.adv_settings.diff_ratio_filtering_TRA'
    ]]></command>
    <inputs>
        <param name="input_sample_file" type="data" format="bam" multiple="false" label="Sample file" help="Sample file in .BAM format (sorted)." />
        <expand macro="reference_interface" />
        <param name="sample" type="text" value="Sample" label="Sample name/id" help="" />
        <conditional name="sel_method">
            <param name="meth_selector" type="select" label="Select the sequencing method of the input file" help="">
                <option value="pb_clr" selected="True">PacBio continuous long reads</option>
                <option value="pb_ccs">PacBio circular consensus sequencing (HiFi)</option>
                <option value="pb_ont">ONT</option>
                <option value="other">other method</option>
            </param>
            <when value="pb_clr">
                <section name="adv_settings" title="Advanced settings" expanded="false">
                    <expand macro="adv_shared_1" />
                    <expand macro="adv_pb_clr" />
                    <expand macro="adv_shared_2" />
                </section>
            </when>
            <when value="pb_ccs">
                <section name="adv_settings" title="Advanced settings" expanded="false">
                    <expand macro="adv_shared_1" />
                    <expand macro="adv_pb_ccs" />
                    <expand macro="adv_shared_2" />
                </section>
            </when>
            <when value="pb_ont">
                <section name="adv_settings" title="Advanced settings" expanded="false">
                    <expand macro="adv_shared_1" />
                    <expand macro="adv_ont" />
                    <expand macro="adv_shared_2" />
                </section>
            </when>
            <when value="other">
                <section name="adv_settings" title="Advanced settings" expanded="true">
                    <expand macro="adv_shared_1" />
                    <expand macro="adv_other" />
                    <expand macro="adv_shared_2" />
                </section>
            </when>
        </conditional>
    </inputs>
    <outputs>
        <data name="out_sample" format="vcf" label="${tool.name} on ${on_string}: output" from_work_dir="output.vcf" />
    </outputs>
    <tests>
        <test expect_num_outputs="1">
            <conditional name="reference_source">
                <param name="ref_selector" value="history"/>
                <param name="ref" ftype="fasta" value="genome.fasta" />
            </conditional>
            <param name="seq_method" value="pb_ccs" />
            <param name="input_sample_file" ftype="bam" value="sample.bam" />
            <output name="out_sample">
                <assert_contents>
                    <has_text text="##fileformat=VCFv4.2"/>
                    <has_text text="##source=cuteSV-1.0.8"/>
                </assert_contents>
            </output>
        </test>
        <test expect_num_outputs="1">
            <conditional name="reference_source">
                <param name="ref_selector" value="cached"/>
                <param name="ref" value="test_buildid"/>
            </conditional>
            <param name="seq_method" value="pb_ccs" />
            <param name="input_sample_file" ftype="bam" value="sample.bam" />
            <output name="out_sample">
                <assert_contents>
                    <has_text text="##fileformat=VCFv4.2"/>
                    <has_text text="##source=cuteSV-1.0.8"/>
                </assert_contents>
            </output>
        </test>
    </tests>
    <help><![CDATA[
cuteSV
=============

Long-read sequencing enables the comprehensive discovery of structural variations (SVs). However, it is still non-trivial to achieve high sensitivity and performance simultaneously due to the complex SV characteristics implied by noisy long reads. Therefore, we propose cuteSV, a sensitive, fast and scalable long-read-based SV detection approach. cuteSV uses tailored methods to collect the signatures of various types of SVs and employs a clustering-and-refinement method to analyze the signatures to implement sensitive SV detection. Benchmarks on real Pacific Biosciences (PacBio) and Oxford Nanopore Technology (ONT) datasets demonstrate that cuteSV has better yields and scalability than state-of-the-art tools.

For more information see the cuteSV documentation_.

.. _documentation: https://github.com/tjiangHIT/cuteSV

    ]]></help>
     <citations>
         <citation type="doi">10.1186/s13059-020-02107-y</citation>
    </citations>
</tool>
{'fraction_non_alphanumeric': 0.12277580071174377, 'fraction_numerical': 0.006079478054567023, 'mean_word_length': 2.3446565831886934, 'pattern_counts': {'":': 2, '<': 179, '<?xml version=': 0, '>': 183, 'https://': 2, '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': '777997', 'n_tokens_mistral': 3995, 'n_tokens_neox': 3759, 'n_words': 787}