/tools/picard/picard_BamIndexStats.xml

https://bitbucket.org/cistrome/cistrome-harvard/ · XML · 117 lines · 76 code · 33 blank · 8 comment · 0 complexity · de7c4f86d909bdcbed209be39de766a6 MD5 · raw file

  1. <tool name="BAM Index Statistics" id="picard_BamIndexStats" version="0.2.0">
  2. <requirements><requirement type="package">picard</requirement></requirements>
  3. <command interpreter="python">
  4. picard_wrapper.py
  5. --input "$input_file"
  6. --bai-file "$input_file.metadata.bam_index"
  7. -t "$htmlfile"
  8. -d "$htmlfile.files_path"
  9. -j "${GALAXY_DATA_INDEX_DIR}/shared/jars/BamIndexStats.jar"
  10. </command>
  11. <inputs>
  12. <param format="bam" name="input_file" type="data" label="BAM dataset to generate statistics for"
  13. help="If empty, upload or import a BAM dataset" />
  14. </inputs>
  15. <outputs>
  16. <data format="html" name="htmlfile" label="${tool.name}_on_${on_string}.html" />
  17. </outputs>
  18. <tests>
  19. <test>
  20. <!-- Command
  21. java -jar BamIndexStats.jar I=test-data/picard_input_tiny_coord.bam > picard_BIS_output1.txt
  22. picard_input_tiny_coord.bam can be created from picard_input_tiny_coord.sam
  23. -->
  24. <param name="input_file" value="picard_input_tiny_coord.bam" ftype="bam" />
  25. <output name="htmlfile" file="picard_BIS_output1.txt" ftype="html" compare="contains" lines_diff="12"/>
  26. </test>
  27. <test>
  28. <!-- Command
  29. java -jar BamIndexStats.jar I=test-data/picard_BIS_input1.bam > picard_BIS_output2.txt
  30. picard_BIS_input1.bam can be created from picard_BIS_input1.sam
  31. -->
  32. <param name="input_file" value="picard_BIS_input1.bam" ftype="bam" />
  33. <output name="htmlfile" file="picard_BIS_output2.txt" ftype="html" compare="contains" lines_diff="12" />
  34. </test>
  35. </tests>
  36. <help>
  37. .. class:: infomark
  38. **Purpose**
  39. Generate Bam Index Stats for a provided BAM file.
  40. **Picard documentation**
  41. This is a Galaxy wrapper for BamIndexStats, a part of the external package Picard-tools_.
  42. .. _Picard-tools: http://www.google.com/search?q=picard+samtools
  43. ------
  44. .. class:: infomark
  45. **Inputs and outputs**
  46. The only input is the BAM file you wish to obtain statistics for, which is required.
  47. Note that it must be coordinate-sorted. Galaxy currently coordinate-sorts all BAM files.
  48. This tool outputs an HTML file that contains links to the actual metrics results, as well
  49. as a log file with info on the exact command run.
  50. .. class:: warningmark
  51. **Warning on SAM/BAM quality**
  52. Many SAM/BAM files produced externally and uploaded to Galaxy do not fully conform to SAM/BAM specifications. Galaxy deals with this by using the **LENIENT**
  53. flag when it runs Picard, which allows reads to be discarded if they're empty or don't map. This appears
  54. to be the only way to deal with SAM/BAM that cannot be parsed.
  55. ------
  56. **Example**
  57. Given a BAM file created from the following::
  58. @HD VN:1.0 SO:coordinate
  59. @SQ SN:chr1 LN:101
  60. @SQ SN:chr7 LN:404
  61. @SQ SN:chr8 LN:202
  62. @SQ SN:chr10 LN:303
  63. @SQ SN:chr14 LN:505
  64. @RG ID:0 SM:Hi,Mom!
  65. @RG ID:1 SM:samplesample DS:ClearDescription
  66. @PG ID:1 PN:Hey! VN:2.0
  67. @CO Just a generic comment to make the header longer
  68. read1 83 chr7 1 255 101M = 302 201 CAACAGAAGCNGGNATCTGTGTTTGTGTTTCGGATTTCCTGCTGAANNGNTTNTCGNNTCNNNNNNNNATCCCGATTTCNTTCCGCAGCTNACCTCCCAAN )'.*.+2,))II'I*/)-I*-)I.-)I)I),/-II..)./.,.).*II,I.II-)III0*IIIIIIII/32/,01460II/6/*0*/2/283//36868/I RG:Z:0
  69. read2 89 chr7 1 255 101M * 0 0 CAACAGAAGCNGGNATCTGTGTTTGTGTTTCGGATTTCCTGCTGAANNGNTTNTCGNNTCNNNNNNNNATCCCGATTTCNTTCCGCAGCTNACCTCCCAAN )'.*.+2,))II'I*/)-I*-)I.-)I)I),/-II..)./.,.).*II,I.II-)III0*IIIIIIII/32/,01460II/6/*0*/2/283//36868/I RG:Z:0
  70. read3 83 chr7 1 255 101M = 302 201 CAACAGAAGCNGGNATCTGTGTTTGTGTTTCGGATTTCCTGCTGAANNGNTTNTCGNNTCNNNNNNNNATCCCGATTTCNTTCCGCAGCTNACCTCCCAAN )'.*.+2,))II'I*/)-I*-)I.-)I)I),/-II..)./.,.).*II,I.II-)III0*IIIIIIII/32/,01460II/6/*0*/2/283//36868/I RG:Z:0
  71. read4 147 chr7 16 255 101M = 21 -96 CAACAGAAGCNGGNATCTGTGTTTGTGTTTCGGATTTCCTGCTGAANNGNTTNTCGNNTCNNNNNNNNATCCCGATTTCNTTCCGCAGCTNACCTCCCAAN )'.*.+2,))II'I*/)-I*-)I.-)I)I),/-II..)./.,.).*II,I.II-)III0*IIIIIIII/32/,01460II/6/*0*/2/283//36868/I RG:Z:0
  72. read5 99 chr7 21 255 101M = 16 96 CAACAGAAGCNGGNATCTGTGTTTGTGTTTCGGATTTCCTGCTGAANNGNTTNTCGNNTCNNNNNNNNATCCCGATTTCNTTCCGCAGCTNACCTCCCAAN )'.*.+2,))II'I*/)-I*-)I.-)I)I),/-II..)./.,.).*II,I.II-)III0*IIIIIIII/32/,01460II/6/*0*/2/283//36868/I RG:Z:0
  73. read6 163 chr7 302 255 101M = 1 -201 NCGCGGCATCNCGATTTCTTTCCGCAGCTAACCTCCCGACAGATCGGCAGCGCGTCGTGTAGGTTATTATGGTACATCTTGTCGTGCGGCNAGAGCATACA I/15445666651/566666553+2/14/I/555512+3/)-'/-I-'*+))*''13+3)'//++''/'))/3+I*5++)I'2+I+/*I-II*)I-./1'1 RG:Z:0
  74. read7 163 chr7 302 255 10M1D10M5I76M = 1 -201 NCGCGGCATCNCGATTTCTTTCCGCAGCTAACCTCCCGACAGATCGGCAGCGCGTCGTGTAGGTTATTATGGTACATCTTGTCGTGCGGCNAGAGCATACA I/15445666651/566666553+2/14/I/555512+3/)-'/-I-'*+))*''13+3)'//++''/'))/3+I*5++)I'2+I+/*I-II*)I-./1'1 RG:Z:0
  75. read8 165 * 0 0 * chr7 1 0 NCGCGGCATCNCGATTTCTTTCCGCAGCTAACCTCCCGACAGATCGGCAGCGCGTCGTGTAGGTTATTATGGTACATCTTGTCGTGCGGCNAGAGCATACA I/15445666651/566666553+2/14/I/555512+3/)-'/-I-'*+))*''13+3)'//++''/'))/3+I*5++)I'2+I+/*I-II*)I-./1'1 RG:Z:0
  76. The following metrics file will be produced::
  77. chr1 length= 101 Aligned= 0 Unaligned= 0
  78. chr7 length= 404 Aligned= 7 Unaligned= 0
  79. chr8 length= 202 Aligned= 0 Unaligned= 0
  80. chr10 length= 303 Aligned= 0 Unaligned= 0
  81. chr14 length= 505 Aligned= 0 Unaligned= 0
  82. NoCoordinateCount= 1
  83. </help>
  84. </tool>