miga-base 0.4.3.0 → 0.5.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/miga/cli.rb +43 -223
  4. data/lib/miga/cli/action/add.rb +91 -62
  5. data/lib/miga/cli/action/classify_wf.rb +97 -0
  6. data/lib/miga/cli/action/daemon.rb +14 -10
  7. data/lib/miga/cli/action/derep_wf.rb +95 -0
  8. data/lib/miga/cli/action/doctor.rb +83 -55
  9. data/lib/miga/cli/action/get.rb +68 -52
  10. data/lib/miga/cli/action/get_db.rb +206 -0
  11. data/lib/miga/cli/action/index_wf.rb +31 -0
  12. data/lib/miga/cli/action/init.rb +115 -190
  13. data/lib/miga/cli/action/init/daemon_helper.rb +124 -0
  14. data/lib/miga/cli/action/ls.rb +20 -11
  15. data/lib/miga/cli/action/ncbi_get.rb +199 -157
  16. data/lib/miga/cli/action/preproc_wf.rb +46 -0
  17. data/lib/miga/cli/action/quality_wf.rb +45 -0
  18. data/lib/miga/cli/action/stats.rb +147 -99
  19. data/lib/miga/cli/action/summary.rb +10 -4
  20. data/lib/miga/cli/action/tax_dist.rb +61 -46
  21. data/lib/miga/cli/action/tax_test.rb +46 -39
  22. data/lib/miga/cli/action/wf.rb +178 -0
  23. data/lib/miga/cli/base.rb +11 -0
  24. data/lib/miga/cli/objects_helper.rb +88 -0
  25. data/lib/miga/cli/opt_helper.rb +160 -0
  26. data/lib/miga/daemon.rb +7 -4
  27. data/lib/miga/dataset/base.rb +5 -5
  28. data/lib/miga/project/base.rb +4 -4
  29. data/lib/miga/project/result.rb +2 -1
  30. data/lib/miga/remote_dataset/base.rb +5 -5
  31. data/lib/miga/remote_dataset/download.rb +1 -1
  32. data/lib/miga/version.rb +3 -3
  33. data/scripts/cds.bash +3 -1
  34. data/scripts/essential_genes.bash +1 -0
  35. data/scripts/stats.bash +1 -1
  36. data/scripts/trimmed_fasta.bash +5 -3
  37. data/utils/distance/runner.rb +3 -0
  38. data/utils/distance/temporal.rb +10 -1
  39. data/utils/enveomics/Manifest/Tasks/fasta.json +5 -0
  40. data/utils/enveomics/Manifest/Tasks/sequence-identity.json +7 -0
  41. data/utils/enveomics/Scripts/BlastTab.addlen.rb +33 -31
  42. data/utils/enveomics/Scripts/FastA.tag.rb +42 -41
  43. data/utils/enveomics/Scripts/HMM.essential.rb +85 -55
  44. data/utils/enveomics/Scripts/HMM.haai.rb +29 -20
  45. data/utils/enveomics/Scripts/SRA.download.bash +1 -1
  46. data/utils/enveomics/Scripts/aai.rb +163 -128
  47. data/utils/enveomics/build_enveomics_r.bash +11 -10
  48. data/utils/enveomics/enveomics.R/DESCRIPTION +3 -2
  49. data/utils/enveomics/enveomics.R/R/autoprune.R +141 -107
  50. data/utils/enveomics/enveomics.R/R/barplot.R +105 -86
  51. data/utils/enveomics/enveomics.R/R/cliopts.R +131 -115
  52. data/utils/enveomics/enveomics.R/R/df2dist.R +144 -106
  53. data/utils/enveomics/enveomics.R/R/growthcurve.R +201 -133
  54. data/utils/enveomics/enveomics.R/R/recplot.R +350 -315
  55. data/utils/enveomics/enveomics.R/R/recplot2.R +1334 -914
  56. data/utils/enveomics/enveomics.R/R/tribs.R +521 -361
  57. data/utils/enveomics/enveomics.R/R/utils.R +31 -15
  58. data/utils/enveomics/enveomics.R/README.md +7 -0
  59. data/utils/enveomics/enveomics.R/man/cash-enve.GrowthCurve-method.Rd +17 -0
  60. data/utils/enveomics/enveomics.R/man/cash-enve.RecPlot2-method.Rd +17 -0
  61. data/utils/enveomics/enveomics.R/man/cash-enve.RecPlot2.Peak-method.Rd +17 -0
  62. data/utils/enveomics/enveomics.R/man/enve.GrowthCurve-class.Rd +16 -21
  63. data/utils/enveomics/enveomics.R/man/enve.TRIBS-class.Rd +31 -28
  64. data/utils/enveomics/enveomics.R/man/enve.TRIBS.merge.Rd +23 -19
  65. data/utils/enveomics/enveomics.R/man/enve.TRIBStest-class.Rd +36 -26
  66. data/utils/enveomics/enveomics.R/man/enve.__prune.iter.Rd +23 -24
  67. data/utils/enveomics/enveomics.R/man/enve.__prune.reduce.Rd +23 -24
  68. data/utils/enveomics/enveomics.R/man/enve.__tribs.Rd +32 -33
  69. data/utils/enveomics/enveomics.R/man/enve.barplot.Rd +91 -64
  70. data/utils/enveomics/enveomics.R/man/enve.cliopts.Rd +57 -37
  71. data/utils/enveomics/enveomics.R/man/enve.col.alpha.Rd +24 -19
  72. data/utils/enveomics/enveomics.R/man/enve.col2alpha.Rd +19 -18
  73. data/utils/enveomics/enveomics.R/man/enve.df2dist.Rd +39 -26
  74. data/utils/enveomics/enveomics.R/man/enve.df2dist.group.Rd +38 -25
  75. data/utils/enveomics/enveomics.R/man/enve.df2dist.list.Rd +40 -26
  76. data/utils/enveomics/enveomics.R/man/enve.growthcurve.Rd +67 -49
  77. data/utils/enveomics/enveomics.R/man/enve.prune.dist.Rd +37 -28
  78. data/utils/enveomics/enveomics.R/man/enve.recplot.Rd +122 -97
  79. data/utils/enveomics/enveomics.R/man/enve.recplot2-class.Rd +35 -31
  80. data/utils/enveomics/enveomics.R/man/enve.recplot2.ANIr.Rd +24 -23
  81. data/utils/enveomics/enveomics.R/man/enve.recplot2.Rd +68 -51
  82. data/utils/enveomics/enveomics.R/man/enve.recplot2.__counts.Rd +25 -24
  83. data/utils/enveomics/enveomics.R/man/enve.recplot2.__peakHist.Rd +21 -22
  84. data/utils/enveomics/enveomics.R/man/enve.recplot2.__whichClosestPeak.Rd +19 -20
  85. data/utils/enveomics/enveomics.R/man/enve.recplot2.changeCutoff.Rd +19 -18
  86. data/utils/enveomics/enveomics.R/man/enve.recplot2.compareIdentities.Rd +41 -32
  87. data/utils/enveomics/enveomics.R/man/enve.recplot2.coordinates.Rd +29 -24
  88. data/utils/enveomics/enveomics.R/man/enve.recplot2.corePeak.Rd +18 -18
  89. data/utils/enveomics/enveomics.R/man/enve.recplot2.extractWindows.Rd +40 -34
  90. data/utils/enveomics/enveomics.R/man/enve.recplot2.findPeaks.Rd +36 -24
  91. data/utils/enveomics/enveomics.R/man/enve.recplot2.findPeaks.__em_e.Rd +19 -20
  92. data/utils/enveomics/enveomics.R/man/enve.recplot2.findPeaks.__em_m.Rd +19 -20
  93. data/utils/enveomics/enveomics.R/man/enve.recplot2.findPeaks.__emauto_one.Rd +27 -29
  94. data/utils/enveomics/enveomics.R/man/enve.recplot2.findPeaks.__mow_one.Rd +41 -42
  95. data/utils/enveomics/enveomics.R/man/enve.recplot2.findPeaks.__mower.Rd +17 -18
  96. data/utils/enveomics/enveomics.R/man/enve.recplot2.findPeaks.em.Rd +43 -33
  97. data/utils/enveomics/enveomics.R/man/enve.recplot2.findPeaks.emauto.Rd +36 -28
  98. data/utils/enveomics/enveomics.R/man/enve.recplot2.findPeaks.mower.Rd +74 -56
  99. data/utils/enveomics/enveomics.R/man/enve.recplot2.peak-class.Rd +44 -31
  100. data/utils/enveomics/enveomics.R/man/enve.recplot2.seqdepth.Rd +27 -22
  101. data/utils/enveomics/enveomics.R/man/enve.recplot2.windowDepthThreshold.Rd +32 -26
  102. data/utils/enveomics/enveomics.R/man/enve.tribs.Rd +59 -44
  103. data/utils/enveomics/enveomics.R/man/enve.tribs.test.Rd +28 -21
  104. data/utils/enveomics/enveomics.R/man/enve.truncate.Rd +27 -22
  105. data/utils/enveomics/enveomics.R/man/plot.enve.GrowthCurve.Rd +63 -43
  106. data/utils/enveomics/enveomics.R/man/plot.enve.TRIBS.Rd +38 -29
  107. data/utils/enveomics/enveomics.R/man/plot.enve.TRIBStest.Rd +38 -30
  108. data/utils/enveomics/enveomics.R/man/plot.enve.recplot2.Rd +111 -83
  109. data/utils/enveomics/enveomics.R/man/summary.enve.GrowthCurve.Rd +19 -18
  110. data/utils/enveomics/enveomics.R/man/summary.enve.TRIBS.Rd +19 -18
  111. data/utils/enveomics/enveomics.R/man/summary.enve.TRIBStest.Rd +19 -18
  112. data/utils/find-medoid.R +3 -2
  113. data/utils/representatives.rb +5 -3
  114. data/utils/subclade/pipeline.rb +22 -11
  115. data/utils/subclade/runner.rb +5 -1
  116. data/utils/subclades-compile.rb +1 -1
  117. data/utils/subclades.R +9 -3
  118. metadata +15 -4
  119. data/utils/enveomics/enveomics.R/man/enveomics.R-package.Rd +0 -15
  120. data/utils/enveomics/enveomics.R/man/z$-methods.Rd +0 -26
@@ -1,83 +1,111 @@
1
- \name{plot.enve.RecPlot2}
2
- \alias{plot.enve.RecPlot2}
3
- \title{plot enve RecPlot2}
4
- \description{Plots an `enve.RecPlot2` object.}
5
- \usage{\method{plot}{enve.RecPlot2}(x, layout = matrix(c(5, 5, 2, 1, 4, 3), nrow = 2),
6
- panel.fun = list(), widths = c(1, 7, 2), heights = c(1, 2),
7
- palette = grey((100:0)/100), underlay.group = TRUE, peaks.col = "darkred",
8
- use.peaks, id.lim = range(x$id.breaks), pos.lim = range(x$pos.breaks),
9
- pos.units = c("Mbp", "Kbp", "bp"), mar = list(`1` = c(5,
10
- 4, 1, 1) + 0.1, `2` = c(ifelse(any(layout == 1), 1, 5),
11
- 4, 4, 1) + 0.1, `3` = c(5, ifelse(any(layout == 1), 1,
12
- 4), 1, 2) + 0.1, `4` = c(ifelse(any(layout == 1), 1,
13
- 5), ifelse(any(layout == 2), 1, 4), 4, 2) + 0.1, `5` = c(5,
14
- 3, 4, 1) + 0.1, `6` = c(5, 4, 4, 2) + 0.1), pos.splines = 0,
15
- id.splines = 1/2, in.lwd = ifelse(is.null(pos.splines) ||
16
- pos.splines > 0, 1/2, 2), out.lwd = ifelse(is.null(pos.splines) ||
17
- pos.splines > 0, 1/2, 2), id.lwd = ifelse(is.null(id.splines) ||
18
- id.splines > 0, 1/2, 2), in.col = "darkblue", out.col = "lightblue",
19
- id.col = "black", breaks.col = "#AAAAAA40", peaks.opts = list(),
20
- ...)}
21
- \arguments{
22
- \item{x}{`enve.RecPlot2` object to plot.}
23
- \item{layout}{Matrix indicating the position of the different panels in the layout,
24
- where:
25
- 0: Empty space,
26
- 1: Counts matrix,
27
- 2: position histogram (sequencing depth),
28
- 3: identity histogram,
29
- 4: Populations histogram (histogram of sequencing depths),
30
- 5: Color scale for the counts matrix (vertical),
31
- 6: Color scale of the counts matrix (horizontal)
32
- Only panels indicated here will be plotted. To plot only one panel
33
- simply set this to the number of the panel you want to plot.}
34
- \item{panel.fun}{List of functions to be executed after drawing each panel. Use the
35
- indices in `layout` (as characters) as keys. Functions for indices
36
- missing in `layout` are ignored. For example, to add a vertical line
37
- at the 3Mbp mark in both the position histogram and the counts matrix:
38
- `list('1'=function() abline(v=3), '2'=function() abline(v=3))`.
39
- Note that the X-axis in both panels is in Mbp by default. To change
40
- this behavior, set `pos.units` accordingly.}
41
- \item{widths}{Relative widths of the columns of `layout`.}
42
- \item{heights}{Relative heights of the rows of `layout`.}
43
- \item{palette}{Colors to be used to represent the counts matrix, sorted from no hits
44
- to the maximum sequencing depth.}
45
- \item{underlay.group}{If TRUE, it indicates the in-group and out-group areas couloured based
46
- on `in.col` and `out.col`. Requires support for semi-transparency.}
47
- \item{peaks.col}{If not NA, it attempts to represent peaks in the population histogram
48
- in the specified color. Set to NA to avoid peak-finding.}
49
- \item{use.peaks}{A list of `enve.RecPlot2.Peak` objects, as returned by
50
- `enve.recplot2.findPeaks`. If passed, `peaks.opts` is ignored.}
51
- \item{id.lim}{Limits of identities to represent.}
52
- \item{pos.lim}{Limits of positions to represent (in bp, regardless of `pos.units`).}
53
- \item{pos.units}{Units in which the positions should be represented (powers of 1,000
54
- base pairs).}
55
- \item{mar}{
56
- }
57
- \item{pos.splines}{Smoothing parameter for the splines in the position histogram. Zero
58
- (0) for no splines. Use NULL to automatically detect by leave-one-out
59
- cross-validation.}
60
- \item{id.splines}{Smoothing parameter for the splines in the identity histogram. Zero
61
- (0) for no splines. Use NULL to automatically detect by leave-one-out
62
- cross-validation.}
63
- \item{in.lwd}{Line width for the sequencing depth of in-group matches.}
64
- \item{out.lwd}{Line width for the sequencing depth of out-group matches.}
65
- \item{id.lwd}{Line width for the identity histogram.}
66
- \item{in.col}{Color associated to in-group matches.}
67
- \item{out.col}{Color associated to out-group matches.}
68
- \item{id.col}{Color for the identity histogram.}
69
- \item{breaks.col}{Color of the vertical lines indicating sequence breaks.}
70
- \item{peaks.opts}{Options passed to `enve.recplot2.findPeaks`, if `peaks.col` is not NA.}
71
- \item{\dots}{Any other graphic parameters (currently ignored).}
72
- }
73
-
74
- \value{Returns a list of `enve.RecPlot2.Peak` objects (see
75
- `enve.recplot2.findPeaks`). If `peaks.col`=NA or `layout` doesn't include
76
- 4, returns NA.}
77
-
78
- \author{Luis M. Rodriguez-R [aut, cre]}
79
-
80
-
81
-
82
-
83
-
1
+ % Generated by roxygen2: do not edit by hand
2
+ % Please edit documentation in R/recplot2.R
3
+ \name{plot.enve.RecPlot2}
4
+ \alias{plot.enve.RecPlot2}
5
+ \title{Enveomics: Recruitment Plot (2)}
6
+ \usage{
7
+ \method{plot}{enve.RecPlot2}(x, layout = matrix(c(5, 5, 2, 1, 4, 3), nrow
8
+ = 2), panel.fun = list(), widths = c(1, 7, 2), heights = c(1, 2),
9
+ palette = grey((100:0)/100), underlay.group = TRUE,
10
+ peaks.col = "darkred", use.peaks, id.lim = range(x$id.breaks),
11
+ pos.lim = range(x$pos.breaks), pos.units = c("Mbp", "Kbp", "bp"),
12
+ mar = list(`1` = c(5, 4, 1, 1) + 0.1, `2` = c(ifelse(any(layout == 1),
13
+ 1, 5), 4, 4, 1) + 0.1, `3` = c(5, ifelse(any(layout == 1), 1, 4), 1, 2) +
14
+ 0.1, `4` = c(ifelse(any(layout == 1), 1, 5), ifelse(any(layout == 2), 1,
15
+ 4), 4, 2) + 0.1, `5` = c(5, 3, 4, 1) + 0.1, `6` = c(5, 4, 4, 2) + 0.1),
16
+ pos.splines = 0, id.splines = 1/2,
17
+ in.lwd = ifelse(is.null(pos.splines) || pos.splines > 0, 1/2, 2),
18
+ out.lwd = ifelse(is.null(pos.splines) || pos.splines > 0, 1/2, 2),
19
+ id.lwd = ifelse(is.null(id.splines) || id.splines > 0, 1/2, 2),
20
+ in.col = "darkblue", out.col = "lightblue", id.col = "black",
21
+ breaks.col = "#AAAAAA40", peaks.opts = list(), ...)
22
+ }
23
+ \arguments{
24
+ \item{x}{\code{\link{enve.RecPlot2}} object to plot.}
25
+
26
+ \item{layout}{Matrix indicating the position of the different panels in the layout,
27
+ where:
28
+ \itemize{
29
+ \item 0: Empty space
30
+ \item 1: Counts matrix
31
+ \item 2: position histogram (sequencing depth)
32
+ \item 3: identity histogram
33
+ \item 4: Populations histogram (histogram of sequencing depths)
34
+ \item 5: Color scale for the counts matrix (vertical)
35
+ \item 6: Color scale of the counts matrix (horizontal)
36
+ }
37
+ Only panels indicated here will be plotted. To plot only one panel
38
+ simply set this to the number of the panel you want to plot.}
39
+
40
+ \item{panel.fun}{List of functions to be executed after drawing each panel. Use the
41
+ indices in \code{layout} (as characters) as keys. Functions for indices
42
+ missing in \code{layout} are ignored. For example, to add a vertical line
43
+ at the 3Mbp mark in both the position histogram and the counts matrix:
44
+ \code{list('1'=function() abline(v=3), '2'=function() abline(v=3))}.
45
+ Note that the X-axis in both panels is in Mbp by default. To change
46
+ this behavior, set \code{pos.units} accordingly.}
47
+
48
+ \item{widths}{Relative widths of the columns of \code{layout}.}
49
+
50
+ \item{heights}{Relative heights of the rows of \code{layout}.}
51
+
52
+ \item{palette}{Colors to be used to represent the counts matrix, sorted from no hits
53
+ to the maximum sequencing depth.}
54
+
55
+ \item{underlay.group}{If TRUE, it indicates the in-group and out-group areas couloured based
56
+ on \code{in.col} and \code{out.col}. Requires support for semi-transparency.}
57
+
58
+ \item{peaks.col}{If not \code{NA}, it attempts to represent peaks in the population histogram
59
+ in the specified color. Set to \code{NA} to avoid peak-finding.}
60
+
61
+ \item{use.peaks}{A list of \code{\link{enve.RecPlot2.Peak}} objects, as returned by
62
+ \code{\link{enve.recplot2.findPeaks}}. If passed, \code{peaks.opts} is ignored.}
63
+
64
+ \item{id.lim}{Limits of identities to represent.}
65
+
66
+ \item{pos.lim}{Limits of positions to represent (in bp, regardless of \code{pos.units}).}
67
+
68
+ \item{pos.units}{Units in which the positions should be represented (powers of 1,000
69
+ base pairs).}
70
+
71
+ \item{mar}{Margins of the panels as a list, with the character representation of
72
+ the number of the panel as index (see \code{layout}).}
73
+
74
+ \item{pos.splines}{Smoothing parameter for the splines in the position histogram. Zero
75
+ (0) for no splines. Use \code{NULL} to automatically detect by leave-one-out
76
+ cross-validation.}
77
+
78
+ \item{id.splines}{Smoothing parameter for the splines in the identity histogram. Zero
79
+ (0) for no splines. Use \code{NULL} to automatically detect by leave-one-out
80
+ cross-validation.}
81
+
82
+ \item{in.lwd}{Line width for the sequencing depth of in-group matches.}
83
+
84
+ \item{out.lwd}{Line width for the sequencing depth of out-group matches.}
85
+
86
+ \item{id.lwd}{Line width for the identity histogram.}
87
+
88
+ \item{in.col}{Color associated to in-group matches.}
89
+
90
+ \item{out.col}{Color associated to out-group matches.}
91
+
92
+ \item{id.col}{Color for the identity histogram.}
93
+
94
+ \item{breaks.col}{Color of the vertical lines indicating sequence breaks.}
95
+
96
+ \item{peaks.opts}{Options passed to \code{\link{enve.recplot2.findPeaks}},
97
+ if \code{peaks.col} is not \code{NA}.}
98
+
99
+ \item{...}{Any other graphic parameters (currently ignored).}
100
+ }
101
+ \value{
102
+ Returns a list of \code{\link{enve.RecPlot2.Peak}} objects (see
103
+ \code{\link{enve.recplot2.findPeaks}}). If \code{peaks.col=NA} or
104
+ \code{layout} doesn't include 4, returns \code{NA}.
105
+ }
106
+ \description{
107
+ Plots an \code{\link{enve.RecPlot2}} object.
108
+ }
109
+ \author{
110
+ Luis M. Rodriguez-R [aut, cre]
111
+ }
@@ -1,18 +1,19 @@
1
- \name{summary.enve.GrowthCurve}
2
- \alias{summary.enve.GrowthCurve}
3
- \title{summary enve GrowthCurve}
4
- \description{Summary of an `enve.GrowthCurve` object.}
5
- \usage{\method{summary}{enve.GrowthCurve}(object, ...)}
6
- \arguments{
7
- \item{object}{`enve.GrowthCurve` object.}
8
- \item{\dots}{No additional parameters are currently supported.}
9
- }
10
-
11
-
12
-
13
- \author{Luis M. Rodriguez-R [aut, cre]}
14
-
15
-
16
-
17
-
18
-
1
+ % Generated by roxygen2: do not edit by hand
2
+ % Please edit documentation in R/growthcurve.R
3
+ \name{summary.enve.GrowthCurve}
4
+ \alias{summary.enve.GrowthCurve}
5
+ \title{Enveomics: Summary of Growth Curve}
6
+ \usage{
7
+ \method{summary}{enve.GrowthCurve}(object, ...)
8
+ }
9
+ \arguments{
10
+ \item{object}{An \code{\link{enve.GrowthCurve}} object.}
11
+
12
+ \item{...}{No additional parameters are currently supported.}
13
+ }
14
+ \description{
15
+ Summary of an \code{\link{enve.GrowthCurve}} object.
16
+ }
17
+ \author{
18
+ Luis M. Rodriguez-R [aut, cre]
19
+ }
@@ -1,18 +1,19 @@
1
- \name{summary.enve.TRIBS}
2
- \alias{summary.enve.TRIBS}
3
- \title{summary enve TRIBS}
4
- \description{Summary of an `enve.TRIBS` object.}
5
- \usage{\method{summary}{enve.TRIBS}(object, ...)}
6
- \arguments{
7
- \item{object}{`enve.TRIBS` object.}
8
- \item{\dots}{No additional parameters are currently supported.}
9
- }
10
-
11
-
12
-
13
- \author{Luis M. Rodriguez-R [aut, cre]}
14
-
15
-
16
-
17
-
18
-
1
+ % Generated by roxygen2: do not edit by hand
2
+ % Please edit documentation in R/tribs.R
3
+ \name{summary.enve.TRIBS}
4
+ \alias{summary.enve.TRIBS}
5
+ \title{Enveomics: TRIBS Summary}
6
+ \usage{
7
+ \method{summary}{enve.TRIBS}(object, ...)
8
+ }
9
+ \arguments{
10
+ \item{object}{\code{\link{enve.TRIBS}} object.}
11
+
12
+ \item{...}{No additional parameters are currently supported.}
13
+ }
14
+ \description{
15
+ Summary of an \code{\link{enve.TRIBS}} object.
16
+ }
17
+ \author{
18
+ Luis M. Rodriguez-R [aut, cre]
19
+ }
@@ -1,18 +1,19 @@
1
- \name{summary.enve.TRIBStest}
2
- \alias{summary.enve.TRIBStest}
3
- \title{summary enve TRIBStest}
4
- \description{Summary of an `enve.TRIBStest` object.}
5
- \usage{\method{summary}{enve.TRIBStest}(object, ...)}
6
- \arguments{
7
- \item{object}{`enve.TRIBStest` object.}
8
- \item{\dots}{No additional parameters are currently supported.}
9
- }
10
-
11
-
12
-
13
- \author{Luis M. Rodriguez-R [aut, cre]}
14
-
15
-
16
-
17
-
18
-
1
+ % Generated by roxygen2: do not edit by hand
2
+ % Please edit documentation in R/tribs.R
3
+ \name{summary.enve.TRIBStest}
4
+ \alias{summary.enve.TRIBStest}
5
+ \title{Enveomics: TRIBS Summary Test}
6
+ \usage{
7
+ \method{summary}{enve.TRIBStest}(object, ...)
8
+ }
9
+ \arguments{
10
+ \item{object}{\code{\link{enve.TRIBStest}} object.}
11
+
12
+ \item{...}{No additional parameters are currently supported.}
13
+ }
14
+ \description{
15
+ Summary of an \code{\link{enve.TRIBStest}} object.
16
+ }
17
+ \author{
18
+ Luis M. Rodriguez-R [aut, cre]
19
+ }
@@ -5,12 +5,12 @@
5
5
  #
6
6
 
7
7
  #= Load stuff
8
- argv <- commandArgs(trailingOnly=T)
8
+ argv <- commandArgs(trailingOnly = T)
9
9
  suppressPackageStartupMessages(library(ape))
10
10
  suppressPackageStartupMessages(library(enveomics.R))
11
11
 
12
12
  find_medoids <- function(ani.df, out, clades) {
13
- if(nrow(ani.df)==0) return(NULL)
13
+ if(nrow(ani.df) == 0) return(NULL)
14
14
  ani.df$d <- 1 - (ani.df$value/100)
15
15
  dist <- enve.df2dist(ani.df, 'a', 'b', 'd', default.d = max(ani.df$d)*1.2)
16
16
  dist <- as.matrix(dist)
@@ -31,5 +31,6 @@ find_medoids <- function(ani.df, out, clades) {
31
31
 
32
32
  #= Main
33
33
  load(argv[1])
34
+ if(! exists('ani')) ani <- aai
34
35
  find_medoids(ani.df = ani, out = argv[2], clades = argv[3])
35
36
 
@@ -9,9 +9,11 @@ proj_path = ARGV.shift or raise "Usage: #{$0} path/to/project"
9
9
  p = MiGA::Project.load(proj_path) or
10
10
  raise "Cannot load project: #{proj_path}"
11
11
  pr = p.result(:clade_finding) or
12
- raise "Unavailable result: clade_finding"
13
- pf = pr.file_path(:clades_ani95) or
14
- raise "Unavailable result file: clades_ani95"
12
+ raise 'Unavailable result: clade_finding'
13
+ if (pf = pr.file_path(:clades_gsp)).nil?
14
+ pf = pr.file_path(:clades_ani95) or
15
+ raise 'Unavailable result files: clades_gsp and clades_ani95'
16
+ end
15
17
 
16
18
  # Read ANIspp
17
19
  ani_spp = []
@@ -4,7 +4,10 @@ module MiGA::SubcladeRunner::Pipeline
4
4
 
5
5
  # Run species-level clusterings using ANI > 95% / AAI > 90%
6
6
  def cluster_species
7
- tasks = {ani95: [:ani_distances, 95.0], aai90: [:aai_distances, 90.0]}
7
+ tasks = {
8
+ ani95: [:ani_distances, opts[:gsp_ani], :ani],
9
+ aai90: [:aai_distances, opts[:gsp_aai], :aai]
10
+ }
8
11
  tasks.each do |k, par|
9
12
  # Final output
10
13
  ogs_file = "miga-project.#{k}-clades"
@@ -23,23 +26,31 @@ module MiGA::SubcladeRunner::Pipeline
23
26
  end
24
27
  ofh.close
25
28
  # Cluster genomes
26
- `ogs.mcl.rb -o '#{ogs_file}.tmp' --abc '#{abc_path}' -t '#{opts[:thr]}'`
27
- File.open(ogs_file, 'w') do |fh|
28
- File.foreach("#{ogs_file}.tmp").with_index do |ln, lno|
29
- fh.puts ln if lno > 0
29
+ if File.size? abc_path
30
+ `ogs.mcl.rb -o '#{ogs_file}.tmp' --abc '#{abc_path}' -t '#{opts[:thr]}'`
31
+ File.open(ogs_file, 'w') do |fh|
32
+ File.foreach("#{ogs_file}.tmp").with_index do |ln, lno|
33
+ fh.puts ln if lno > 0
34
+ end
30
35
  end
36
+ File.unlink "#{ogs_file}.tmp"
37
+ else
38
+ FileUtils.touch ogs_file
39
+ end
40
+ if par[2].to_s == opts[:gsp_metric]
41
+ FileUtils.cp(ogs_file, "miga-project.gsp-clades")
31
42
  end
32
- File.unlink "#{ogs_file}.tmp"
33
43
  end
34
44
 
35
- # Find species medoids
45
+ # Find genomospecies medoids
36
46
  src = File.expand_path('utils/find-medoid.R', MiGA::MiGA.root_path)
37
- `Rscript '#{src}' ../../09.distances/03.ani/miga-project.Rdata \
38
- miga-project.ani95-medoids miga-project.ani95-clades`
47
+ dir = opts[:gsp_metric] == 'aai' ? '02.aai' : '03.ani'
48
+ `Rscript '#{src}' ../../09.distances/#{dir}/miga-project.Rdata \
49
+ miga-project.gsp-medoids miga-project.gsp-clades`
39
50
 
40
51
  # Propose clades
41
52
  ofh = File.open('miga-project.proposed-clades', 'w')
42
- File.open('miga-project.ani95-clades', 'r') do |ifh|
53
+ File.open('miga-project.gsp-clades', 'r') do |ifh|
43
54
  ifh.each_line do |ln|
44
55
  next if $.==1
45
56
  r = ln.chomp.split(',')
@@ -55,7 +66,7 @@ module MiGA::SubcladeRunner::Pipeline
55
66
  metric_res = project.result(step) or raise "Incomplete step #{step}"
56
67
  matrix = metric_res.file_path(:matrix)
57
68
  `Rscript '#{src}' '#{matrix}' miga-project '#{opts[:thr]}' \
58
- miga-project.ani95-medoids`
69
+ miga-project.ani95-medoids '#{opts[:run_clades] ? 'cluster' : 'empty'}'`
59
70
  File.rename('miga-project.nwk',"miga-project.#{metric}.nwk") if
60
71
  File.exist? 'miga-project.nwk'
61
72
  end
@@ -18,7 +18,11 @@ class MiGA::SubcladeRunner
18
18
  clades_dir = File.expand_path('data/10.clades', project.path)
19
19
  @home = File.expand_path(@step == :clade_finding ? '01.find' : '02.ani',
20
20
  clades_dir)
21
- @opts[:thr] ||= ENV.fetch("CORES"){ 2 }.to_i
21
+ @opts[:thr] ||= ENV.fetch('CORES') { 2 }.to_i
22
+ @opts[:run_clades] = !!@project.metadata.data.fetch(:run_clades) { true }
23
+ @opts[:gsp_ani] = @project.metadata.data.fetch(:gsp_ani) { 95.0 }.to_f
24
+ @opts[:gsp_aai] = @project.metadata.data.fetch(:gsp_aai) { 90.0 }.to_f
25
+ @opts[:gsp_metric] = @project.metadata.data.fetch(:gsp_metric){ 'ani' }.to_s
22
26
  end
23
27
 
24
28
  # Launch the appropriate analysis
@@ -46,4 +46,4 @@ max_depth = c.values.map{|i| i.count}.max
46
46
  File.open("#{out}.tsv", 'w') do |fh|
47
47
  c.each { |k,v| fh.puts ([k] + v + ["0"]*(max_depth-v.count)).join("\t") }
48
48
  end
49
- File.open("#{out}.nwk", 'w') { |fh| fh.puts print_tree(c) + ";" }
49
+ File.open("#{out}.nwk", 'w') { |fh| fh.puts print_tree(c).to_s + ";" }
@@ -248,6 +248,12 @@ ggplotColours <- function(n=6, h=c(0, 360)+15, alpha=1){
248
248
 
249
249
  #= Main
250
250
  options(warn = 1)
251
- subclades(ani_file = argv[1], out_base = argv[2],
252
- thr = ifelse(is.na(argv[3]), 1, as.numeric(argv[3])), sel = argv[4])
253
-
251
+ if(length(argv) >= 5 & argv[5] == 'empty'){
252
+ generate_empty_files(argv[2])
253
+ write.table(NULL, paste(argv[2], "medoids", sep="."))
254
+ write.table(NULL, paste(argv[2], "classif", sep="."))
255
+ write.table(date(), paste(argv[2], "ready", sep="."))
256
+ }else{
257
+ subclades(ani_file = argv[1], out_base = argv[2],
258
+ thr = ifelse(is.na(argv[3]), 1, as.numeric(argv[3])), sel = argv[4])
259
+ }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: miga-base
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3.0
4
+ version: 0.5.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luis M. Rodriguez-R
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-10 00:00:00.000000000 Z
11
+ date: 2019-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: daemons
@@ -101,22 +101,29 @@ files:
101
101
  - lib/miga/cli/action/about.rb
102
102
  - lib/miga/cli/action/add.rb
103
103
  - lib/miga/cli/action/add_result.rb
104
+ - lib/miga/cli/action/classify_wf.rb
104
105
  - lib/miga/cli/action/console.rb
105
106
  - lib/miga/cli/action/daemon.rb
106
107
  - lib/miga/cli/action/date.rb
108
+ - lib/miga/cli/action/derep_wf.rb
107
109
  - lib/miga/cli/action/doctor.rb
108
110
  - lib/miga/cli/action/edit.rb
109
111
  - lib/miga/cli/action/files.rb
110
112
  - lib/miga/cli/action/find.rb
111
113
  - lib/miga/cli/action/generic.rb
112
114
  - lib/miga/cli/action/get.rb
115
+ - lib/miga/cli/action/get_db.rb
116
+ - lib/miga/cli/action/index_wf.rb
113
117
  - lib/miga/cli/action/init.rb
118
+ - lib/miga/cli/action/init/daemon_helper.rb
114
119
  - lib/miga/cli/action/ln.rb
115
120
  - lib/miga/cli/action/ls.rb
116
121
  - lib/miga/cli/action/ncbi_get.rb
117
122
  - lib/miga/cli/action/new.rb
118
123
  - lib/miga/cli/action/next_step.rb
119
124
  - lib/miga/cli/action/plugins.rb
125
+ - lib/miga/cli/action/preproc_wf.rb
126
+ - lib/miga/cli/action/quality_wf.rb
120
127
  - lib/miga/cli/action/rm.rb
121
128
  - lib/miga/cli/action/run.rb
122
129
  - lib/miga/cli/action/stats.rb
@@ -125,7 +132,10 @@ files:
125
132
  - lib/miga/cli/action/tax_index.rb
126
133
  - lib/miga/cli/action/tax_set.rb
127
134
  - lib/miga/cli/action/tax_test.rb
135
+ - lib/miga/cli/action/wf.rb
128
136
  - lib/miga/cli/base.rb
137
+ - lib/miga/cli/objects_helper.rb
138
+ - lib/miga/cli/opt_helper.rb
129
139
  - lib/miga/common.rb
130
140
  - lib/miga/common/base.rb
131
141
  - lib/miga/common/format.rb
@@ -406,6 +416,9 @@ files:
406
416
  - utils/enveomics/enveomics.R/README.md
407
417
  - utils/enveomics/enveomics.R/data/growth.curves.rda
408
418
  - utils/enveomics/enveomics.R/data/phyla.counts.rda
419
+ - utils/enveomics/enveomics.R/man/cash-enve.GrowthCurve-method.Rd
420
+ - utils/enveomics/enveomics.R/man/cash-enve.RecPlot2-method.Rd
421
+ - utils/enveomics/enveomics.R/man/cash-enve.RecPlot2.Peak-method.Rd
409
422
  - utils/enveomics/enveomics.R/man/enve.GrowthCurve-class.Rd
410
423
  - utils/enveomics/enveomics.R/man/enve.TRIBS-class.Rd
411
424
  - utils/enveomics/enveomics.R/man/enve.TRIBS.merge.Rd
@@ -449,7 +462,6 @@ files:
449
462
  - utils/enveomics/enveomics.R/man/enve.tribs.Rd
450
463
  - utils/enveomics/enveomics.R/man/enve.tribs.test.Rd
451
464
  - utils/enveomics/enveomics.R/man/enve.truncate.Rd
452
- - utils/enveomics/enveomics.R/man/enveomics.R-package.Rd
453
465
  - utils/enveomics/enveomics.R/man/growth.curves.Rd
454
466
  - utils/enveomics/enveomics.R/man/phyla.counts.Rd
455
467
  - utils/enveomics/enveomics.R/man/plot.enve.GrowthCurve.Rd
@@ -459,7 +471,6 @@ files:
459
471
  - utils/enveomics/enveomics.R/man/summary.enve.GrowthCurve.Rd
460
472
  - utils/enveomics/enveomics.R/man/summary.enve.TRIBS.Rd
461
473
  - utils/enveomics/enveomics.R/man/summary.enve.TRIBStest.Rd
462
- - utils/enveomics/enveomics.R/man/z$-methods.Rd
463
474
  - utils/enveomics/globals.mk
464
475
  - utils/enveomics/manifest.json
465
476
  - utils/find-medoid.R