<commit_before><tool id="small_rna_map" name="small rna map" version="0.3.0">
  <description></description>
  <requirements>
        <requirement type="package" version="1.11.2=py27_0">numpy</requirement>
        <requirement type="package" version="0.11.2.1=py27_0">pysam</requirement>
        <requirement type="package" version="1.3.2=r3.3.1_0">r-optparse</requirement>
        <requirement type="package" version="0.6_28=r3.3.1_0">r-latticeextra</requirement>
        <requirement type="package" version="2.2.1=r3.3.1_0">r-gridextra</requirement>
  </requirements>
  <stdio>
      <exit_code range="1:" level="fatal" description="Tool exception" />
  </stdio>
  <command detect_errors="exit_code"><![CDATA[
      python '$__tool_directory__'/small_rna_map.py 
      --input 
      #for $file in $input
            '$file'
      #end for
      --sample_name
      #for $sample in $input
          '$sample.name'
      #end for
      --output '$output_tab' &&
       Rscript '$__tool_directory__'/lattice_small_rna_map.r --output_tab '$output_tab' --output_pdf '$output_pdf'
  ]]></command>
 <inputs>
   <param name="input" type="data" format="bam" label="Select multiple alignments to parse" multiple="True"/>     
 </inputs>

 <outputs>
   <data format="tabular" name="output_tab" label="tabular file" />
   <data format="pdf" name="output_pdf" label="PDF file" />
</outputs>

    <tests>
        <test>
            <param name="input" value="input1.bam,input2.bam" ftype="bam"/>
            <output file="output.tab" name="output_tab" />
            <output file="output_lattice.pdf" name="output_pdf" />
        </test>
        <test>
            <param name="input" value="input1.bam,input1.bam" ftype="bam"/>
            <output file="output_doubled.tab" name="output_tab" />
            <output file="output_lattice_doubled.pdf" name="output_pdf" />
        </test>
    </tests>


<help>

**What it does**

Generate read count maps from alignment BAM files, using pysam and ggplot.
In addition to the read counts (bars), median size and mean size of reads mapping at a given position are plotted in the graphs.	

**Inputs**
Bam alignment files. Be carreful to select Bam corresponding to alignments to the same reference

**Output**
A pdf file generated by the R package ggplot2

</help>

<citations>
    <citation type="doi">10.1093/bioinformatics/btp352</citation>
     <citation type="bibtex">@Book{,
    author = {<NAME>},
    title = {ggplot2: Elegant Graphics for Data Analysis},
    publisher = {Springer-Verlag New York},
    year = {2009},
    isbn = {978-0-387-98140-6},
    url = {http://ggplot2.org},
   }</citation>
</citations>
</tool>

<commit_msg>bump tool version to 0.4.0<commit_after><tool id="small_rna_map" name="small rna map" version="0.4.0">
  <description></description>
  <requirements>
        <requirement type="package" version="1.11.2=py27_0">numpy</requirement>
        <requirement type="package" version="0.11.2.1=py27_0">pysam</requirement>
        <requirement type="package" version="1.3.2=r3.3.1_0">r-optparse</requirement>
        <requirement type="package" version="0.6_28=r3.3.1_0">r-latticeextra</requirement>
        <requirement type="package" version="2.2.1=r3.3.1_0">r-gridextra</requirement>
  </requirements>
  <stdio>
      <exit_code range="1:" level="fatal" description="Tool exception" />
  </stdio>
  <command detect_errors="exit_code"><![CDATA[
      python '$__tool_directory__'/small_rna_map.py 
      --input 
      #for $file in $input
            '$file'
      #end for
      --sample_name
      #for $sample in $input
          '$sample.name'
      #end for
      --output '$output_tab' &&
       Rscript '$__tool_directory__'/lattice_small_rna_map.r --output_tab '$output_tab' --output_pdf '$output_pdf'
  ]]></command>
 <inputs>
   <param name="input" type="data" format="bam" label="Select multiple alignments to parse" multiple="True"/>     
 </inputs>

 <outputs>
   <data format="tabular" name="output_tab" label="tabular file" />
   <data format="pdf" name="output_pdf" label="PDF file" />
</outputs>

    <tests>
        <test>
            <param name="input" value="input1.bam,input2.bam" ftype="bam"/>
            <output file="output.tab" name="output_tab" />
            <output file="output_lattice.pdf" name="output_pdf" />
        </test>
        <test>
            <param name="input" value="input1.bam,input1.bam" ftype="bam"/>
            <output file="output_doubled.tab" name="output_tab" />
            <output file="output_lattice_doubled.pdf" name="output_pdf" />
        </test>
    </tests>


<help>

**What it does**

Generate read count maps from alignment BAM files, using pysam and ggplot.
In addition to the read counts (bars), median size and mean size of reads mapping at a given position are plotted in the graphs.	

**Inputs**
Bam alignment files. Be carreful to select Bam corresponding to alignments to the same reference

**Output**
A pdf file generated by the R package ggplot2

</help>

<citations>
    <citation type="doi">10.1093/bioinformatics/btp352</citation>
     <citation type="bibtex">@Book{,
    author = {<NAME>},
    title = {ggplot2: Elegant Graphics for Data Analysis},
    publisher = {Springer-Verlag New York},
    year = {2009},
    isbn = {978-0-387-98140-6},
    url = {http://ggplot2.org},
   }</citation>
</citations>
</tool>


{'fraction_non_alphanumeric': 0.15419077842075787, 'fraction_numerical': 0.028187418331155498, 'mean_word_length': 3.2898318654923937, 'pattern_counts': {'":': 0, '<': 103, '<?xml version=': 0, '>': 103, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '5270781', 'n_tokens_mistral': 1867, 'n_tokens_neox': 1770, 'n_words': 412}