view customProDB.xml @ 1:ad130eaa3a05 draft

planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/custom_pro_db commit e025f5b4d590c44537cf0702e2fb040a28f98fec
author galaxyp
date Fri, 12 May 2017 13:17:40 -0400
parents 8ccfff69dd57
children 2cba79e6037e
line wrap: on
line source

<tool id="custom_pro_db" name="CustomProDB" version="1.16.0">
  <description>Generate protein FASTAs from exosome or transcriptome data</description>
  <requirements>
    <requirement type="package" version="3.3.1">r-base</requirement>
    <!--<requirement type="package" version="1.14.0">bioconductor-customprodb</requirement>-->
    <requirement type="package" version="1.18.0">bioconductor-rgalaxy</requirement>
    <requirement type="package" version="1.21.0">bioconductor-biocinstaller</requirement>
    <requirement type="package" version="1.20.3">bioconductor-variantannotation</requirement>
    <requirement type="package" version="1.11.1">r-devtools</requirement>
    <requirement type="package" version="3.98_1.4">r-xml</requirement>
    <requirement type="package" version="0.10.11">r-rmysql</requirement>
    <requirement type="package" version="1.0.2">r-testthat</requirement>
    <requirement type="package" version="0.1.0">r-getoptlong</requirement>
    <requirement type="package" version="1.1.2">r-stringi</requirement>
    <requirement type="package" version="1.1.0">r-stringr</requirement>
    <requirement type="package" version="1.10.0">r-data.table</requirement>
    <!--<requirement type="package" version="0.4_10">r-sqldf</requirement>-->
    <requirement type="package" version="0.6_6">r-gsubfn</requirement>
    <requirement type="package" version="2.3_47">r-chron</requirement>
    <requirement type="package" version="0.3.10">r-proto</requirement>
    <requirement type="package" version="1.8.4">r-plyr</requirement>
  </requirements>
  <stdio>
    <exit_code range="1:" level="fatal" description="Job Failed" />
  </stdio>
  <command><![CDATA[
    Rscript --vanilla '$__tool_directory__/customProDB.R'
       --bam='$genome_annotation.bamInput'
       --bai='${genome_annotation.bamInput.metadata.bam_index}'
       --vcf='$genome_annotation.vcfInput'
       --rpkmCutoff=$rpkmCutoff
       $outputIndels
       $outputSQLite
       $outputRData

       #if str($genome_annotation.source) == 'history':
            --exon_anno='$genome_annotation.exonAnno'
            --proteinseq='$genome_annotation.proteinSeq'
            --procodingseq='$genome_annotation.proCodingSeq'
            --ids='$genome_annotation.ids'
            #if str($genome_annotation.dbsnpInCoding) != 'None':
                --dbsnpinCoding='$genome_annotation.dbsnpInCoding'
            #end if
            #if str($genome_annotation.cosmic) != 'None':
                --cosmic='$genome_annotation.cosmic'
            #end if
       #else:
            #set index_path = $genome_annotation.builtin.fields.path
            --exon_anno='$index_path/exon_anno.RData'
            --proteinseq='$index_path/proseq.RData'
            --procodingseq='$index_path/procodingseq.RData'
            --ids='$index_path/ids.RData'
            #if $genome_annotation.dbsnpInCoding:
                --dbsnpinCoding='$index_path/dbsnpinCoding.RData'
            #end if
            #if $genome_annotation.cosmic:
                --cosmic='$index_path/cosmic.RData'
            #end if
       #end if
       2>1
]]>
  </command>
  <inputs>
    <conditional name="genome_annotation">
      <param name="source" type="select" label="Will you select a genome annotation from your history or use a built-in annotation?" help="See `Annotations` section of help below">
        <option value="builtin">Use a built-in genome annotation</option>
        <option value="history">Use annotation from your history</option>
      </param>
      <when value="builtin">
        <param name="builtin" type="select" label="Select genome annotation" help="If your genome of interest is not listed, contact the Galaxy team">
          <options from_data_table="customProDB">
            <filter type="sort_by" column="2"/>
            <validator type="no_options" message="No annotations are available for the selected input dataset"/>
          </options>
        </param>
        <param name="bamInput" type="data" format="bam" label="BAM file">
            <validator type="unspecified_build" />
            <validator message="Sequences are not currently available for the specified build." metadata_column="1" metadata_name="dbkey" table_name="customProDB" type="dataset_metadata_in_data_table" />
        </param>
        <!--<param name="baiInput" type="data" format="bam_index" label="BAM Index (BAI) file">
            <validator type="unspecified_build" />
            <validator message="Sequences are not currently available for the specified build." metadata_column="1" metadata_name="dbkey" table_name="customProDB" type="dataset_metadata_in_data_table" />
        </param>-->
        <param name="vcfInput" type="data" format="vcf" label="VCF file">
            <validator type="unspecified_build" />
            <validator message="Sequences are not currently available for the specified build." metadata_column="1" metadata_name="dbkey" table_name="customProDB" type="dataset_metadata_in_data_table" />
        </param>
        <param name="dbsnpInCoding" type="boolean" value="" label="Annotate SNPs with rsid from dbSNP (select organisms only)" />
        <param name="cosmic" type="boolean" value="" label="Annotate somatic SNPs from COSMIC (human only)" />
      </when>
      <when value="history">
        <param name="exonAnno" type="data" format="RData" help="A dataframe of exon annotations in an RData file" label="Exon Annotations" />
        <param name="proteinSeq" type="data" format="RData" help="A dataframe containing protein ids and protein sequences in an RData file" label="Protein Sequences" />
        <param name="proCodingSeq" type="data" format="RData" help="A dataframe cotaining coding sequences for each protein in an RData file" label="Protein Coding Sequences" />
        <param name="ids" type="data" format="RData" help="A dataframe cotaining IDs for each protein in an RData file" label="Protein IDs" />
        <param name="bamInput" type="data" format="bam" label="BAM file">
            <validator check="bam_index" message="Metadata missing, click the pencil icon in the history item and use the auto-detect feature to correct this issue." type="metadata" />
        </param>
        <!--<param name="baiInput" type="data" format="bam_index" label="BAM Index file">
            <validator check="dbkey" message="Metadata missing, click the pencil icon in the history item and use the auto-detect feature to correct this issue." type="metadata" />
        </param>-->
        <param name="vcfInput" type="data" format="vcf" label="VCF file" />
        <param name="dbsnpInCoding" type="data" format="RData" label="A dataframe containing dbSNP rsids" optional="true" />
        <param name="cosmic" type="data" format="RData" label="A dataframe containing somatic SNPs from COSMIC (human only)" optional="true" />
      </when>
    </conditional>
    <param name="rpkmCutoff" type="float" value="1" min="0" label="Transcript Expression Cutoff (RPKM)" help="If non-zero, if a transcript does not meet this expression cutoff (based on RPKM) then it will not be included in the output database." />
    <param name="outputIndels" type="boolean" truevalue="--outputIndels" falsevalue="" label="Create a variant FASTA for short insertions and deletions" />
    <param name="outputSQLite" type="boolean" truevalue="--outputSQLite" falsevalue="" label="Create SQLite files for mapping proteins to genome and summarizing variant proteins" />
    <param name="outputRData" type="boolean" truevalue="--outputRData" falsevalue="" label="Create RData file of variant protein coding sequences" help="The PSM2SAM tool needs this to map variant proteins to genomic locations" />
  </inputs>
  <outputs>
    <data format="fasta" name="output_rpkm" from_work_dir="output_rpkm.fasta" label="${genome_annotation.bamInput.name.rsplit('.',1)[0]}_rpkm.fasta"/>
    <data format="fasta" name="output_snv" from_work_dir="output_snv.fasta" label="${genome_annotation.bamInput.name.rsplit('.',1)[0]}_snv.fasta"/>
    <data format="fasta" name="output_indel" from_work_dir="output_indel.fasta" label="${genome_annotation.bamInput.name.rsplit('.',1)[0]}_indel.fasta">
      <filter>outputIndels is True</filter>
    </data>
    <data format="rdata" name="output_variant_annotation_rdata" from_work_dir="output.rdata" label="${genome_annotation.bamInput.name.rsplit('.',1)[0]}_variantAnnotation.RData">
      <filter>outputRData is True</filter>
    </data>
    <data format="sqlite" name="output_genomic_mapping_sqlite" from_work_dir="output_genomic_mapping.sqlite" label="${genome_annotation.bamInput.name.rsplit('.',1)[0]}_genomicMapping.sqlite">
      <filter>outputSQLite is True</filter>
    </data>
    <data format="sqlite" name="output_variant_annotation_sqlite" from_work_dir="output_variant_annotation.sqlite" label="${genome_annotation.bamInput.name.rsplit('.',1)[0]}_variantAnnotation.sqlite">
      <filter>outputSQLite is True</filter>
    </data>
  </outputs>
  <tests>
    <test expect_num_outputs="5">
      <param name="bamInput" value="hg19/test1_sort.bam" dbkey="hg19" />
      <param name="vcfInput" value="hg19/test1.vcf" dbkey="hg19" />
      <param name="source" value="history" />
      <param name="exonAnno" value="hg19/exon_anno.RData" />
      <param name="proteinSeq" value="hg19/proseq.RData" />
      <param name="proCodingSeq" value="hg19/procodingseq.RData" />
      <param name="ids" value="hg19/ids.RData" />
      <param name="rpkmCutoff" value="1" />
      <param name="outputIndels" value="" />
      <param name="outputRData" value="--outputRData" />
      <param name="outputSQLite" value="--outputSQLite" />
      <output name="output_rpkm" file="hg19_rpkm1.fasta" />
      <output name="output_snv" file="hg19_snv.fasta" />
      <output name="output_variant_annotation_rdata" file="hg19_variant_annotation.rdata" />
      <output name="output_genomic_mapping_sqlite" file="hg19_genomic_mapping.sqlite" />
      <output name="output_variant_annotation_sqlite" file="hg19_variant_annotation.sqlite" />
    </test>
    <test expect_num_outputs="5">
      <param name="bamInput" value="hg19/test1_sort.bam" dbkey="hg19" />
      <param name="vcfInput" value="hg19/test1.vcf" dbkey="hg19" />
      <param name="source" value="history" />
      <param name="exonAnno" value="hg19/exon_anno.RData" />
      <param name="proteinSeq" value="hg19/proseq.RData" />
      <param name="proCodingSeq" value="hg19/procodingseq.RData" />
      <param name="ids" value="hg19/ids.RData" />
      <param name="dbsnpInCoding" value="hg19/dbsnpinCoding.RData" />
      <param name="cosmic" value="hg19/cosmic.RData" />
      <param name="rpkmCutoff" value="0" />
      <param name="outputIndels" value="--outputIndels" />
      <param name="outputSQLite" value="--outputSQLite" />
      <output name="output_rpkm" file="hg19_rpkm0.fasta" />
      <output name="output_snv" file="hg19_dbsnp_snv.fasta" />
      <output name="output_indel" file="hg19_indel.fasta" />
      <output name="output_variant_annotation_rdata" file="hg19_dbsnp_variant_annotation.rdata" />
      <output name="output_variant_annotation_sqlite" file="hg19_dbsnp_variant_annotation.sqlite" />
    </test>
    <test expect_num_outputs="3">
      <param name="bamInput" value="hg19/test1_sort.bam" dbkey="hg19" />
      <param name="vcfInput" value="hg19/test1.vcf" dbkey="hg19" />
      <param name="source" value="history" />
      <param name="exonAnno" value="hg19/exon_anno.RData" />
      <param name="proteinSeq" value="hg19/proseq.RData" />
      <param name="proCodingSeq" value="hg19/procodingseq.RData" />
      <param name="ids" value="hg19/ids.RData" />
      <param name="rpkmCutoff" value="1000" />
      <param name="outputIndels" value="--outputIndels" />
      <output name="output_rpkm" file="hg19_rpkm1000.fasta" />
      <output name="output_snv" file="hg19_snv.fasta" />
      <output name="output_indel" file="hg19_indel.fasta" />
    </test>
  </tests>
  <help>
**Description**

Generate protein FASTAs from exosome or transcriptome data (in the form of BAM files). </help>
  <citations>
    <citation type="doi">10.1093/bioinformatics/btt543</citation>
    <citation type="bibtex">@misc{toolsGalaxyP, author = {Chambers MC, et al.}, title = {Galaxy Proteomics Tools}, publisher = {GitHub}, journal = {GitHub repository},
                                  year = {2017}, url = {https://github.com/galaxyproteomics/tools-galaxyp}}</citation> <!-- TODO: fix substitution of commit ", commit = 
{$sha1$}" -->
  </citations>
</tool>