/tools/samtools/sam_pileup.xml

https://bitbucket.org/cistrome/cistrome-harvard/ · XML · 184 lines · 150 code · 23 blank · 11 comment · 0 complexity · b6f48c9b40e2f1594d0136e1bced194c MD5 · raw file

  1. <tool id="sam_pileup" name="Generate pileup" version="1.1.1">
  2. <description>from BAM dataset</description>
  3. <requirements>
  4. <requirement type="package">samtools</requirement>
  5. </requirements>
  6. <command interpreter="python">
  7. sam_pileup.py
  8. --input1=$input1
  9. --output=$output1
  10. --ref=$refOrHistory.reference
  11. #if $refOrHistory.reference == "history":
  12. --ownFile=$refOrHistory.ownFile
  13. #else:
  14. --ownFile="None"
  15. #end if
  16. --dbkey=${input1.metadata.dbkey}
  17. --indexDir=${GALAXY_DATA_INDEX_DIR}
  18. --bamIndex=${input1.metadata.bam_index}
  19. --lastCol=$lastCol
  20. --indels=$indels
  21. --mapCap=$mapCap
  22. --consensus=$c.consensus
  23. #if $c.consensus == "yes":
  24. --theta=$c.theta
  25. --hapNum=$c.hapNum
  26. --fraction=$c.fraction
  27. --phredProb=$c.phredProb
  28. #else:
  29. --theta="None"
  30. --hapNum="None"
  31. --fraction="None"
  32. --phredProb="None"
  33. #end if
  34. </command>
  35. <inputs>
  36. <conditional name="refOrHistory">
  37. <param name="reference" type="select" label="Will you select a reference genome from your history or use a built-in index?">
  38. <option value="indexed">Use a built-in index</option>
  39. <option value="history">Use one from the history</option>
  40. </param>
  41. <when value="indexed">
  42. <param name="input1" type="data" format="bam" label="Select the BAM file to generate the pileup file for">
  43. <validator type="unspecified_build" />
  44. <validator type="dataset_metadata_in_file" filename="sam_fa_indices.loc" metadata_name="dbkey" metadata_column="1" message="Sequences are not currently available for the specified build." line_startswith="index" />
  45. </param>
  46. </when>
  47. <when value="history">
  48. <param name="input1" type="data" format="bam" label="Select the BAM file to generate the pileup file for" />
  49. <param name="ownFile" type="data" format="fasta" metadata_name="dbkey" label="Select a reference genome" />
  50. </when>
  51. </conditional>
  52. <param name="lastCol" type="select" label="Whether or not to print the mapping quality as the last column" help="Makes the output easier to parse, but is space inefficient">
  53. <option value="no">Do not print the mapping quality as the last column</option>
  54. <option value="yes">Print the mapping quality as the last column</option>
  55. </param>
  56. <param name="indels" type="select" label="Whether or not to print only output pileup lines containing indels">
  57. <option value="no">Print all lines</option>
  58. <option value="yes">Print only lines containing indels</option>
  59. </param>
  60. <param name="mapCap" type="integer" value="60" label="Where to cap mapping quality" />
  61. <conditional name="c">
  62. <param name="consensus" type="select" label="Call consensus according to MAQ model?">
  63. <option selected="true" value="no">No</option>
  64. <option value="yes">Yes</option>
  65. </param>
  66. <when value="no" />
  67. <when value="yes">
  68. <param name="theta" type="float" value="0.85" label="Theta parameter (error dependency coefficient) in the MAQ consensus calling model" />
  69. <param name="hapNum" type="integer" value="2" label="Number of haplotypes in the sample" help="Greater than or equal to 2" />
  70. <param name="fraction" type="float" value="0.001" label="Expected fraction of differences between a pair of haplotypes" />
  71. <param name="phredProb" type="integer" value="40" label="Phred probability of an indel in sequencing/prep" />
  72. </when>
  73. </conditional>
  74. </inputs>
  75. <outputs>
  76. <data format="tabular" name="output1" label="${tool.name} on ${on_string}: converted pileup" />
  77. </outputs>
  78. <tests>
  79. <test>
  80. <!--
  81. Bam to pileup command:
  82. samtools faidx chr_m.fasta
  83. samtools pileup -M 60 -f chr_m.fasta test-data/sam_pileup_in1.bam > sam_pileup_out1.pileup
  84. chr_m.fasta is the prefix of the index
  85. -->
  86. <param name="reference" value="history" />
  87. <param name="input1" value="sam_pileup_in1.bam" ftype="bam" />
  88. <param name="ownFile" value="chr_m.fasta" ftype="fasta" dbkey="equCab2" />
  89. <param name="lastCol" value="no" />
  90. <param name="indels" value="no" />
  91. <param name="mapCap" value="60" />
  92. <param name="consensus" value="no" />
  93. <output name="output1" file="sam_pileup_out1.pileup" />
  94. </test>
  95. <test>
  96. <!--
  97. Bam to pileup command:
  98. samtools pileup -M 60 -c -T 0.85 -N 2 -r 0.001 -I 40 -f chr_m.fasta test-data/sam_pileup_in1.bam > sam_pileup_out2.pileup
  99. chr_m.fasta is the prefix of the index
  100. -->
  101. <param name="reference" value="indexed" />
  102. <param name="input1" value="sam_pileup_in1.bam" ftype="bam" dbkey="equCab2" />
  103. <param name="lastCol" value="no" />
  104. <param name="indels" value="no" />
  105. <param name="mapCap" value="60" />
  106. <param name="consensus" value="yes" />
  107. <param name="theta" value="0.85" />
  108. <param name="hapNum" value="2" />
  109. <param name="fraction" value="0.001" />
  110. <param name="phredProb" value="40" />
  111. <output name="output1" file="sam_pileup_out2.pileup" />
  112. </test>
  113. </tests>
  114. <help>
  115. **What it does**
  116. Uses SAMTools_' pileup command to produce a pileup dataset from a provided BAM dataset. It generates two types of pileup datasets depending on the specified options. If *Call consensus according to MAQ model?* option is set to **No**, the tool produces simple pileup. If the option is set to **Yes**, a ten column pileup dataset with consensus is generated. Both types of datasets are briefly summarized below.
  117. .. _SAMTools: http://samtools.sourceforge.net/samtools.shtml
  118. ------
  119. **Types of pileup datasets**
  120. The description of pileup format below is largely based on information that can be found on SAMTools Pileup_ documentation page. The 6- and 10-column variants are described below.
  121. .. _Pileup: http://samtools.sourceforge.net/pileup.shtml
  122. **Six column pileup**::
  123. 1 2 3 4 5 6
  124. ---------------------------------
  125. chrM 412 A 2 ., II
  126. chrM 413 G 4 ..t, IIIH
  127. chrM 414 C 4 ...a III2
  128. chrM 415 C 4 TTTt III7
  129. where::
  130. Column Definition
  131. ------- ----------------------------
  132. 1 Chromosome
  133. 2 Position (1-based)
  134. 3 Reference base at that position
  135. 4 Coverage (# reads aligning over that position)
  136. 5 Bases within reads where (see Galaxy wiki for more info)
  137. 6 Quality values (phred33 scale, see Galaxy wiki for more)
  138. **Ten column pileup**
  139. The `ten-column` (consensus_) pileup incorporates additional consensus information generated with *-c* option of *samtools pileup* command::
  140. 1 2 3 4 5 6 7 8 9 10
  141. ------------------------------------------------
  142. chrM 412 A A 75 0 25 2 ., II
  143. chrM 413 G G 72 0 25 4 ..t, IIIH
  144. chrM 414 C C 75 0 25 4 ...a III2
  145. chrM 415 C T 75 75 25 4 TTTt III7
  146. where::
  147. Column Definition
  148. ------- --------------------------------------------------------
  149. 1 Chromosome
  150. 2 Position (1-based)
  151. 3 Reference base at that position
  152. 4 Consensus bases
  153. 5 Consensus quality
  154. 6 SNP quality
  155. 7 Maximum mapping quality
  156. 8 Coverage (# reads aligning over that position)
  157. 9 Bases within reads where (see Galaxy wiki for more info)
  158. 10 Quality values (phred33 scale, see Galaxy wiki for more)
  159. .. _consensus: http://samtools.sourceforge.net/cns0.shtml
  160. </help>
  161. </tool>