PageRenderTime 28ms CodeModel.GetById 12ms RepoModel.GetById 1ms app.codeStats 0ms

/tools/sr_mapping/mosaik.xml

https://bitbucket.org/cistrome/cistrome-harvard/
XML | 126 lines | 126 code | 0 blank | 0 comment | 0 complexity | 2fb53425ff3f218f503f81b884f2e100 MD5 | raw file
  1. <?xml version="1.0"?>
  2. <tool id="mosaik_wrapper" name="Map with Mosaik" version="1.1.2">
  3. <description/>
  4. <requirements>
  5. <requirement type="package" version="1.1.0021">mosaik</requirement>
  6. <requirement type="package" version="0.1.18">samtools</requirement>
  7. </requirements>
  8. <version_command>MosaikAligner | sed -e 's/\x1b\[[[:digit:]]\{1,2\}\(;[[:digit:]]\{1,2\}\)\{0,1\}m//g' | grep -o 'MosaikAligner [[:digit:].]\{1,\}'</version_command>
  9. <command>
  10. #set $processors = '-p ${GALAXY_SLOTS:-4}'
  11. MosaikBuild -fr
  12. #if $genomeSource.refGenomeSource == 'indexed':
  13. ${genomeSource.indexReference.fields.path}
  14. #else:
  15. ${genomeSource.historyReference}
  16. #end if
  17. -oa mosaik_ref_file;
  18. MosaikBuild -q $reads
  19. #if $paired.kind == 'single'
  20. #set $ls_string = ''
  21. #else
  22. -q2 ${paired.reads2}
  23. -mfl ${paired.mfl}
  24. #set $ls_string = '-ls %s' % $paired.ls
  25. #end if
  26. -st $st -out mosaik_reads_file;
  27. MosaikAligner -ia mosaik_ref_file -in mosaik_reads_file -out mosaik_aligned_file $ls_string -mm $mm -mhp $mhp -act $act -bw $bw $processors -hs 15;
  28. MosaikText -in mosaik_aligned_file -$outFormat sam_bam_file;
  29. #if str($outFormat) == 'bam':
  30. samtools sort sam_bam_file sorted_bam;
  31. mv sorted_bam.bam $output
  32. #else:
  33. gunzip sam_bam_file.gz;
  34. mv sam_bam_file $output
  35. #end if
  36. </command>
  37. <inputs>
  38. <conditional name="genomeSource">
  39. <param name="refGenomeSource" type="select" label="Will you select a reference genome from your history or use a built-in index?">
  40. <option value="indexed">Use a built-in index</option>
  41. <option value="history">Use one from the history</option>
  42. </param>
  43. <when value="indexed">
  44. <param name="indexReference" type="select" label="Select a reference genome">
  45. <options from_data_table="mosaik_indexes">
  46. <filter type="sort_by" column="2"/>
  47. <validator type="no_options" message="No indexes are available" />
  48. </options>
  49. </param>
  50. </when>
  51. <when value="history">
  52. <param format="fasta" name="historyReference" type="data" metadata_name="dbkey" label="Select a reference from history"/>
  53. </when>
  54. </conditional>
  55. <param format="fastq" name="reads" type="data" label="FASTQ reads file" />
  56. <param name="outFormat" type="select" label="Output format">
  57. <option value="sam">SAM</option>
  58. <option value="bam">BAM</option>
  59. </param>
  60. <param name="st" type="select" label="Sequencing technology used">
  61. <option value="454">454</option>
  62. <option value="illumina">Illumina</option>
  63. <option value="solid">Solid</option>
  64. <option value="sanger">Sanger</option>
  65. <option value="helicos">Helicos</option>
  66. </param>
  67. <conditional name="paired">
  68. <param name="kind" type="select" label="Is this library mate-paired?">
  69. <option value="single">Single-end</option>
  70. <option value="paired">Paired-end</option>
  71. </param>
  72. <when value="single"/>
  73. <when value="paired">
  74. <param format="fastq" name="reads2" type="data" label="FASTQ 2nd mate" />
  75. <param name="mfl" type="integer" value="200" label="Median fragment length" />
  76. <param name="ls" type="integer" min="0" value="50" label="Local alignment search radius to rescue mates" help="A large value slows down performances" />
  77. </when>
  78. </conditional>
  79. <param name="mm" type="integer" value="6" label="Number of mismatches allowed per sequence" />
  80. <param name="act" type="integer" value="35" label="Alignment candidate threshold" help="Determines which hash regions will be aligned with Smith-Waterman" />
  81. <param name="bw" type="integer" value="9" label="Smith-Waterman band width" />
  82. <param name="mhp" type="integer" value="100" label="Maximum number of positions stored per seed" help="Number of places in the reference the aligner will try to place a particular hash" />
  83. </inputs>
  84. <outputs>
  85. <data format="sam" name="output">
  86. <change_format>
  87. <when input="outFormat" value="bam" format="bam" />
  88. </change_format>
  89. <actions>
  90. <conditional name="genomeSource.refGenomeSource">
  91. <when value="indexed">
  92. <action type="metadata" name="dbkey">
  93. <option type="from_data_table" name="mosaik_indexes" column="1">
  94. <filter type="param_value" column="0" value="#" compare="startswith" keep="False" />
  95. <filter type="param_value" ref="genomeSource.indexReference" column="0" />
  96. </option>
  97. </action>
  98. </when>
  99. <when value="history">
  100. <action type="metadata" name="dbkey">
  101. <option type="from_param" name="genomeSource.historyReference" param_attribute="dbkey" />
  102. </action>
  103. </when>
  104. </conditional>
  105. </actions>
  106. </data>
  107. </outputs>
  108. <tests>
  109. <test>
  110. <param name="refGenomeSource" value="history"/>
  111. <param name="historyReference" ftype="fasta" value="mosaik_test_ref.fasta"/>
  112. <param name="reads" ftype="fastq" value="mosaik_test_input.fastq"/>
  113. <param name="outFormat" value="sam"/>
  114. <param name="st" value="454"/>
  115. <param name="kind" value="single"/>
  116. <param name="mm" value="6"/>
  117. <param name="act" value="35"/>
  118. <param name="bw" value="19"/>
  119. <param name="mhp" value="100"/>
  120. <output name="output" file="mosaik_test_out.sam" compare="sim_size" delta="0"/>
  121. </test>
  122. </tests>
  123. <help>
  124. This tool uses Mosaik to align reads to a reference sequence.
  125. </help>
  126. </tool>