/tools/samtools/sam2interval.xml

https://bitbucket.org/cistrome/cistrome-harvard/ · XML · 72 lines · 59 code · 13 blank · 0 comment · 0 complexity · 832445747648bd57c98072e6505cd8b1 MD5 · raw file

  1. <tool id="sam2interval" name="Convert SAM" version="1.0.1">
  2. <description>to interval</description>
  3. <command interpreter="python">sam2interval.py --input_sam_file=$input1 $print_all > $out_file1
  4. </command>
  5. <inputs>
  6. <param format="sam" name="input1" type="data" label="Select dataset to convert"/>
  7. <param name="print_all" type="select" label="Print all?" help="Do you want to retain original SAM fields? See example below.">
  8. <option value="-p">Yes</option>
  9. <option value="">No</option>
  10. </param>
  11. </inputs>
  12. <outputs>
  13. <data format="interval" name="out_file1" label="Converted Interval" />
  14. </outputs>
  15. <tests>
  16. <test>
  17. <param name="input1" value="sam_bioinf_example.sam" ftype="sam"/>
  18. <param name="print_all" value="Yes"/>
  19. <output name="out_file1" file="sam2interval_printAll.dat" ftype="interval"/>
  20. </test>
  21. <test>
  22. <param name="input1" value="sam_bioinf_example.sam" ftype="sam"/>
  23. <param name="print_all" value="No"/>
  24. <output name="out_file1" file="sam2interval_noprintAll.dat" ftype="interval"/>
  25. </test>
  26. <test>
  27. <param name="input1" value="sam2interval-test3.sam" ftype="sam"/>
  28. <param name="print_all" value="No"/>
  29. <output name="out_file1" file="sam2interval_with_unmapped_reads_noprintAll.dat" ftype="interval"/>
  30. </test>
  31. </tests>
  32. <help>
  33. **What it does**
  34. Converts positional information from a SAM dataset into interval format with 0-based start and 1-based end. CIGAR string of SAM format is used to compute the end coordinate.
  35. -----
  36. **Example**
  37. Converting the following dataset::
  38. r001 163 ref 7 30 8M2I4M1D3M = 37 39 TTAGATAAAGGATACTA *
  39. r002 0 ref 9 30 3S6M1P1I4M * 0 0 AAAAGATAAGGATA *
  40. r003 0 ref 9 30 5H6M * 0 0 AGCTAA * NM:i:1
  41. r004 0 ref 16 30 6M14N5M * 0 0 ATAGCTTCAGC *
  42. r003 16 ref 29 30 6H5M * 0 0 TAGGC * NM:i:0
  43. r001 83 ref 37 30 9M = 7 -39 CAGCGCCAT *
  44. into Interval format will produce the following if *Print all?* is set to **Yes**::
  45. ref 6 22 + r001 163 ref 7 30 8M2I4M1D3M = 37 39 TTAGATAAAGGATACTA *
  46. ref 8 19 + r002 0 ref 9 30 3S6M1P1I4M * 0 0 AAAAGATAAGGATA *
  47. ref 8 14 + r003 0 ref 9 30 5H6M * 0 0 AGCTAA * NM:i:1
  48. ref 15 40 + r004 0 ref 16 30 6M14N5M * 0 0 ATAGCTTCAGC *
  49. ref 28 33 - r003 16 ref 29 30 6H5M * 0 0 TAGGC * NM:i:0
  50. ref 36 45 - r001 83 ref 37 30 9M = 7 -39 CAGCGCCAT *
  51. Setting *Print all?* to **No** will generate the following::
  52. ref 6 22 + r001
  53. ref 8 19 + r002
  54. ref 8 14 + r003
  55. ref 15 40 + r004
  56. ref 28 33 - r003
  57. ref 36 45 - r001
  58. </help>
  59. </tool>