view PSM2SAM.xml @ 3:16c4cc7793e9 draft default tip

planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/bumbershoot/psm2sam commit d4b5497065b853ed094aebc9e4185e9995c5e0e0
author galaxyp
date Wed, 01 Nov 2017 19:28:25 -0400
parents 3192cb6a88f6
children
line wrap: on
line source

<tool id="PSMtoSAM" name="PSM to SAM" version="1.3.2.1">
  <description>Generate SAM files from PSMs.</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>
    <requirement type="package" version="1.1_0">r-fastmatch</requirement>
    <requirement type="package" version="0.1.0">r-ahocorasicktrie</requirement>
  </requirements>
  <stdio>
    <exit_code range="1:" level="fatal" description="Job Failed" />
  </stdio>
  <command><![CDATA[
    Rscript --vanilla '$__tool_directory__/PSM2SAM.R'

       #if str($input.input_type) == "idpicker":
          --idpDB="$input.input_file"
          --searchEngineScore="$input.scoreColumn"
       #else if str($input.input_type) == "peptideshaker":
          --peptideShakerPsmReport="$input.input_file"
       #else if str($input.input_type) == "pepxmltab":
          --pepXmlTab="$input.input_file"
          --searchEngineScore="$input.scoreColumn"
       #end if

       --bam="$bam_file"

       #if str($variantAnnotation_file) != 'None':
          --variantAnnotation="$variantAnnotation_file"
       #end if

       #if str($genome_annotation.source) == "history":
            --exon_anno="$genome_annotation.exonAnno"
            --proteinseq="$genome_annotation.proteinSeq"
            --procodingseq="$genome_annotation.proCodingSeq"
       #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"
       #end if
    2>&1
]]>
  </command>
  <inputs>
    <conditional name="input">
      <param name="input_type" 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="idpicker">IDPicker idpDB</option>
        <option value="peptideshaker">PeptideShaker PSM report</option>
        <option value="pepxmltab">PepXmlTab</option>
      </param>
      <when value="idpicker">
        <param name="input_file" type="data" format="idpdb" help="An IDPicker idpDB file to convert to SAM" label="Input PSMs">
          <validator type="empty_field" message="This field is required."/>
        </param>
        <param name="scoreColumn" type="text" help="The name of a PSM score to include in the SAM output (e.g. &quot;MyriMatch:mvh&quot;)" size="60" label="Score Name">
          <validator type="empty_field" message="This field is required."/>
        </param>
      </when>
      <when value="peptideshaker">
        <param name="input_file" type="data" format="tabular" help="A PeptideShaker PSM report to convert to SAM" label="Input PSMs">
          <validator type="empty_field" message="This field is required."/>
        </param>
      </when>
      <when value="pepxmltab">
        <param name="input_file" type="data" format="tabular" help="A pepXmlTab file to convert to SAM" label="Input PSMs">
          <validator type="empty_field" message="This field is required."/>
        </param>
        <param name="scoreColumn" type="text" help="The name of a PSM score to include in the SAM output (e.g. &quot;mvh&quot;)" size="60" label="Score Name">
          <validator type="empty_field" message="This field is required."/>
        </param>
      </when>
    </conditional>
    <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>
      </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" />
      </when>
    </conditional>
    <param name="bam_file" type="data" format="bam,sam" help="A SAM or BAM file to extract headers from (i.e. sequence metadata from reference genome)" label="SAM/BAM Headers">
      <validator type="empty_field" message="This field is required."/>
    </param>
    <param name="variantAnnotation_file" type="data" format="RData" help="A variant annotation .RData file from customProDB." label="Variant Annotation" optional="true" />
  </inputs>
  <outputs>
    <data format="sam" name="output_sam" from_work_dir="output.sam" label="${input.input_file.name.rsplit('.',1)[0]}.sam"/>
  </outputs>
  <tests>
    <test>
      <param name="input_type" value="idpicker" />
      <param name="input_file" value="hg19/test.idpDB" dbkey="hg19" />
      <param name="scoreColumn" value="Myrimatch:MVH" />
      <param name="source" value="history" />
      <param name="exonAnno" value="hg19/exon_anno.RData" dbkey="hg19" />
      <param name="proteinSeq" value="hg19/proseq.RData" dbkey="hg19" />
      <param name="proCodingSeq" value="hg19/procodingseq.RData" dbkey="hg19" />
      <param name="bam_file" value="hg19/hg19_headers.sam" dbkey="hg19" />
      <param name="variantAnnotation_file" value="hg19/hg19_variant_annotation.RData" dbkey="hg19" />
      <output name="output" file="idpicker_hg19_with_variants.sam" />
    </test>
    <test>
      <param name="input_type" value="idpicker" />
      <param name="input_file" value="hg19/test.idpDB" dbkey="hg19" />
      <param name="scoreColumn" value="Myrimatch:MVH" />
      <param name="source" value="history" />
      <param name="exonAnno" value="hg19/exon_anno.RData" dbkey="hg19" />
      <param name="proteinSeq" value="hg19/proseq.RData" dbkey="hg19" />
      <param name="proCodingSeq" value="hg19/procodingseq.RData" dbkey="hg19" />
      <param name="bam_file" value="hg19/hg19_headers.sam" dbkey="hg19" />
      <output name="output" file="idpicker_hg19_no_variants.sam" />
    </test>
    <!--<test>
      <param name="input_type" value="pepxmltab" />
      <param name="input_file" value="passedPSM.tab" dbkey="hg19" />
      <param name="scoreColumn" value="Myrimatch:MVH" />
      <param name="source" value="history" />
      <param name="exonAnno" value="gencode/exon_anno.RData" dbkey="hg19" />
      <param name="proteinSeq" value="gencode/proseq.RData" dbkey="hg19" />
      <param name="proCodingSeq" value="gencode/procodingseq.RData" dbkey="hg19" />
      <output name="output" file="pepXmlTab_gencode.sam" />
    </test>-->
    <test>
      <param name="input_type" value="peptideshaker" />
      <param name="input_file" value="mm10/test.psm-report" dbkey="mm9" />
      <param name="source" value="history" />
      <param name="exonAnno" value="mm10/exon_anno.RData" dbkey="mm9" />
      <param name="proteinSeq" value="mm10/proseq.RData" dbkey="mm9" />
      <param name="proCodingSeq" value="mm10/procodingseq.RData" dbkey="mm9" />
      <param name="bam_file" value="mm10/Sample_Mouse_pro-B_total.whole_exp.bam" dbkey="mm9" />
      <param name="variantAnnotation_file" value="mm10/mm10_variant_annotation.RData" dbkey="mm9" />
      <output name="output" file="peptideshaker_mm10.sam" />
    </test>
  </tests>
  <help>
**Description**

Generate SAM files from confident peptide-spectrum-matches (PSMs).
</help>
</tool>