miga-base 0.3.0.0 → 0.3.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (260) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +21 -4
  3. data/actions/init.rb +258 -0
  4. data/actions/run_local.rb +1 -2
  5. data/actions/test_taxonomy.rb +4 -1
  6. data/bin/miga +8 -1
  7. data/lib/miga/dataset.rb +4 -4
  8. data/lib/miga/dataset_result.rb +7 -4
  9. data/lib/miga/version.rb +2 -2
  10. data/scripts/_distances_noref_nomulti.bash +3 -1
  11. data/scripts/clade_finding.bash +1 -1
  12. data/scripts/init.bash +1 -1
  13. data/scripts/miga.bash +1 -1
  14. data/scripts/mytaxa.bash +78 -72
  15. data/scripts/mytaxa_scan.bash +67 -62
  16. data/scripts/ogs.bash +1 -1
  17. data/scripts/trimmed_fasta.bash +4 -3
  18. data/utils/enveomics/Examples/aai-matrix.bash +66 -0
  19. data/utils/enveomics/Examples/ani-matrix.bash +66 -0
  20. data/utils/enveomics/Examples/essential-phylogeny.bash +105 -0
  21. data/utils/enveomics/Examples/unus-genome-phylogeny.bash +100 -0
  22. data/utils/enveomics/LICENSE.txt +73 -0
  23. data/utils/enveomics/Makefile +52 -0
  24. data/utils/enveomics/Manifest/Tasks/aasubs.json +103 -0
  25. data/utils/enveomics/Manifest/Tasks/blasttab.json +703 -0
  26. data/utils/enveomics/Manifest/Tasks/distances.json +161 -0
  27. data/utils/enveomics/Manifest/Tasks/fasta.json +571 -0
  28. data/utils/enveomics/Manifest/Tasks/fastq.json +208 -0
  29. data/utils/enveomics/Manifest/Tasks/graphics.json +126 -0
  30. data/utils/enveomics/Manifest/Tasks/ogs.json +339 -0
  31. data/utils/enveomics/Manifest/Tasks/other.json +746 -0
  32. data/utils/enveomics/Manifest/Tasks/remote.json +355 -0
  33. data/utils/enveomics/Manifest/Tasks/sequence-identity.json +454 -0
  34. data/utils/enveomics/Manifest/Tasks/tables.json +308 -0
  35. data/utils/enveomics/Manifest/Tasks/trees.json +68 -0
  36. data/utils/enveomics/Manifest/Tasks/variants.json +111 -0
  37. data/utils/enveomics/Manifest/categories.json +132 -0
  38. data/utils/enveomics/Manifest/examples.json +154 -0
  39. data/utils/enveomics/Manifest/tasks.json +4 -0
  40. data/utils/enveomics/Pipelines/assembly.pbs/CONFIG.mock.bash +69 -0
  41. data/utils/enveomics/Pipelines/assembly.pbs/FastA.N50.pl +56 -0
  42. data/utils/enveomics/Pipelines/assembly.pbs/FastA.filterN.pl +60 -0
  43. data/utils/enveomics/Pipelines/assembly.pbs/FastA.length.pl +38 -0
  44. data/utils/enveomics/Pipelines/assembly.pbs/README.md +189 -0
  45. data/utils/enveomics/Pipelines/assembly.pbs/RUNME-2.bash +112 -0
  46. data/utils/enveomics/Pipelines/assembly.pbs/RUNME-3.bash +23 -0
  47. data/utils/enveomics/Pipelines/assembly.pbs/RUNME-4.bash +44 -0
  48. data/utils/enveomics/Pipelines/assembly.pbs/RUNME.bash +50 -0
  49. data/utils/enveomics/Pipelines/assembly.pbs/kSelector.R +37 -0
  50. data/utils/enveomics/Pipelines/assembly.pbs/newbler.pbs +68 -0
  51. data/utils/enveomics/Pipelines/assembly.pbs/newbler_preparator.pl +49 -0
  52. data/utils/enveomics/Pipelines/assembly.pbs/soap.pbs +80 -0
  53. data/utils/enveomics/Pipelines/assembly.pbs/stats.pbs +57 -0
  54. data/utils/enveomics/Pipelines/assembly.pbs/velvet.pbs +63 -0
  55. data/utils/enveomics/Pipelines/blast.pbs/01.pbs.bash +38 -0
  56. data/utils/enveomics/Pipelines/blast.pbs/02.pbs.bash +73 -0
  57. data/utils/enveomics/Pipelines/blast.pbs/03.pbs.bash +21 -0
  58. data/utils/enveomics/Pipelines/blast.pbs/BlastTab.recover_job.pl +72 -0
  59. data/utils/enveomics/Pipelines/blast.pbs/CONFIG.mock.bash +98 -0
  60. data/utils/enveomics/Pipelines/blast.pbs/FastA.split.pl +55 -0
  61. data/utils/enveomics/Pipelines/blast.pbs/README.md +127 -0
  62. data/utils/enveomics/Pipelines/blast.pbs/RUNME.bash +109 -0
  63. data/utils/enveomics/Pipelines/blast.pbs/TASK.check.bash +128 -0
  64. data/utils/enveomics/Pipelines/blast.pbs/TASK.dry.bash +16 -0
  65. data/utils/enveomics/Pipelines/blast.pbs/TASK.eo.bash +22 -0
  66. data/utils/enveomics/Pipelines/blast.pbs/TASK.pause.bash +26 -0
  67. data/utils/enveomics/Pipelines/blast.pbs/TASK.run.bash +89 -0
  68. data/utils/enveomics/Pipelines/blast.pbs/sentinel.pbs.bash +29 -0
  69. data/utils/enveomics/Pipelines/idba.pbs/README.md +49 -0
  70. data/utils/enveomics/Pipelines/idba.pbs/RUNME.bash +95 -0
  71. data/utils/enveomics/Pipelines/idba.pbs/run.pbs +56 -0
  72. data/utils/enveomics/Pipelines/trim.pbs/README.md +54 -0
  73. data/utils/enveomics/Pipelines/trim.pbs/RUNME.bash +70 -0
  74. data/utils/enveomics/Pipelines/trim.pbs/run.pbs +130 -0
  75. data/utils/enveomics/README.md +40 -0
  76. data/utils/enveomics/Scripts/AAsubs.log2ratio.rb +171 -0
  77. data/utils/enveomics/Scripts/Aln.cat.rb +162 -0
  78. data/utils/enveomics/Scripts/Aln.convert.pl +35 -0
  79. data/utils/enveomics/Scripts/AlphaDiversity.pl +152 -0
  80. data/utils/enveomics/Scripts/BlastPairwise.AAsubs.pl +102 -0
  81. data/utils/enveomics/Scripts/BlastTab.addlen.rb +61 -0
  82. data/utils/enveomics/Scripts/BlastTab.advance.bash +48 -0
  83. data/utils/enveomics/Scripts/BlastTab.best_hit_sorted.pl +55 -0
  84. data/utils/enveomics/Scripts/BlastTab.catsbj.pl +106 -0
  85. data/utils/enveomics/Scripts/BlastTab.cogCat.rb +76 -0
  86. data/utils/enveomics/Scripts/BlastTab.filter.pl +47 -0
  87. data/utils/enveomics/Scripts/BlastTab.kegg_pep2path_rest.pl +194 -0
  88. data/utils/enveomics/Scripts/BlastTab.metaxaPrep.pl +104 -0
  89. data/utils/enveomics/Scripts/BlastTab.pairedHits.rb +157 -0
  90. data/utils/enveomics/Scripts/BlastTab.recplot2.R +40 -0
  91. data/utils/enveomics/Scripts/BlastTab.seqdepth.pl +86 -0
  92. data/utils/enveomics/Scripts/BlastTab.seqdepth_ZIP.pl +119 -0
  93. data/utils/enveomics/Scripts/BlastTab.seqdepth_nomedian.pl +86 -0
  94. data/utils/enveomics/Scripts/BlastTab.subsample.pl +47 -0
  95. data/utils/enveomics/Scripts/BlastTab.sumPerHit.pl +114 -0
  96. data/utils/enveomics/Scripts/BlastTab.taxid2taxrank.pl +90 -0
  97. data/utils/enveomics/Scripts/BlastTab.topHits_sorted.rb +101 -0
  98. data/utils/enveomics/Scripts/Chao1.pl +97 -0
  99. data/utils/enveomics/Scripts/CharTable.classify.rb +234 -0
  100. data/utils/enveomics/Scripts/EBIseq2tax.rb +83 -0
  101. data/utils/enveomics/Scripts/FastA.N50.pl +56 -0
  102. data/utils/enveomics/Scripts/FastA.filter.pl +52 -0
  103. data/utils/enveomics/Scripts/FastA.filterLen.pl +28 -0
  104. data/utils/enveomics/Scripts/FastA.filterN.pl +60 -0
  105. data/utils/enveomics/Scripts/FastA.fragment.rb +92 -0
  106. data/utils/enveomics/Scripts/FastA.gc.pl +42 -0
  107. data/utils/enveomics/Scripts/FastA.interpose.pl +87 -0
  108. data/utils/enveomics/Scripts/FastA.length.pl +38 -0
  109. data/utils/enveomics/Scripts/FastA.per_file.pl +36 -0
  110. data/utils/enveomics/Scripts/FastA.qlen.pl +57 -0
  111. data/utils/enveomics/Scripts/FastA.rename.pl +65 -0
  112. data/utils/enveomics/Scripts/FastA.revcom.pl +23 -0
  113. data/utils/enveomics/Scripts/FastA.slider.pl +85 -0
  114. data/utils/enveomics/Scripts/FastA.split.pl +55 -0
  115. data/utils/enveomics/Scripts/FastA.subsample.pl +131 -0
  116. data/utils/enveomics/Scripts/FastA.tag.rb +64 -0
  117. data/utils/enveomics/Scripts/FastA.wrap.rb +48 -0
  118. data/utils/enveomics/Scripts/FastQ.filter.pl +54 -0
  119. data/utils/enveomics/Scripts/FastQ.interpose.pl +90 -0
  120. data/utils/enveomics/Scripts/FastQ.offset.pl +90 -0
  121. data/utils/enveomics/Scripts/FastQ.split.pl +53 -0
  122. data/utils/enveomics/Scripts/FastQ.tag.rb +63 -0
  123. data/utils/enveomics/Scripts/FastQ.toFastA.awk +24 -0
  124. data/utils/enveomics/Scripts/GenBank.add_fields.rb +84 -0
  125. data/utils/enveomics/Scripts/HMM.essential.rb +254 -0
  126. data/utils/enveomics/Scripts/HMMsearch.extractIds.rb +83 -0
  127. data/utils/enveomics/Scripts/JPlace.distances.rb +88 -0
  128. data/utils/enveomics/Scripts/JPlace.to_iToL.rb +306 -0
  129. data/utils/enveomics/Scripts/M5nr.getSequences.rb +81 -0
  130. data/utils/enveomics/Scripts/MeTaxa.distribution.pl +198 -0
  131. data/utils/enveomics/Scripts/MyTaxa.fragsByTax.pl +35 -0
  132. data/utils/enveomics/Scripts/MyTaxa.seq-taxrank.rb +49 -0
  133. data/utils/enveomics/Scripts/NCBIacc2tax.rb +92 -0
  134. data/utils/enveomics/Scripts/Newick.autoprune.R +27 -0
  135. data/utils/enveomics/Scripts/RAxML-EPA.to_iToL.pl +228 -0
  136. data/utils/enveomics/Scripts/RefSeq.download.bash +48 -0
  137. data/utils/enveomics/Scripts/SRA.download.bash +50 -0
  138. data/utils/enveomics/Scripts/TRIBS.plot-test.R +36 -0
  139. data/utils/enveomics/Scripts/TRIBS.test.R +39 -0
  140. data/utils/enveomics/Scripts/Table.barplot.R +30 -0
  141. data/utils/enveomics/Scripts/Table.df2dist.R +30 -0
  142. data/utils/enveomics/Scripts/Table.filter.pl +61 -0
  143. data/utils/enveomics/Scripts/Table.merge.pl +77 -0
  144. data/utils/enveomics/Scripts/Table.replace.rb +69 -0
  145. data/utils/enveomics/Scripts/Table.round.rb +63 -0
  146. data/utils/enveomics/Scripts/Table.split.pl +57 -0
  147. data/utils/enveomics/Scripts/Taxonomy.silva2ncbi.rb +227 -0
  148. data/utils/enveomics/Scripts/VCF.KaKs.rb +147 -0
  149. data/utils/enveomics/Scripts/VCF.SNPs.rb +88 -0
  150. data/utils/enveomics/Scripts/aai.rb +373 -0
  151. data/utils/enveomics/Scripts/ani.rb +362 -0
  152. data/utils/enveomics/Scripts/gi2tax.rb +103 -0
  153. data/utils/enveomics/Scripts/in_silico_GA_GI.pl +96 -0
  154. data/utils/enveomics/Scripts/lib/data/essential.hmm.gz +0 -0
  155. data/utils/enveomics/Scripts/lib/enveomics_rb/enveomics.rb +26 -0
  156. data/utils/enveomics/Scripts/lib/enveomics_rb/jplace.rb +253 -0
  157. data/utils/enveomics/Scripts/lib/enveomics_rb/og.rb +182 -0
  158. data/utils/enveomics/Scripts/lib/enveomics_rb/remote_data.rb +74 -0
  159. data/utils/enveomics/Scripts/lib/enveomics_rb/seq_range.rb +237 -0
  160. data/utils/enveomics/Scripts/lib/enveomics_rb/stat.rb +30 -0
  161. data/utils/enveomics/Scripts/lib/enveomics_rb/vcf.rb +135 -0
  162. data/utils/enveomics/Scripts/ogs.annotate.rb +88 -0
  163. data/utils/enveomics/Scripts/ogs.core-pan.rb +160 -0
  164. data/utils/enveomics/Scripts/ogs.extract.rb +125 -0
  165. data/utils/enveomics/Scripts/ogs.mcl.rb +186 -0
  166. data/utils/enveomics/Scripts/ogs.rb +104 -0
  167. data/utils/enveomics/Scripts/ogs.stats.rb +131 -0
  168. data/utils/enveomics/Scripts/rbm.rb +137 -0
  169. data/utils/enveomics/Tests/Makefile +10 -0
  170. data/utils/enveomics/Tests/Mgen_M2288.faa +3189 -0
  171. data/utils/enveomics/Tests/Mgen_M2288.fna +8282 -0
  172. data/utils/enveomics/Tests/Mgen_M2321.fna +8288 -0
  173. data/utils/enveomics/Tests/Nequ_Kin4M.faa +2970 -0
  174. data/utils/enveomics/Tests/Xanthomonas_oryzae-PilA.tribs.Rdata +0 -0
  175. data/utils/enveomics/Tests/Xanthomonas_oryzae-PilA.txt +7 -0
  176. data/utils/enveomics/Tests/Xanthomonas_oryzae.aai-mat.tsv +17 -0
  177. data/utils/enveomics/Tests/Xanthomonas_oryzae.aai.tsv +137 -0
  178. data/utils/enveomics/Tests/a_mg.cds-go.blast.tsv +123 -0
  179. data/utils/enveomics/Tests/a_mg.reads-cds.blast.tsv +200 -0
  180. data/utils/enveomics/Tests/a_mg.reads-cds.counts.tsv +55 -0
  181. data/utils/enveomics/Tests/alkB.nwk +1 -0
  182. data/utils/enveomics/Tests/anthrax-cansnp-data.tsv +13 -0
  183. data/utils/enveomics/Tests/anthrax-cansnp-key.tsv +17 -0
  184. data/utils/enveomics/Tests/hiv1.faa +59 -0
  185. data/utils/enveomics/Tests/hiv1.fna +134 -0
  186. data/utils/enveomics/Tests/hiv2.faa +70 -0
  187. data/utils/enveomics/Tests/hiv_mix-hiv1.blast.tsv +233 -0
  188. data/utils/enveomics/Tests/hiv_mix-hiv1.blast.tsv.lim +1 -0
  189. data/utils/enveomics/Tests/hiv_mix-hiv1.blast.tsv.rec +233 -0
  190. data/utils/enveomics/Tests/phyla_counts.tsv +10 -0
  191. data/utils/enveomics/Tests/primate_lentivirus.ogs +11 -0
  192. data/utils/enveomics/Tests/primate_lentivirus.rbm/hiv1-hiv1.rbm +9 -0
  193. data/utils/enveomics/Tests/primate_lentivirus.rbm/hiv1-hiv2.rbm +8 -0
  194. data/utils/enveomics/Tests/primate_lentivirus.rbm/hiv1-siv.rbm +6 -0
  195. data/utils/enveomics/Tests/primate_lentivirus.rbm/hiv2-hiv2.rbm +9 -0
  196. data/utils/enveomics/Tests/primate_lentivirus.rbm/hiv2-siv.rbm +6 -0
  197. data/utils/enveomics/Tests/primate_lentivirus.rbm/siv-siv.rbm +6 -0
  198. data/utils/enveomics/build_enveomics_r.bash +44 -0
  199. data/utils/enveomics/enveomics.R/DESCRIPTION +31 -0
  200. data/utils/enveomics/enveomics.R/NAMESPACE +35 -0
  201. data/utils/enveomics/enveomics.R/R/autoprune.R +121 -0
  202. data/utils/enveomics/enveomics.R/R/barplot.R +165 -0
  203. data/utils/enveomics/enveomics.R/R/cliopts.R +119 -0
  204. data/utils/enveomics/enveomics.R/R/df2dist.R +117 -0
  205. data/utils/enveomics/enveomics.R/R/growthcurve.R +263 -0
  206. data/utils/enveomics/enveomics.R/R/recplot.R +320 -0
  207. data/utils/enveomics/enveomics.R/R/recplot2.R +745 -0
  208. data/utils/enveomics/enveomics.R/R/tribs.R +423 -0
  209. data/utils/enveomics/enveomics.R/R/utils.R +16 -0
  210. data/utils/enveomics/enveomics.R/README.md +52 -0
  211. data/utils/enveomics/enveomics.R/data/growth.curves.rda +0 -0
  212. data/utils/enveomics/enveomics.R/data/phyla.counts.rda +0 -0
  213. data/utils/enveomics/enveomics.R/man/enve.GrowthCurve-class.Rd +30 -0
  214. data/utils/enveomics/enveomics.R/man/enve.TRIBS-class.Rd +43 -0
  215. data/utils/enveomics/enveomics.R/man/enve.TRIBS.merge.Rd +19 -0
  216. data/utils/enveomics/enveomics.R/man/enve.TRIBStest-class.Rd +37 -0
  217. data/utils/enveomics/enveomics.R/man/enve.__prune.iter.Rd +24 -0
  218. data/utils/enveomics/enveomics.R/man/enve.__prune.reduce.Rd +24 -0
  219. data/utils/enveomics/enveomics.R/man/enve.__tribs.Rd +33 -0
  220. data/utils/enveomics/enveomics.R/man/enve.barplot.Rd +64 -0
  221. data/utils/enveomics/enveomics.R/man/enve.cliopts.Rd +37 -0
  222. data/utils/enveomics/enveomics.R/man/enve.col.alpha.Rd +19 -0
  223. data/utils/enveomics/enveomics.R/man/enve.col2alpha.Rd +18 -0
  224. data/utils/enveomics/enveomics.R/man/enve.df2dist.Rd +26 -0
  225. data/utils/enveomics/enveomics.R/man/enve.df2dist.group.Rd +25 -0
  226. data/utils/enveomics/enveomics.R/man/enve.df2dist.list.Rd +26 -0
  227. data/utils/enveomics/enveomics.R/man/enve.growthcurve.Rd +49 -0
  228. data/utils/enveomics/enveomics.R/man/enve.prune.dist.Rd +28 -0
  229. data/utils/enveomics/enveomics.R/man/enve.recplot.Rd +97 -0
  230. data/utils/enveomics/enveomics.R/man/enve.recplot2-class.Rd +40 -0
  231. data/utils/enveomics/enveomics.R/man/enve.recplot2.Rd +40 -0
  232. data/utils/enveomics/enveomics.R/man/enve.recplot2.__counts.Rd +24 -0
  233. data/utils/enveomics/enveomics.R/man/enve.recplot2.__findPeak.Rd +40 -0
  234. data/utils/enveomics/enveomics.R/man/enve.recplot2.__findPeaks.Rd +18 -0
  235. data/utils/enveomics/enveomics.R/man/enve.recplot2.__peakHist.Rd +22 -0
  236. data/utils/enveomics/enveomics.R/man/enve.recplot2.__whichClosestPeak.Rd +20 -0
  237. data/utils/enveomics/enveomics.R/man/enve.recplot2.changeCutoff.Rd +18 -0
  238. data/utils/enveomics/enveomics.R/man/enve.recplot2.corePeak.Rd +18 -0
  239. data/utils/enveomics/enveomics.R/man/enve.recplot2.extractWindows.Rd +27 -0
  240. data/utils/enveomics/enveomics.R/man/enve.recplot2.findPeaks.Rd +53 -0
  241. data/utils/enveomics/enveomics.R/man/enve.recplot2.peak-class.Rd +44 -0
  242. data/utils/enveomics/enveomics.R/man/enve.tribs.Rd +44 -0
  243. data/utils/enveomics/enveomics.R/man/enve.tribs.test.Rd +21 -0
  244. data/utils/enveomics/enveomics.R/man/enveomics.R-package.Rd +15 -0
  245. data/utils/enveomics/enveomics.R/man/growth.curves.Rd +14 -0
  246. data/utils/enveomics/enveomics.R/man/phyla.counts.Rd +13 -0
  247. data/utils/enveomics/enveomics.R/man/plot.enve.GrowthCurve.Rd +43 -0
  248. data/utils/enveomics/enveomics.R/man/plot.enve.TRIBS.Rd +29 -0
  249. data/utils/enveomics/enveomics.R/man/plot.enve.TRIBStest.Rd +30 -0
  250. data/utils/enveomics/enveomics.R/man/plot.enve.recplot2.Rd +71 -0
  251. data/utils/enveomics/enveomics.R/man/summary.enve.GrowthCurve.Rd +18 -0
  252. data/utils/enveomics/enveomics.R/man/summary.enve.TRIBS.Rd +18 -0
  253. data/utils/enveomics/enveomics.R/man/summary.enve.TRIBStest.Rd +18 -0
  254. data/utils/enveomics/enveomics.R/man/z$-methods.Rd +27 -0
  255. data/utils/enveomics/globals.mk +8 -0
  256. data/utils/enveomics/manifest.json +9 -0
  257. data/utils/index_metadata.rb +0 -0
  258. data/utils/plot-taxdist.R +0 -0
  259. data/utils/requirements.txt +19 -19
  260. metadata +242 -2
@@ -0,0 +1,128 @@
1
+ #!/bin/bash
2
+
3
+ ##################### RUN
4
+ # Check if it was sourced from RUNME.bash
5
+ if [[ "$PDIR" == "" ]] ; then
6
+ echo "$0: Error: This file is not stand-alone." >&2
7
+ echo " Execute RUNME.bash as described in the README.txt file" >&2
8
+ exit 1
9
+ fi
10
+
11
+ # Check if the project exists
12
+ if [[ ! -d "$SCRATCH" ]] ; then
13
+ echo "The project $PROJ doesn't exist at $SCRATCH_DIR." >&2
14
+ echo " Execute '$PDIR/RUNME.bash $PROJ run' first." >&2
15
+ exit 1
16
+ fi
17
+
18
+ # Get log:
19
+ echo "==[ Running tasks ]=="
20
+ for i in $(ls $SCRATCH/log/status/* 2>/dev/null) ; do
21
+ echo " $(basename $i): $(tail -n 1 $i)"
22
+ done
23
+ echo ""
24
+
25
+ # Get active jobs:
26
+ echo "==[ Active jobs ]=="
27
+ job_r=0
28
+ job_i=0
29
+ job_c=0
30
+ for i in $(ls $SCRATCH/log/active/* 2>/dev/null) ; do
31
+ jid=$(basename $i)
32
+ stat=$(qstat -f1 $jid 2>&1)
33
+ state=$(echo "$stat" | grep '^ *job_state = ' | sed -e 's/.*job_state = //')
34
+ case $state in
35
+ C)
36
+ code=$(echo "$stat" | grep '^ *exit_status = ' | sed -e 's/.*exit_status = //')
37
+ if [[ "$code" == "0" ]] ; then
38
+ mv "$i" "$SCRATCH/log/done/"
39
+ let job_c=$job_c+1
40
+ else
41
+ echo "Warning: Job $jid ($(cat $i|tr -d '\n')) failed with code $code." >&2
42
+ echo " see errors at: $(echo "$stat" | grep '^ *Error_Path = ' | sed -e 's/.*Error_Path = //')"
43
+ mv "$i" "$SCRATCH/log/failed/"
44
+ fi ;;
45
+ R)
46
+ echo " Running: $jid: $(cat "$i")"
47
+ let job_r=$job_r+1 ;;
48
+ [HQW])
49
+ echo " Idle: $jid: $(cat "$i")"
50
+ let job_i=$job_i+1 ;;
51
+ E)
52
+ echo " Canceling: $jid: $(cat "$i")" ;;
53
+ *)
54
+ tmp_err=$(echo "$stat" | grep ERROR)
55
+ if [[ "$tmp_err" == "" ]] ; then
56
+ echo "Warning: Unrecognized state: $jid: $state." >&2
57
+ echo " Please report this problem." >&2
58
+ else
59
+ echo " Error: $jid: $tmp_err"
60
+ fi ;;
61
+ esac
62
+ #subjobs=$(echo "$stat" | grep 'Sub-jobs:' | sed -e 's/.*: *//')
63
+ #if [[ "$subjobs" -gt 0 ]] ; then
64
+ # echo "$stat" | grep '^ *\(Sub-jobs\|Active\|Eligible\|Blocked\|Completed\):' | sed -e 's/^ *//' | sed -e 's/ *//' | tr '\n' ' ' | sed -e 's/^/ /'
65
+ # echo
66
+ #fi
67
+ done
68
+ if [[ $job_c -gt 0 ]] ; then
69
+ echo ""
70
+ echo " Completed since last check: $job_c."
71
+ fi
72
+ if [[ $job_r -gt 0 || $job_i -gt 0 ]] ; then
73
+ echo ""
74
+ echo " Running jobs: $job_r."
75
+ echo " Idle jobs: $job_i."
76
+ fi
77
+ echo ""
78
+
79
+ # Auto-trials
80
+ echo "==[ Auto-trials ]=="
81
+ if [[ -e "$SCRATCH/etc/trials" ]] ; then
82
+ trials=$(cat "$SCRATCH/etc/trials" | wc -l | sed -e 's/ //g')
83
+ if [[ $trials -gt 1 ]] ; then
84
+ echo " $trials trials attempted:"
85
+ else
86
+ echo " No recent failures in the current step, job launched:"
87
+ fi
88
+ cat "$SCRATCH/etc/trials" | sed -e 's/^/ o /' | sed -e 's/# $/No active trials\n/g'
89
+ fi
90
+ echo ""
91
+
92
+ # Step-specific checks:
93
+ echo "==[ Step summary ]=="
94
+ todo=1
95
+ if [[ -e "$SCRATCH/success/00" ]] ; then
96
+ echo " Successful project initialization."
97
+ if [[ -e "$SCRATCH/success/01" ]] ; then
98
+ echo " Successful input preparation."
99
+ if [[ -e "$SCRATCH/success/02" ]] ; then
100
+ echo " Successful BLAST execution."
101
+ if [[ -e "$SCRATCH/success/02" ]] ; then
102
+ echo " Successful concatenation."
103
+ echo " Project finished successfully!"
104
+ todo=0
105
+ else
106
+ echo " Concatenating results."
107
+ fi
108
+ else
109
+ echo " Running BLAST."
110
+ fi
111
+ else
112
+ echo " Preparing input."
113
+ fi
114
+ else
115
+ echo " Initializing project."
116
+ fi
117
+
118
+ if [[ "$todo" -eq 1 && $job_r -eq 0 && $job_i -eq 0 ]] ; then
119
+ echo " Job currently paused. To resume, execute:"
120
+ echo " $PDIR/RUNME.bash $PROJ run"
121
+ fi
122
+ echo
123
+
124
+ # Entire log
125
+ echo "==[ Complete log ]=="
126
+ for i in $(ls $SCRATCH/log/status/* 2>/dev/null) ; do
127
+ cat "$i" | sed -e "s/^/ $(basename $i): /"
128
+ done
@@ -0,0 +1,16 @@
1
+
2
+ [[ "$QUEUE" == "" ]] && echo "Undefined QUEUE" >&2 && exit 1;
3
+ [[ "$MAX_JOBS" == "" ]] && echo "Undefined MAX_JOBS" >&2 && exit 1;
4
+ [[ "$PPN" == "" ]] && echo "Undefined PPN" >&2 && exit 1;
5
+ [[ "$RAM" == "" ]] && echo "Undefined RAM" >&2 && exit 1;
6
+ [[ "$SCRATCH_DIR" == "" ]] && echo "Undefined SCRATCH_DIR" >&2 && exit 1;
7
+ [[ "$INPUT" == "" ]] && echo "Undefined INPUT" >&2 && exit 1;
8
+ [[ "$DB" == "" ]] && echo "Undefined DB" >&2 && exit 1;
9
+ [[ "$PROGRAM" == "" ]] && echo "Undefined PROGRAM" >&2 && exit 1;
10
+ [[ "$MAX_TRIALS" == "" ]] && echo "Undefined MAX_TRIALS" >&2 && exit 1;
11
+ [[ "$(type -t BEGIN)" == "function" ]] || ( echo "Undefined function BEGIN" && exit 1 ) ;
12
+ [[ "$(type -t BEFORE_BLAST)" == "function" ]] || ( echo "Undefined function BEFORE_BLAST" && exit 1 ) ;
13
+ [[ "$(type -t RUN_BLAST)" == "function" ]] || ( echo "Undefined function RUN_BLAST" && exit 1 ) ;
14
+ [[ "$(type -t AFTER_BLAST)" == "function" ]] || ( echo "Undefined function AFTER_BLAST" && exit 1 ) ;
15
+ [[ "$(type -t END)" == "function" ]] || ( echo "Undefined function END" && exit 1 ) ;
16
+
@@ -0,0 +1,22 @@
1
+ #!/bin/bash
2
+
3
+ ##################### RUN
4
+ # Check if it was sourced from RUNME.bash
5
+ if [[ "$PDIR" == "" ]] ; then
6
+ echo "$0: Error: This file is not stand-alone." >&2
7
+ echo " Execute RUNME.bash as described in the README.txt file" >&2 ;
8
+ exit 1 ;
9
+ fi ;
10
+
11
+ # Check if the project exists
12
+ if [[ ! -d "$SCRATCH" ]] ; then
13
+ echo "The project $PROJ doesn't exist at $SCRATCH_DIR." >&2 ;
14
+ echo " Execute '$PDIR/RUNME.bash $PROJ run' first." >&2 ;
15
+ exit 1 ;
16
+ fi ;
17
+
18
+ # Review errors
19
+ (echo -e "==[ Last 10 lines of all e files ]==\nPress q to exit\n" ; tail -n 10 $SCRATCH/log/eo/*.e* ) | less
20
+ # Review output
21
+ (echo -e "==[ Last 100 lines of all o files ]==\nPress q to exit\n" ; tail -n 100 $SCRATCH/log/eo/*.o* ) | less
22
+
@@ -0,0 +1,26 @@
1
+ #!/bin/bash
2
+
3
+ ##################### RUN
4
+ # Check if it was sourced from RUNME.bash
5
+ if [[ "$PDIR" == "" ]] ; then
6
+ echo "$0: Error: This file is not stand-alone." >&2
7
+ echo " Execute RUNME.bash as described in the README.txt file" >&2 ;
8
+ exit 1 ;
9
+ fi ;
10
+
11
+ # Get active jobs:
12
+ echo "======[ check ]======"
13
+ job_r=0;
14
+ job_i=0;
15
+ job_c=0;
16
+
17
+ echo "======[ pause ]======"
18
+ for i in $(ls $SCRATCH/log/active/* 2>/dev/null) ; do
19
+ echo " Pausing $jid." ;
20
+ jid=$(basename $i) ;
21
+ qdel $jid ;
22
+ done ;
23
+
24
+ # Restart auto-trials
25
+ echo -n > "$SCRATCH/etc/trials" ;
26
+
@@ -0,0 +1,89 @@
1
+ #!/bin/bash
2
+
3
+ ##################### RUN
4
+ # Check if it was sourced from RUNME.bash
5
+ if [[ "$PDIR" == "" ]] ; then
6
+ echo "$0: Error: This file is not stand-alone. Execute RUNME.bash as described in the README.txt file" >&2
7
+ exit 1
8
+ fi
9
+
10
+ # Check if too many auto-trials were attempted
11
+ trials=0 ;
12
+ if [[ -e "$SCRATCH/etc/trials" ]] ; then
13
+ trials=$(cat "$SCRATCH/etc/trials" | wc -l | sed -e 's/ //g');
14
+ if [[ $trials -ge $MAX_TRIALS ]] ; then
15
+ echo "The maximum number of trials was already attempted, halting." >&2 ;
16
+ exit 1 ;
17
+ fi ;
18
+ fi ;
19
+
20
+ # Create the scratch directory
21
+ if [[ ! -d "$SCRATCH" ]] ; then mkdir -p "$SCRATCH" || exit 1 ; fi;
22
+
23
+ if [[ ! -e "$SCRATCH/success/00" ]] ; then
24
+ # 00. Initialize the project
25
+ echo "00. Initializing project." >&2 ;
26
+ mkdir -p "$SCRATCH/tmp" "$SCRATCH/etc" "$SCRATCH/results" "$SCRATCH/success" || exit 1 ;
27
+ mkdir -p "$SCRATCH/log/active" "$SCRATCH/log/done" "$SCRATCH/log/failed" || exit 1 ;
28
+ mkdir -p "$SCRATCH/log/status" "$SCRATCH/log/eo" || exit 1 ;
29
+ echo "Preparing structure." >> "$SCRATCH/log/status/00" ;
30
+ # Build 01.bash
31
+ echo "NEW_JOBID=\$(qsub -q '$QUEUE' -l 'walltime=$MAX_H:00:00,mem=$RAM' -v '$MINVARS' -N '$PROJ-01' \\
32
+ '$PDIR/01.pbs.bash'|tr -d '\\n')" \
33
+ > "$SCRATCH/etc/01.bash" || exit 1 ;
34
+ echo "SENTINEL_JOBID=\$(qsub -q '$QUEUE' -l 'walltime=2:00:00' -W \"depend=afterany:\$NEW_JOBID\" \\
35
+ -v \"$MINVARS,STEP=01,AFTERJOB=\$NEW_JOBID\" -N '$PROJ-01-sentinel' '$PDIR/sentinel.pbs.bash'|tr -d '\\n')" \
36
+ >> "$SCRATCH/etc/01.bash" || exit 1 ;
37
+ # Build 02.bash
38
+ echo "NEW_JOBID=\$(qsub -q '$QUEUE' -l 'walltime=$MAX_H:00:00,mem=$RAM,nodes=1:ppn=$PPN' \\
39
+ -v '$MINVARS' -N '$PROJ-02' -t '1-$MAX_JOBS' '$PDIR/02.pbs.bash'|tr -d '\\n')" \
40
+ > "$SCRATCH/etc/02.bash" \
41
+ || exit 1 ;
42
+ echo "SENTINEL_JOBID=\$(qsub -q '$QUEUE' -l 'walltime=2:00:00' -W \"depend=afteranyarray:\$NEW_JOBID\" \\
43
+ -v \"$MINVARS,STEP=02,AFTERJOB=\$NEW_JOBID\" -N '$PROJ-02-sentinel' '$PDIR/sentinel.pbs.bash'|tr -d '\\n')" \
44
+ >> "$SCRATCH/etc/02.bash" \
45
+ || exit 1 ;
46
+ # Build 03.bash
47
+ echo "NEW_JOBID=\$(qsub -q '$QUEUE' -l 'walltime=$MAX_H:00:00,mem=$RAM' -v '$MINVARS' -N '$PROJ-03' \\
48
+ '$PDIR/03.pbs.bash'|tr -d '\\n')" \
49
+ > "$SCRATCH/etc/03.bash" || exit 1 ;
50
+ echo "SENTINEL_JOBID=\$(qsub -q '$QUEUE' -l 'walltime=2:00:00' -W \"depend=afterany:\$NEW_JOBID\" \\
51
+ -v \"$MINVARS,STEP=03,AFTERJOB=\$NEW_JOBID\" -N '$PROJ-03-sentinel' '$PDIR/sentinel.pbs.bash'|tr -d '\\n')" \
52
+ >> "$SCRATCH/etc/03.bash" || exit 1 ;
53
+
54
+ JOB_DONE "00" ;
55
+ fi ;
56
+
57
+ if [[ ! -e "$SCRATCH/success/01" ]] ; then
58
+ # 01. Preparing input
59
+ echo "01. Preparing input." >&2 ;
60
+ JOB01=$(LAUNCH_JOB "01" "00" "Preparing input files" "$SCRATCH/etc/01.bash") ;
61
+ echo " New job: $JOB01." >&2 ;
62
+ else
63
+ if [[ ! -e "$SCRATCH/success/02" ]] ; then
64
+ # 02. Launching BLAST
65
+ echo "02. Launching BLAST." >&2 ;
66
+ JOB02=$(LAUNCH_JOB "02" "00" "Running BLAST" "$SCRATCH/etc/02.bash") ;
67
+ echo " New job: $JOB02." >&2 ;
68
+ # Clean on resubmission
69
+ cleaned=0
70
+ echo -n " Cleaning completed sub-jobs on $JOB02: " >&2 ;
71
+ for jobi in $(seq 1 $MAX_JOBS) ; do
72
+ if [[ -e "$SCRATCH/success/02.$jobi" ]] ; then
73
+ qdel "$JOB02""[$jobi]" &> /dev/null ;
74
+ let cleaned=$cleaned+1 ;
75
+ fi ;
76
+ done ;
77
+ echo "$cleaned sub-jobs completed." >&2 ;
78
+ else
79
+ if [[ ! -e "$SCRATCH/success/03" ]] ; then
80
+ # 03. Finalize
81
+ echo "03. Finalizing." >&2 ;
82
+ JOB03=$(LAUNCH_JOB "03" "00" "Concatenating results" "$SCRATCH/etc/03.bash") ;
83
+ echo " New job: $JOB03." >&2 ;
84
+ else
85
+ echo "Project complete, nothing to run." ;
86
+ fi ;
87
+ fi ;
88
+ fi ;
89
+
@@ -0,0 +1,29 @@
1
+ # blast.pbs pipeline
2
+ # Sentinel script
3
+
4
+ echo "Sentinel script after $AFTERJOB" ;
5
+
6
+ # Step-specific checks
7
+ if [[ "$STEP" == "02" ]] ; then
8
+ # Read configuration
9
+ cd $SCRATCH ;
10
+ TASK="dry" ;
11
+ source "$PDIR/RUNME.bash" ;
12
+
13
+ # Check tasks
14
+ INCOMPLETE=0;
15
+ for i in $(seq 1 $MAX_JOBS) ; do
16
+ if [[ ! -e "$SCRATCH/success/02.$i" ]] ; then
17
+ let INCOMPLETE=$INCOMPLETE+1 ;
18
+ fi ;
19
+ done
20
+ if [[ $INCOMPLETE -eq 0 ]] ; then
21
+ JOB_DONE "02" ;
22
+ else
23
+ echo "$INCOMPLETE incomplete jobs, re-launching step 02." ;
24
+ fi ;
25
+ fi
26
+
27
+ # Continue the workflow
28
+ "$PDIR/RUNME.bash" "$PROJ" run || exit 1 ;
29
+
@@ -0,0 +1,49 @@
1
+ @author: Luis Miguel Rodriguez-R <lmrodriguezr at gmail dot com>
2
+
3
+ @update: Feb-26-2015
4
+
5
+ @license: artistic 2.0
6
+
7
+ @status: auto
8
+
9
+ @pbs: yes
10
+
11
+ # IMPORTANT
12
+
13
+ This pipeline was developed for the [PACE cluster](http://pace.gatech.edu/). You
14
+ are free to use it in other platforms with adequate adjustments.
15
+
16
+ # PURPOSE
17
+
18
+ Performs assembly using IDBA-UD, designed for Single-Cell Genomics and Metagenomics.
19
+
20
+ # HELP
21
+
22
+ 1. Files preparation:
23
+
24
+ 1.1. Obtain the enveomics package in the cluster. You can use:
25
+ `git clone https://github.com/lmrodriguezr/enveomics.git`
26
+
27
+ 1.2. Prepare the trimmed reads (e.g., use trim.bs) in interposed FastA format. Files
28
+ must be raw, not zipped or packaged. Filenames must conform the format:
29
+ <name>.CoupledReads.fa, where <name> is the name of the sample. Locate all the
30
+ files within a folder named 04.trimmed_fasta, within your project folder. If you
31
+ used trim.pbs, no further action is necessary.
32
+
33
+ 2. Pipeline execution:
34
+
35
+ 2.1. Simply execute `./RUNME.bash <dir> <data_type>`, where `<dir>` is the folder containing
36
+ the 04.trimmed_fasta folder, and `<data_type>` is a supported type of data (see help
37
+ message running `./RUNME.bash` without arguments).
38
+
39
+ 3. What to expect:
40
+
41
+ By the end of the run, you should find the folder *05.assembly*, including the following
42
+ files for each dataset:
43
+
44
+ 3.1. `<dataset>`: The IDBA output folder.
45
+
46
+ 3.2. `<dataset>.AllContigs.fna`: All contigs longer than 200bp in FastA format.
47
+
48
+ 3.2. `<dataset>.LargeContigs.fna`: Contigs longer than 500bp in FastA format.
49
+
@@ -0,0 +1,95 @@
1
+ #!/bin/bash
2
+
3
+ if [[ "$1" == "" || "$1" == "-h" || "$2" == "" ]] ; then
4
+ echo "
5
+ Usage: ./RUNME.bash folder data_type [max_jobs]
6
+
7
+ folder Path to the folder containing the 04.trimmed_fasta folder. The
8
+ trimmed reads must be in interposed FastA format, and filenames
9
+ must follow the format: <name>.CoupledReads.fa, where <name> is
10
+ the name of the sample. If non-paired, the filenames must follow
11
+ the format: <name>.SingleReads.fa. If both suffixes are found
12
+ for the same <name> prefix, they are both used.
13
+ data_type Type of datasets in the project. One of: mg (for metagenomes),
14
+ scg (for single-cell genomes), g (for traditional genomes), or t
15
+ (for transcriptomes).
16
+ max_jobs (optional) Maximum number of jobs to run in parallel. This
17
+ number can be increased, but bear in mind that this process is
18
+ highly I/O-intensive, and likely to crash or significantly slow
19
+ down the hard drive if many jobs are running simultaneously. By
20
+ default: 5.
21
+ " >&2
22
+ exit 1
23
+ fi
24
+ TYPE=$2
25
+ if [[ "$TYPE" != "g" && "$TYPE" != "mg" && "$TYPE" != "scg" \
26
+ && "$TYPE" != "t" ]] ; then
27
+ echo "Unsupported data type: $TYPE." >&2
28
+ exit 1
29
+ fi
30
+ if [[ "$3" == "" ]] ; then
31
+ MAX=5
32
+ else
33
+ let MAX=$3+0
34
+ fi
35
+
36
+ dir=$(readlink -f $1)
37
+ pac=$(dirname $(readlink -f $0))
38
+ cwd=$(pwd)
39
+
40
+ cd $dir
41
+ if [[ ! -e 04.trimmed_fasta ]] ; then
42
+ echo "Cannot locate the 04.trimmed_fasta directory, aborting..." >&2
43
+ exit 1
44
+ fi
45
+ for i in 05.assembly ; do
46
+ [[ -d $i ]] || mkdir $i
47
+ done
48
+
49
+ k=0
50
+ for i in $dir/04.trimmed_fasta/*.SingleReads.fa ; do
51
+ b=$(basename $i .SingleReads.fa)
52
+ touch $dir/04.trimmed_fasta/$b.CoupledReads.fa
53
+ done
54
+
55
+ for i in $dir/04.trimmed_fasta/*.CoupledReads.fa ; do
56
+ b=$(basename $i .CoupledReads.fa)
57
+ [[ -d $dir/05.assembly/$b ]] && continue
58
+ EXTRA=""
59
+ EXTRA_MSG=""
60
+ if [[ $k -ge $MAX ]] ; then
61
+ let prek=$k-$MAX
62
+ EXTRA="-W depend=afterany:${jids[$prek]}"
63
+ EXTRA_MSG=" (waiting for ${jids[$prek]})"
64
+ fi
65
+
66
+ # Predict time (in hours)
67
+ SIZE_M=$(($(ls -pl 04.trimmed_fasta/$b.CoupledReads.fa \
68
+ | awk '{print $5}')/1000000))
69
+ let TIME_H=6+$SIZE_M*2/1000
70
+ let RAM_G=20+$SIZE_M*20/1000
71
+
72
+ # Find the right queue
73
+ if [[ $TIME_H -lt 12 ]] ; then
74
+ QUEUE="-q iw-shared-6 -l walltime=12:00:00"
75
+ elif [[ $TIME_H -lt 120 ]] ; then
76
+ QUEUE="-q microcluster -l walltime=120:00:00"
77
+ else
78
+ QUEUE="-q microcluster -l walltime=2000:00:00"
79
+ fi
80
+
81
+ # Launch job
82
+ mkdir $dir/05.assembly/$b
83
+ OPTS="SAMPLE=$b,FOLDER=$dir,TYPE=$TYPE"
84
+ if [[ -s $dir/04.trimmed_fasta/$b.SingleReads.fa ]] ; then
85
+ OPTS="$OPTS,FA=$dir/04.trimmed_fasta/$b.SingleReads.fa"
86
+ [[ -s $dir/04.trimmed_fasta/$b.CoupledReads.fa ]] \
87
+ && OPTS="$OPTS,FA_RL2=$dir/04.trimmed_fasta/$b.CoupledReads.fa"
88
+ else
89
+ OPTS="$OPTS,FA=$dir/04.trimmed_fasta/$b.CoupledReads.fa"
90
+ fi
91
+ jids[$k]=$(qsub -v "$OPTS" -N "IDBA-$b" -l "mem=${RAM_G}g" \
92
+ $QUEUE $EXTRA $pac/run.pbs | grep .)
93
+ echo "$b: ${jids[$k]}$EXTRA_MSG"
94
+ let k=$k+1
95
+ done