miga-base 0.7.24.0 → 0.7.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/miga/cli/action/add.rb +9 -6
- data/lib/miga/cli/action/derep_wf.rb +1 -1
- data/lib/miga/cli/action/index_wf.rb +4 -2
- data/lib/miga/cli/action/init.rb +83 -68
- data/lib/miga/cli/action/init/files_helper.rb +2 -1
- data/lib/miga/cli/action/option.rb +21 -2
- data/lib/miga/cli/action/preproc_wf.rb +7 -5
- data/lib/miga/cli/action/wf.rb +40 -24
- data/lib/miga/cli/base.rb +16 -5
- data/lib/miga/common/with_option.rb +1 -1
- data/lib/miga/dataset/result.rb +2 -1
- data/lib/miga/project/base.rb +1 -1
- data/lib/miga/result.rb +18 -15
- data/lib/miga/version.rb +2 -2
- data/scripts/essential_genes.bash +17 -1
- data/scripts/miga.bash +8 -2
- data/test/lair_test.rb +1 -2
- data/test/result_test.rb +22 -0
- data/utils/distance/base.rb +9 -0
- data/utils/distance/commands.rb +183 -81
- data/utils/distance/database.rb +68 -9
- data/utils/distance/pipeline.rb +14 -18
- data/utils/distance/runner.rb +17 -30
- data/utils/distance/temporal.rb +4 -2
- data/utils/distances.rb +2 -2
- data/utils/requirements.txt +5 -5
- metadata +5 -272
- data/utils/enveomics/Docs/recplot2.md +0 -244
- data/utils/enveomics/Examples/aai-matrix.bash +0 -66
- data/utils/enveomics/Examples/ani-matrix.bash +0 -66
- data/utils/enveomics/Examples/essential-phylogeny.bash +0 -105
- data/utils/enveomics/Examples/unus-genome-phylogeny.bash +0 -100
- data/utils/enveomics/LICENSE.txt +0 -73
- data/utils/enveomics/Makefile +0 -52
- data/utils/enveomics/Manifest/Tasks/aasubs.json +0 -103
- data/utils/enveomics/Manifest/Tasks/blasttab.json +0 -786
- data/utils/enveomics/Manifest/Tasks/distances.json +0 -161
- data/utils/enveomics/Manifest/Tasks/fasta.json +0 -766
- data/utils/enveomics/Manifest/Tasks/fastq.json +0 -243
- data/utils/enveomics/Manifest/Tasks/graphics.json +0 -126
- data/utils/enveomics/Manifest/Tasks/mapping.json +0 -67
- data/utils/enveomics/Manifest/Tasks/ogs.json +0 -382
- data/utils/enveomics/Manifest/Tasks/other.json +0 -829
- data/utils/enveomics/Manifest/Tasks/remote.json +0 -355
- data/utils/enveomics/Manifest/Tasks/sequence-identity.json +0 -501
- data/utils/enveomics/Manifest/Tasks/tables.json +0 -308
- data/utils/enveomics/Manifest/Tasks/trees.json +0 -68
- data/utils/enveomics/Manifest/Tasks/variants.json +0 -111
- data/utils/enveomics/Manifest/categories.json +0 -156
- data/utils/enveomics/Manifest/examples.json +0 -154
- data/utils/enveomics/Manifest/tasks.json +0 -4
- data/utils/enveomics/Pipelines/assembly.pbs/CONFIG.mock.bash +0 -69
- data/utils/enveomics/Pipelines/assembly.pbs/FastA.N50.pl +0 -1
- data/utils/enveomics/Pipelines/assembly.pbs/FastA.filterN.pl +0 -1
- data/utils/enveomics/Pipelines/assembly.pbs/FastA.length.pl +0 -1
- data/utils/enveomics/Pipelines/assembly.pbs/README.md +0 -189
- data/utils/enveomics/Pipelines/assembly.pbs/RUNME-2.bash +0 -112
- data/utils/enveomics/Pipelines/assembly.pbs/RUNME-3.bash +0 -23
- data/utils/enveomics/Pipelines/assembly.pbs/RUNME-4.bash +0 -44
- data/utils/enveomics/Pipelines/assembly.pbs/RUNME.bash +0 -50
- data/utils/enveomics/Pipelines/assembly.pbs/kSelector.R +0 -37
- data/utils/enveomics/Pipelines/assembly.pbs/newbler.pbs +0 -68
- data/utils/enveomics/Pipelines/assembly.pbs/newbler_preparator.pl +0 -49
- data/utils/enveomics/Pipelines/assembly.pbs/soap.pbs +0 -80
- data/utils/enveomics/Pipelines/assembly.pbs/stats.pbs +0 -57
- data/utils/enveomics/Pipelines/assembly.pbs/velvet.pbs +0 -63
- data/utils/enveomics/Pipelines/blast.pbs/01.pbs.bash +0 -38
- data/utils/enveomics/Pipelines/blast.pbs/02.pbs.bash +0 -73
- data/utils/enveomics/Pipelines/blast.pbs/03.pbs.bash +0 -21
- data/utils/enveomics/Pipelines/blast.pbs/BlastTab.recover_job.pl +0 -72
- data/utils/enveomics/Pipelines/blast.pbs/CONFIG.mock.bash +0 -98
- data/utils/enveomics/Pipelines/blast.pbs/FastA.split.pl +0 -1
- data/utils/enveomics/Pipelines/blast.pbs/README.md +0 -127
- data/utils/enveomics/Pipelines/blast.pbs/RUNME.bash +0 -109
- data/utils/enveomics/Pipelines/blast.pbs/TASK.check.bash +0 -128
- data/utils/enveomics/Pipelines/blast.pbs/TASK.dry.bash +0 -16
- data/utils/enveomics/Pipelines/blast.pbs/TASK.eo.bash +0 -22
- data/utils/enveomics/Pipelines/blast.pbs/TASK.pause.bash +0 -26
- data/utils/enveomics/Pipelines/blast.pbs/TASK.run.bash +0 -89
- data/utils/enveomics/Pipelines/blast.pbs/sentinel.pbs.bash +0 -29
- data/utils/enveomics/Pipelines/idba.pbs/README.md +0 -49
- data/utils/enveomics/Pipelines/idba.pbs/RUNME.bash +0 -95
- data/utils/enveomics/Pipelines/idba.pbs/run.pbs +0 -56
- data/utils/enveomics/Pipelines/trim.pbs/README.md +0 -54
- data/utils/enveomics/Pipelines/trim.pbs/RUNME.bash +0 -70
- data/utils/enveomics/Pipelines/trim.pbs/run.pbs +0 -130
- data/utils/enveomics/README.md +0 -42
- data/utils/enveomics/Scripts/AAsubs.log2ratio.rb +0 -171
- data/utils/enveomics/Scripts/Aln.cat.rb +0 -163
- data/utils/enveomics/Scripts/Aln.convert.pl +0 -35
- data/utils/enveomics/Scripts/AlphaDiversity.pl +0 -152
- data/utils/enveomics/Scripts/BedGraph.tad.rb +0 -93
- data/utils/enveomics/Scripts/BedGraph.window.rb +0 -71
- data/utils/enveomics/Scripts/BlastPairwise.AAsubs.pl +0 -102
- data/utils/enveomics/Scripts/BlastTab.addlen.rb +0 -63
- data/utils/enveomics/Scripts/BlastTab.advance.bash +0 -48
- data/utils/enveomics/Scripts/BlastTab.best_hit_sorted.pl +0 -55
- data/utils/enveomics/Scripts/BlastTab.catsbj.pl +0 -104
- data/utils/enveomics/Scripts/BlastTab.cogCat.rb +0 -76
- data/utils/enveomics/Scripts/BlastTab.filter.pl +0 -47
- data/utils/enveomics/Scripts/BlastTab.kegg_pep2path_rest.pl +0 -194
- data/utils/enveomics/Scripts/BlastTab.metaxaPrep.pl +0 -104
- data/utils/enveomics/Scripts/BlastTab.pairedHits.rb +0 -157
- data/utils/enveomics/Scripts/BlastTab.recplot2.R +0 -48
- data/utils/enveomics/Scripts/BlastTab.seqdepth.pl +0 -86
- data/utils/enveomics/Scripts/BlastTab.seqdepth_ZIP.pl +0 -119
- data/utils/enveomics/Scripts/BlastTab.seqdepth_nomedian.pl +0 -86
- data/utils/enveomics/Scripts/BlastTab.subsample.pl +0 -47
- data/utils/enveomics/Scripts/BlastTab.sumPerHit.pl +0 -114
- data/utils/enveomics/Scripts/BlastTab.taxid2taxrank.pl +0 -90
- data/utils/enveomics/Scripts/BlastTab.topHits_sorted.rb +0 -101
- data/utils/enveomics/Scripts/Chao1.pl +0 -97
- data/utils/enveomics/Scripts/CharTable.classify.rb +0 -234
- data/utils/enveomics/Scripts/EBIseq2tax.rb +0 -83
- data/utils/enveomics/Scripts/FastA.N50.pl +0 -56
- data/utils/enveomics/Scripts/FastA.extract.rb +0 -152
- data/utils/enveomics/Scripts/FastA.filter.pl +0 -52
- data/utils/enveomics/Scripts/FastA.filterLen.pl +0 -28
- data/utils/enveomics/Scripts/FastA.filterN.pl +0 -60
- data/utils/enveomics/Scripts/FastA.fragment.rb +0 -92
- data/utils/enveomics/Scripts/FastA.gc.pl +0 -42
- data/utils/enveomics/Scripts/FastA.interpose.pl +0 -93
- data/utils/enveomics/Scripts/FastA.length.pl +0 -38
- data/utils/enveomics/Scripts/FastA.mask.rb +0 -89
- data/utils/enveomics/Scripts/FastA.per_file.pl +0 -36
- data/utils/enveomics/Scripts/FastA.qlen.pl +0 -57
- data/utils/enveomics/Scripts/FastA.rename.pl +0 -65
- data/utils/enveomics/Scripts/FastA.revcom.pl +0 -23
- data/utils/enveomics/Scripts/FastA.sample.rb +0 -83
- data/utils/enveomics/Scripts/FastA.slider.pl +0 -85
- data/utils/enveomics/Scripts/FastA.split.pl +0 -55
- data/utils/enveomics/Scripts/FastA.split.rb +0 -79
- data/utils/enveomics/Scripts/FastA.subsample.pl +0 -131
- data/utils/enveomics/Scripts/FastA.tag.rb +0 -65
- data/utils/enveomics/Scripts/FastA.wrap.rb +0 -48
- data/utils/enveomics/Scripts/FastQ.filter.pl +0 -54
- data/utils/enveomics/Scripts/FastQ.interpose.pl +0 -90
- data/utils/enveomics/Scripts/FastQ.offset.pl +0 -90
- data/utils/enveomics/Scripts/FastQ.split.pl +0 -53
- data/utils/enveomics/Scripts/FastQ.tag.rb +0 -63
- data/utils/enveomics/Scripts/FastQ.test-error.rb +0 -81
- data/utils/enveomics/Scripts/FastQ.toFastA.awk +0 -24
- data/utils/enveomics/Scripts/GFF.catsbj.pl +0 -127
- data/utils/enveomics/Scripts/GenBank.add_fields.rb +0 -84
- data/utils/enveomics/Scripts/HMM.essential.rb +0 -351
- data/utils/enveomics/Scripts/HMM.haai.rb +0 -168
- data/utils/enveomics/Scripts/HMMsearch.extractIds.rb +0 -83
- data/utils/enveomics/Scripts/JPlace.distances.rb +0 -88
- data/utils/enveomics/Scripts/JPlace.to_iToL.rb +0 -320
- data/utils/enveomics/Scripts/M5nr.getSequences.rb +0 -81
- data/utils/enveomics/Scripts/MeTaxa.distribution.pl +0 -198
- data/utils/enveomics/Scripts/MyTaxa.fragsByTax.pl +0 -35
- data/utils/enveomics/Scripts/MyTaxa.seq-taxrank.rb +0 -49
- data/utils/enveomics/Scripts/NCBIacc2tax.rb +0 -92
- data/utils/enveomics/Scripts/Newick.autoprune.R +0 -27
- data/utils/enveomics/Scripts/RAxML-EPA.to_iToL.pl +0 -228
- data/utils/enveomics/Scripts/RecPlot2.compareIdentities.R +0 -32
- data/utils/enveomics/Scripts/RefSeq.download.bash +0 -48
- data/utils/enveomics/Scripts/SRA.download.bash +0 -57
- data/utils/enveomics/Scripts/TRIBS.plot-test.R +0 -36
- data/utils/enveomics/Scripts/TRIBS.test.R +0 -39
- data/utils/enveomics/Scripts/Table.barplot.R +0 -31
- data/utils/enveomics/Scripts/Table.df2dist.R +0 -30
- data/utils/enveomics/Scripts/Table.filter.pl +0 -61
- data/utils/enveomics/Scripts/Table.merge.pl +0 -77
- data/utils/enveomics/Scripts/Table.replace.rb +0 -69
- data/utils/enveomics/Scripts/Table.round.rb +0 -63
- data/utils/enveomics/Scripts/Table.split.pl +0 -57
- data/utils/enveomics/Scripts/Taxonomy.silva2ncbi.rb +0 -227
- data/utils/enveomics/Scripts/VCF.KaKs.rb +0 -147
- data/utils/enveomics/Scripts/VCF.SNPs.rb +0 -88
- data/utils/enveomics/Scripts/aai.rb +0 -418
- data/utils/enveomics/Scripts/ani.rb +0 -362
- data/utils/enveomics/Scripts/clust.rand.rb +0 -102
- data/utils/enveomics/Scripts/gi2tax.rb +0 -103
- data/utils/enveomics/Scripts/in_silico_GA_GI.pl +0 -96
- data/utils/enveomics/Scripts/lib/data/dupont_2012_essential.hmm.gz +0 -0
- data/utils/enveomics/Scripts/lib/data/lee_2019_essential.hmm.gz +0 -0
- data/utils/enveomics/Scripts/lib/enveomics.R +0 -1
- data/utils/enveomics/Scripts/lib/enveomics_rb/enveomics.rb +0 -24
- data/utils/enveomics/Scripts/lib/enveomics_rb/jplace.rb +0 -253
- data/utils/enveomics/Scripts/lib/enveomics_rb/og.rb +0 -182
- data/utils/enveomics/Scripts/lib/enveomics_rb/remote_data.rb +0 -74
- data/utils/enveomics/Scripts/lib/enveomics_rb/seq_range.rb +0 -237
- data/utils/enveomics/Scripts/lib/enveomics_rb/stat.rb +0 -30
- data/utils/enveomics/Scripts/lib/enveomics_rb/vcf.rb +0 -135
- data/utils/enveomics/Scripts/ogs.annotate.rb +0 -88
- data/utils/enveomics/Scripts/ogs.core-pan.rb +0 -160
- data/utils/enveomics/Scripts/ogs.extract.rb +0 -125
- data/utils/enveomics/Scripts/ogs.mcl.rb +0 -186
- data/utils/enveomics/Scripts/ogs.rb +0 -104
- data/utils/enveomics/Scripts/ogs.stats.rb +0 -131
- data/utils/enveomics/Scripts/rbm.rb +0 -146
- data/utils/enveomics/Tests/Makefile +0 -10
- data/utils/enveomics/Tests/Mgen_M2288.faa +0 -3189
- data/utils/enveomics/Tests/Mgen_M2288.fna +0 -8282
- data/utils/enveomics/Tests/Mgen_M2321.fna +0 -8288
- data/utils/enveomics/Tests/Nequ_Kin4M.faa +0 -2970
- data/utils/enveomics/Tests/Xanthomonas_oryzae-PilA.tribs.Rdata +0 -0
- data/utils/enveomics/Tests/Xanthomonas_oryzae-PilA.txt +0 -7
- data/utils/enveomics/Tests/Xanthomonas_oryzae.aai-mat.tsv +0 -17
- data/utils/enveomics/Tests/Xanthomonas_oryzae.aai.tsv +0 -137
- data/utils/enveomics/Tests/a_mg.cds-go.blast.tsv +0 -123
- data/utils/enveomics/Tests/a_mg.reads-cds.blast.tsv +0 -200
- data/utils/enveomics/Tests/a_mg.reads-cds.counts.tsv +0 -55
- data/utils/enveomics/Tests/alkB.nwk +0 -1
- data/utils/enveomics/Tests/anthrax-cansnp-data.tsv +0 -13
- data/utils/enveomics/Tests/anthrax-cansnp-key.tsv +0 -17
- data/utils/enveomics/Tests/hiv1.faa +0 -59
- data/utils/enveomics/Tests/hiv1.fna +0 -134
- data/utils/enveomics/Tests/hiv2.faa +0 -70
- data/utils/enveomics/Tests/hiv_mix-hiv1.blast.tsv +0 -233
- data/utils/enveomics/Tests/hiv_mix-hiv1.blast.tsv.lim +0 -1
- data/utils/enveomics/Tests/hiv_mix-hiv1.blast.tsv.rec +0 -233
- data/utils/enveomics/Tests/phyla_counts.tsv +0 -10
- data/utils/enveomics/Tests/primate_lentivirus.ogs +0 -11
- data/utils/enveomics/Tests/primate_lentivirus.rbm/hiv1-hiv1.rbm +0 -9
- data/utils/enveomics/Tests/primate_lentivirus.rbm/hiv1-hiv2.rbm +0 -8
- data/utils/enveomics/Tests/primate_lentivirus.rbm/hiv1-siv.rbm +0 -6
- data/utils/enveomics/Tests/primate_lentivirus.rbm/hiv2-hiv2.rbm +0 -9
- data/utils/enveomics/Tests/primate_lentivirus.rbm/hiv2-siv.rbm +0 -6
- data/utils/enveomics/Tests/primate_lentivirus.rbm/siv-siv.rbm +0 -6
- data/utils/enveomics/build_enveomics_r.bash +0 -45
- data/utils/enveomics/enveomics.R/DESCRIPTION +0 -31
- data/utils/enveomics/enveomics.R/NAMESPACE +0 -39
- data/utils/enveomics/enveomics.R/R/autoprune.R +0 -155
- data/utils/enveomics/enveomics.R/R/barplot.R +0 -184
- data/utils/enveomics/enveomics.R/R/cliopts.R +0 -135
- data/utils/enveomics/enveomics.R/R/df2dist.R +0 -154
- data/utils/enveomics/enveomics.R/R/growthcurve.R +0 -331
- data/utils/enveomics/enveomics.R/R/recplot.R +0 -354
- data/utils/enveomics/enveomics.R/R/recplot2.R +0 -1631
- data/utils/enveomics/enveomics.R/R/tribs.R +0 -583
- data/utils/enveomics/enveomics.R/R/utils.R +0 -50
- data/utils/enveomics/enveomics.R/README.md +0 -80
- data/utils/enveomics/enveomics.R/data/growth.curves.rda +0 -0
- data/utils/enveomics/enveomics.R/data/phyla.counts.rda +0 -0
- data/utils/enveomics/enveomics.R/man/cash-enve.GrowthCurve-method.Rd +0 -17
- data/utils/enveomics/enveomics.R/man/cash-enve.RecPlot2-method.Rd +0 -17
- data/utils/enveomics/enveomics.R/man/cash-enve.RecPlot2.Peak-method.Rd +0 -17
- data/utils/enveomics/enveomics.R/man/enve.GrowthCurve-class.Rd +0 -25
- data/utils/enveomics/enveomics.R/man/enve.TRIBS-class.Rd +0 -46
- data/utils/enveomics/enveomics.R/man/enve.TRIBS.merge.Rd +0 -23
- data/utils/enveomics/enveomics.R/man/enve.TRIBStest-class.Rd +0 -47
- data/utils/enveomics/enveomics.R/man/enve.__prune.iter.Rd +0 -23
- data/utils/enveomics/enveomics.R/man/enve.__prune.reduce.Rd +0 -23
- data/utils/enveomics/enveomics.R/man/enve.__tribs.Rd +0 -32
- data/utils/enveomics/enveomics.R/man/enve.barplot.Rd +0 -91
- data/utils/enveomics/enveomics.R/man/enve.cliopts.Rd +0 -57
- data/utils/enveomics/enveomics.R/man/enve.col.alpha.Rd +0 -24
- data/utils/enveomics/enveomics.R/man/enve.col2alpha.Rd +0 -19
- data/utils/enveomics/enveomics.R/man/enve.df2dist.Rd +0 -39
- data/utils/enveomics/enveomics.R/man/enve.df2dist.group.Rd +0 -38
- data/utils/enveomics/enveomics.R/man/enve.df2dist.list.Rd +0 -40
- data/utils/enveomics/enveomics.R/man/enve.growthcurve.Rd +0 -67
- data/utils/enveomics/enveomics.R/man/enve.prune.dist.Rd +0 -37
- data/utils/enveomics/enveomics.R/man/enve.recplot.Rd +0 -122
- data/utils/enveomics/enveomics.R/man/enve.recplot2-class.Rd +0 -45
- data/utils/enveomics/enveomics.R/man/enve.recplot2.ANIr.Rd +0 -24
- data/utils/enveomics/enveomics.R/man/enve.recplot2.Rd +0 -68
- data/utils/enveomics/enveomics.R/man/enve.recplot2.__counts.Rd +0 -25
- data/utils/enveomics/enveomics.R/man/enve.recplot2.__peakHist.Rd +0 -21
- data/utils/enveomics/enveomics.R/man/enve.recplot2.__whichClosestPeak.Rd +0 -19
- data/utils/enveomics/enveomics.R/man/enve.recplot2.changeCutoff.Rd +0 -19
- data/utils/enveomics/enveomics.R/man/enve.recplot2.compareIdentities.Rd +0 -41
- data/utils/enveomics/enveomics.R/man/enve.recplot2.coordinates.Rd +0 -29
- data/utils/enveomics/enveomics.R/man/enve.recplot2.corePeak.Rd +0 -18
- data/utils/enveomics/enveomics.R/man/enve.recplot2.extractWindows.Rd +0 -40
- data/utils/enveomics/enveomics.R/man/enve.recplot2.findPeaks.Rd +0 -36
- data/utils/enveomics/enveomics.R/man/enve.recplot2.findPeaks.__em_e.Rd +0 -19
- data/utils/enveomics/enveomics.R/man/enve.recplot2.findPeaks.__em_m.Rd +0 -19
- data/utils/enveomics/enveomics.R/man/enve.recplot2.findPeaks.__emauto_one.Rd +0 -27
- data/utils/enveomics/enveomics.R/man/enve.recplot2.findPeaks.__mow_one.Rd +0 -41
- data/utils/enveomics/enveomics.R/man/enve.recplot2.findPeaks.__mower.Rd +0 -17
- data/utils/enveomics/enveomics.R/man/enve.recplot2.findPeaks.em.Rd +0 -43
- data/utils/enveomics/enveomics.R/man/enve.recplot2.findPeaks.emauto.Rd +0 -37
- data/utils/enveomics/enveomics.R/man/enve.recplot2.findPeaks.mower.Rd +0 -74
- data/utils/enveomics/enveomics.R/man/enve.recplot2.peak-class.Rd +0 -59
- data/utils/enveomics/enveomics.R/man/enve.recplot2.seqdepth.Rd +0 -27
- data/utils/enveomics/enveomics.R/man/enve.recplot2.windowDepthThreshold.Rd +0 -32
- data/utils/enveomics/enveomics.R/man/enve.tribs.Rd +0 -59
- data/utils/enveomics/enveomics.R/man/enve.tribs.test.Rd +0 -28
- data/utils/enveomics/enveomics.R/man/enve.truncate.Rd +0 -27
- data/utils/enveomics/enveomics.R/man/growth.curves.Rd +0 -14
- data/utils/enveomics/enveomics.R/man/phyla.counts.Rd +0 -13
- data/utils/enveomics/enveomics.R/man/plot.enve.GrowthCurve.Rd +0 -63
- data/utils/enveomics/enveomics.R/man/plot.enve.TRIBS.Rd +0 -38
- data/utils/enveomics/enveomics.R/man/plot.enve.TRIBStest.Rd +0 -38
- data/utils/enveomics/enveomics.R/man/plot.enve.recplot2.Rd +0 -111
- data/utils/enveomics/enveomics.R/man/summary.enve.GrowthCurve.Rd +0 -19
- data/utils/enveomics/enveomics.R/man/summary.enve.TRIBS.Rd +0 -19
- data/utils/enveomics/enveomics.R/man/summary.enve.TRIBStest.Rd +0 -19
- data/utils/enveomics/globals.mk +0 -8
- data/utils/enveomics/manifest.json +0 -9
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dda80476da72166bd5eb6bc22a5ae7afc94285a58afe312633a06115e7336d80
|
|
4
|
+
data.tar.gz: 176c5a3c167232bb221b778b2bb3762c6795893171740dbff83b899d68034cd9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 90b69b23c515e7f8ce2508b5c719856112e2b874876c81bc18767fa5b384d3d6b2e1b819b313f7afbc6d9260ddbaf9b143bd3503c641eed29f1738197837c13b
|
|
7
|
+
data.tar.gz: f25b7224d1b37c386e0d4776a40be0a05496bfa9fd9715c59722794e298405280b3043ac26f7cbd5d033090673776b93a7744610aa24fd0bf7331329f0561e64
|
data/lib/miga/cli/action/add.rb
CHANGED
|
@@ -6,10 +6,7 @@ require 'miga/cli/action'
|
|
|
6
6
|
class MiGA::Cli::Action::Add < MiGA::Cli::Action
|
|
7
7
|
def parse_cli
|
|
8
8
|
cli.expect_files = true
|
|
9
|
-
cli.defaults = {
|
|
10
|
-
ref: true, ignore_dups: false,
|
|
11
|
-
regexp: MiGA::Cli.FILE_REGEXP
|
|
12
|
-
}
|
|
9
|
+
cli.defaults = { ref: true, ignore_dups: false }
|
|
13
10
|
cli.parse do |opt|
|
|
14
11
|
opt.separator 'You can create multiple datasets with a single command; ' \
|
|
15
12
|
'simply pass all the files at the end: {FILES...}'
|
|
@@ -37,7 +34,10 @@ class MiGA::Cli::Action::Add < MiGA::Cli::Action
|
|
|
37
34
|
opt.on(
|
|
38
35
|
'-R', '--name-regexp REGEXP', Regexp,
|
|
39
36
|
'Regular expression indicating how to extract the name from the path',
|
|
40
|
-
|
|
37
|
+
'By default for paired files:',
|
|
38
|
+
"'#{MiGA::Cli.FILE_REGEXP(true)}'",
|
|
39
|
+
'By default for other files:',
|
|
40
|
+
"'#{MiGA::Cli.FILE_REGEXP}'"
|
|
41
41
|
) { |v| cli[:regexp] = v }
|
|
42
42
|
opt.on(
|
|
43
43
|
'--prefix STRING',
|
|
@@ -59,6 +59,9 @@ class MiGA::Cli::Action::Add < MiGA::Cli::Action
|
|
|
59
59
|
p = cli.load_project
|
|
60
60
|
files, file_type = get_files_and_type
|
|
61
61
|
|
|
62
|
+
paired = cli[:input_type].to_s.include?('_paired')
|
|
63
|
+
cli[:regexp] ||= MiGA::Cli.FILE_REGEXP(paired)
|
|
64
|
+
|
|
62
65
|
cli.say 'Creating datasets:'
|
|
63
66
|
files.each do |file|
|
|
64
67
|
d = create_dataset(file, p)
|
|
@@ -166,7 +169,7 @@ class MiGA::Cli::Action::Add < MiGA::Cli::Action
|
|
|
166
169
|
file_type[2].each_with_index do |ext, i|
|
|
167
170
|
gz = file[i] =~ /\.gz/ ? '.gz' : ''
|
|
168
171
|
FileUtils.cp(file[i], "#{r_path}#{ext}#{gz}")
|
|
169
|
-
cli.say " file: #{file[i]}"
|
|
172
|
+
cli.say " file: #{File.basename(file[i])}"
|
|
170
173
|
end
|
|
171
174
|
File.open("#{r_path}.done", 'w') { |f| f.print Time.now.to_s }
|
|
172
175
|
end
|
|
@@ -55,7 +55,7 @@ class MiGA::Cli::Action::DerepWf < MiGA::Cli::Action
|
|
|
55
55
|
{ run_project_stats: false, run_clades: false },
|
|
56
56
|
{ run_mytaxa_scan: false, run_ssu: false }
|
|
57
57
|
)
|
|
58
|
-
p.set_option(:gsp_metric, cli[:metric])
|
|
58
|
+
p.set_option(:gsp_metric, cli[:metric].to_s)
|
|
59
59
|
p.set_option(:"gsp_#{cli[:metric]}", cli[:threshold])
|
|
60
60
|
|
|
61
61
|
# Run
|
|
@@ -16,8 +16,10 @@ class MiGA::Cli::Action::IndexWf < MiGA::Cli::Action
|
|
|
16
16
|
'Perform MyTaxa scan analysis'
|
|
17
17
|
) { |v| cli[:mytaxa] = v }
|
|
18
18
|
opts_for_wf_distances(opt)
|
|
19
|
-
opts_for_wf(
|
|
20
|
-
|
|
19
|
+
opts_for_wf(
|
|
20
|
+
opt, 'Input genome assemblies (nucleotides, FastA)',
|
|
21
|
+
cleanup: false, project_type: true
|
|
22
|
+
)
|
|
21
23
|
end
|
|
22
24
|
end
|
|
23
25
|
|
data/lib/miga/cli/action/init.rb
CHANGED
|
@@ -14,6 +14,8 @@ class MiGA::Cli::Action::Init < MiGA::Cli::Action
|
|
|
14
14
|
cli.defaults = {
|
|
15
15
|
mytaxa: nil,
|
|
16
16
|
rdp: nil,
|
|
17
|
+
reads: nil,
|
|
18
|
+
optional: nil,
|
|
17
19
|
config: File.join(ENV['MIGA_HOME'], '.miga_modules'),
|
|
18
20
|
ask: false,
|
|
19
21
|
auto: false,
|
|
@@ -35,6 +37,16 @@ class MiGA::Cli::Action::Init < MiGA::Cli::Action
|
|
|
35
37
|
'Should I try setting up the RDP classifier?',
|
|
36
38
|
'By default: interactive (true if --auto)'
|
|
37
39
|
) { |v| cli[:rdp] = v }
|
|
40
|
+
opt.on(
|
|
41
|
+
'--[no-]read-processing',
|
|
42
|
+
'Should I try setting up read processing software?',
|
|
43
|
+
'By default: interactive (true if --auto)'
|
|
44
|
+
) { |v| cli[:reads] = v }
|
|
45
|
+
opt.on(
|
|
46
|
+
'--[no-]optional',
|
|
47
|
+
'Should I try setting up the optional software?',
|
|
48
|
+
'Automatically sets answers for mytaxa, rdp, and reads'
|
|
49
|
+
) { |v| cli[:optional] = v }
|
|
38
50
|
opt.on(
|
|
39
51
|
'--daemon-type STRING',
|
|
40
52
|
'Type of daemon launcher, one of: bash, ssh, qsub, msub, slurm',
|
|
@@ -61,8 +73,7 @@ class MiGA::Cli::Action::Init < MiGA::Cli::Action
|
|
|
61
73
|
check_configuration_script(rc_fh)
|
|
62
74
|
paths = check_software_requirements(rc_fh)
|
|
63
75
|
check_additional_files(paths)
|
|
64
|
-
|
|
65
|
-
check_ruby_gems(paths)
|
|
76
|
+
check_libraries(paths)
|
|
66
77
|
configure_daemon
|
|
67
78
|
close_rc_file(rc_fh)
|
|
68
79
|
cli.puts 'Configuration complete. MiGA is ready to work!'
|
|
@@ -83,34 +94,6 @@ class MiGA::Cli::Action::Init < MiGA::Cli::Action
|
|
|
83
94
|
)
|
|
84
95
|
end
|
|
85
96
|
|
|
86
|
-
def test_r_package(cli, paths, pkg)
|
|
87
|
-
run_r_cmd(cli, paths, "library('#{pkg}')")
|
|
88
|
-
$?.success?
|
|
89
|
-
end
|
|
90
|
-
|
|
91
|
-
def install_r_package(cli, paths, pkg)
|
|
92
|
-
r_cmd = "install.packages('#{pkg}', repos='http://cran.rstudio.com/')"
|
|
93
|
-
run_r_cmd(cli, paths, r_cmd)
|
|
94
|
-
end
|
|
95
|
-
|
|
96
|
-
def test_ruby_gem(cli, paths, pkg)
|
|
97
|
-
run_cmd(
|
|
98
|
-
cli,
|
|
99
|
-
"#{paths['ruby'].shellescape} -r #{pkg.shellescape} -e '' 2>/dev/null"
|
|
100
|
-
)
|
|
101
|
-
$?.success?
|
|
102
|
-
end
|
|
103
|
-
|
|
104
|
-
def install_ruby_gem(cli, paths, pkg)
|
|
105
|
-
gem_cmd = "Gem::GemRunner.new.run %w(install --user #{pkg})"
|
|
106
|
-
run_cmd(
|
|
107
|
-
cli,
|
|
108
|
-
"#{paths['ruby'].shellescape} \
|
|
109
|
-
-r rubygems -r rubygems/gem_runner \
|
|
110
|
-
-e #{gem_cmd.shellescape} 2>&1"
|
|
111
|
-
)
|
|
112
|
-
end
|
|
113
|
-
|
|
114
97
|
def list_requirements
|
|
115
98
|
if cli.ask_user(
|
|
116
99
|
'Would you like to see all the requirements before starting?',
|
|
@@ -133,6 +116,8 @@ class MiGA::Cli::Action::Init < MiGA::Cli::Action
|
|
|
133
116
|
rc_fh.puts "export MIGA_MYTAXA='#{cli[:mytaxa] ? 'yes' : 'no'}'"
|
|
134
117
|
ask_for_optional(:rdp, 'RDP classifier')
|
|
135
118
|
rc_fh.puts "export MIGA_RDP='#{cli[:rdp] ? 'yes' : 'no'}'"
|
|
119
|
+
ask_for_optional(:reads, 'read processing')
|
|
120
|
+
rc_fh.puts "export MIGA_READS='#{cli[:reads] ? 'yes' : 'no'}'"
|
|
136
121
|
paths = {}
|
|
137
122
|
rc_fh.puts 'MIGA_PATH=""'
|
|
138
123
|
req_path = File.expand_path('utils/requirements.txt', MiGA.root_path)
|
|
@@ -152,20 +137,20 @@ class MiGA::Cli::Action::Init < MiGA::Cli::Action
|
|
|
152
137
|
def define_software(ln)
|
|
153
138
|
r = ln.chomp.split(/\t+/)
|
|
154
139
|
return if %w[Software --------].include?(r[0])
|
|
155
|
-
return if r[0] =~ /\(
|
|
156
|
-
return if r[0] =~ /\(rdp\)$/ && !cli[:rdp]
|
|
140
|
+
%i[mytaxa rdp reads].each { |i| return if r[0] =~ /\(#{i}\)$/ && !cli[i] }
|
|
157
141
|
|
|
158
142
|
r
|
|
159
143
|
end
|
|
160
144
|
|
|
161
145
|
def ask_for_optional(symbol, name)
|
|
162
|
-
if cli[symbol].nil?
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
146
|
+
cli[symbol] = cli[:optional] if !cli[:optional].nil? && cli[symbol].nil?
|
|
147
|
+
return cli[symbol] unless cli[symbol].nil?
|
|
148
|
+
|
|
149
|
+
cli[symbol] =
|
|
150
|
+
cli.ask_user(
|
|
151
|
+
"Should I include #{name} modules?",
|
|
152
|
+
'yes', %w(yes no)
|
|
153
|
+
) == 'yes'
|
|
169
154
|
end
|
|
170
155
|
|
|
171
156
|
def find_software(exec)
|
|
@@ -189,40 +174,70 @@ class MiGA::Cli::Action::Init < MiGA::Cli::Action
|
|
|
189
174
|
path
|
|
190
175
|
end
|
|
191
176
|
|
|
192
|
-
def
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
end
|
|
177
|
+
def check_libraries(paths)
|
|
178
|
+
req_libraries = {
|
|
179
|
+
r: %w[ape cluster vegan],
|
|
180
|
+
ruby: %w[sqlite3 daemons json],
|
|
181
|
+
python: %w[numpy]
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
req_libraries.each do |language, libraries|
|
|
185
|
+
cli.puts "Looking for #{language.to_s.capitalize} libraries:"
|
|
186
|
+
libraries.each do |lib|
|
|
187
|
+
check_and_install_library(paths, language, lib)
|
|
204
188
|
end
|
|
189
|
+
cli.puts ''
|
|
205
190
|
end
|
|
206
|
-
cli.puts ''
|
|
207
191
|
end
|
|
208
192
|
|
|
209
|
-
def
|
|
210
|
-
cli.
|
|
211
|
-
|
|
212
|
-
cli.
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
# on the configuration Ruby, not on the Ruby currently executing the
|
|
219
|
-
# init action
|
|
220
|
-
cli.print install_ruby_gem(cli, paths, pkg)
|
|
221
|
-
unless test_ruby_gem(cli, paths, pkg)
|
|
222
|
-
raise "Unable to auto-install Ruby gem: #{pkg}"
|
|
223
|
-
end
|
|
193
|
+
def check_and_install_library(paths, language, library)
|
|
194
|
+
cli.print "Testing #{library}... "
|
|
195
|
+
if test_library(cli, paths, language, library)
|
|
196
|
+
cli.puts 'yes'
|
|
197
|
+
else
|
|
198
|
+
cli.puts 'no, installing'
|
|
199
|
+
cli.print '' + install_library(cli, paths, language, library)
|
|
200
|
+
unless test_library(cli, paths, language, library)
|
|
201
|
+
raise "Cannot install #{language.to_s.capitalize} library: #{library}"
|
|
224
202
|
end
|
|
225
203
|
end
|
|
226
|
-
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
def test_library(cli, paths, language, pkg)
|
|
207
|
+
case language
|
|
208
|
+
when :r
|
|
209
|
+
run_r_cmd(cli, paths, "library('#{pkg}')")
|
|
210
|
+
when :ruby
|
|
211
|
+
x = "#{paths['ruby'].shellescape} -r #{pkg.shellescape} -e '' 2>/dev/null"
|
|
212
|
+
run_cmd(cli, x)
|
|
213
|
+
when :python
|
|
214
|
+
x = "#{paths['python3'].shellescape} -c 'import #{pkg}' 2>/dev/null"
|
|
215
|
+
run_cmd(cli, x)
|
|
216
|
+
else
|
|
217
|
+
raise "Unrecognized language: #{language}"
|
|
218
|
+
end
|
|
219
|
+
$?.success?
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
def install_library(cli, paths, language, pkg)
|
|
223
|
+
case language
|
|
224
|
+
when :r
|
|
225
|
+
r_cmd = "install.packages('#{pkg}', repos='http://cran.rstudio.com/')"
|
|
226
|
+
run_r_cmd(cli, paths, r_cmd)
|
|
227
|
+
when :ruby
|
|
228
|
+
# This hackey mess is meant to ensure the test and installation are done
|
|
229
|
+
# on the configuration Ruby, not on the Ruby currently executing the
|
|
230
|
+
# init action
|
|
231
|
+
gem_cmd = "Gem::GemRunner.new.run %w(install --user #{pkg})"
|
|
232
|
+
x = "#{paths['ruby'].shellescape} -r rubygems -r rubygems/gem_runner \
|
|
233
|
+
-e #{gem_cmd.shellescape} 2>&1"
|
|
234
|
+
run_cmd(cli, x)
|
|
235
|
+
when :python
|
|
236
|
+
x = "#{paths['python3'].shellescape} \
|
|
237
|
+
-m pip install --user #{pkg.shellescape} 2>&1"
|
|
238
|
+
run_cmd(cli, x)
|
|
239
|
+
else
|
|
240
|
+
raise "Unrecognized language: #{language}"
|
|
241
|
+
end
|
|
227
242
|
end
|
|
228
243
|
end
|
|
@@ -26,7 +26,7 @@ module MiGA::Cli::Action::Init::FilesHelper
|
|
|
26
26
|
def close_rc_file(rc_fh)
|
|
27
27
|
rc_fh.puts <<~FOOT
|
|
28
28
|
|
|
29
|
-
MIGA_CONFIG_VERSION='#{MiGA::MiGA.
|
|
29
|
+
MIGA_CONFIG_VERSION='#{MiGA::MiGA.FULL_VERSION}'
|
|
30
30
|
MIGA_CONFIG_LONGVERSION='#{MiGA::MiGA.LONG_VERSION}'
|
|
31
31
|
MIGA_CONFIG_DATE='#{Time.now}'
|
|
32
32
|
|
|
@@ -59,6 +59,7 @@ module MiGA::Cli::Action::Init::FilesHelper
|
|
|
59
59
|
end
|
|
60
60
|
check_rdp_classifier if cli[:rdp]
|
|
61
61
|
check_phyla_lite
|
|
62
|
+
cli.puts ''
|
|
62
63
|
end
|
|
63
64
|
|
|
64
65
|
def check_mytaxa_scores(paths)
|
|
@@ -17,6 +17,14 @@ class MiGA::Cli::Action::Option < MiGA::Cli::Action
|
|
|
17
17
|
'Value of the option to set (by default, option value is not changed)',
|
|
18
18
|
'Recognized tokens: nil, true, false'
|
|
19
19
|
) { |v| cli[:value] = v }
|
|
20
|
+
opt.on(
|
|
21
|
+
'--about',
|
|
22
|
+
'Print additional information about the values supported by this option'
|
|
23
|
+
) { |v| cli[:about] = v }
|
|
24
|
+
opt.on(
|
|
25
|
+
'--tab',
|
|
26
|
+
'Return a tab-delimited table'
|
|
27
|
+
) { |v| cli[:tabular] = v }
|
|
20
28
|
opt.on(
|
|
21
29
|
'-o', '--output PATH',
|
|
22
30
|
'Create output file instead of returning to STDOUT'
|
|
@@ -28,13 +36,24 @@ class MiGA::Cli::Action::Option < MiGA::Cli::Action
|
|
|
28
36
|
unless cli[:value].nil?
|
|
29
37
|
cli.ensure_par(
|
|
30
38
|
{ key: '-k' },
|
|
31
|
-
'%<name>s is mandatory when --value is set:
|
|
39
|
+
'%<name>s is mandatory when --value is set: provide %<flag>s'
|
|
32
40
|
)
|
|
33
41
|
end
|
|
34
42
|
obj = cli.load_project_or_dataset
|
|
35
43
|
io = cli[:output].nil? ? $stdout : File.open(cli[:output], 'w')
|
|
36
44
|
if cli[:key].nil?
|
|
37
|
-
|
|
45
|
+
opts = obj.all_options
|
|
46
|
+
.map { |k, v| [k, v, obj.assert_has_option(k)[:desc]] }
|
|
47
|
+
cli.table(%w[Key Value Definition], opts, io)
|
|
48
|
+
elsif cli[:about]
|
|
49
|
+
opt = obj.assert_has_option(cli[:key])
|
|
50
|
+
title = "#{cli[:key]}: #{opt[:desc]}"
|
|
51
|
+
io.puts title
|
|
52
|
+
io.puts '-' * title.length
|
|
53
|
+
opt.each do |k, v|
|
|
54
|
+
v = v[obj] if v.is_a? Proc
|
|
55
|
+
io.puts "#{k.to_s.capitalize}: #{v}" unless k == :desc
|
|
56
|
+
end
|
|
38
57
|
else
|
|
39
58
|
obj.set_option(cli[:key], cli[:value], true) unless cli[:value].nil?
|
|
40
59
|
io.puts obj.option(cli[:key])
|
|
@@ -21,18 +21,20 @@ class MiGA::Cli::Action::PreprocWf < MiGA::Cli::Action
|
|
|
21
21
|
'-m', '--mytaxa_scan',
|
|
22
22
|
'Perform MyTaxa scan analysis'
|
|
23
23
|
) { |v| cli[:mytaxa] = v }
|
|
24
|
-
opts_for_wf(
|
|
25
|
-
|
|
24
|
+
opts_for_wf(
|
|
25
|
+
opt, 'Input files as defined by --input-type',
|
|
26
|
+
multi: true, cleanup: false, ncbi: false, project_type: true
|
|
27
|
+
)
|
|
26
28
|
end
|
|
27
29
|
end
|
|
28
30
|
|
|
29
31
|
def perform
|
|
30
32
|
# Input data
|
|
31
33
|
cli.ensure_par(input_type: '-i')
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
.map { |i| ["run_#{i}", false] }
|
|
34
|
+
norun = %w[
|
|
35
|
+
project_stats haai_distances aai_distances ani_distances clade_finding
|
|
35
36
|
]
|
|
37
|
+
p_metadata = Hash[norun.map { |i| ["run_#{i}", false] }]
|
|
36
38
|
d_metadata = { run_distances: false }
|
|
37
39
|
unless cli[:mytaxa]
|
|
38
40
|
d_metadata[:run_mytaxa_scan] = false
|
data/lib/miga/cli/action/wf.rb
CHANGED
|
@@ -7,8 +7,7 @@ module MiGA::Cli::Action::Wf
|
|
|
7
7
|
def default_opts_for_wf
|
|
8
8
|
cli.expect_files = true
|
|
9
9
|
cli.defaults = {
|
|
10
|
-
clean: false,
|
|
11
|
-
project_type: :genomes, dataset_type: :popgenome,
|
|
10
|
+
clean: false, project_type: :genomes, dataset_type: :popgenome,
|
|
12
11
|
ncbi_draft: true, min_qual: MiGA::Project.OPTIONS[:min_qual][:default]
|
|
13
12
|
}
|
|
14
13
|
end
|
|
@@ -56,28 +55,10 @@ module MiGA::Cli::Action::Wf
|
|
|
56
55
|
opt.on(
|
|
57
56
|
'-R', '--name-regexp REGEXP', Regexp,
|
|
58
57
|
'Regular expression indicating how to extract the name from the path',
|
|
59
|
-
"By default: '#{
|
|
58
|
+
"By default: '#{MiGA::Cli.FILE_REGEXP}'"
|
|
60
59
|
) { |v| cli[:regexp] = v }
|
|
61
|
-
opt
|
|
62
|
-
|
|
63
|
-
"Type of datasets. By default: #{cli[:dataset_type]}",
|
|
64
|
-
'Recognized types:',
|
|
65
|
-
*MiGA::Dataset.KNOWN_TYPES
|
|
66
|
-
.map do |k, v|
|
|
67
|
-
"~ #{k}: #{v[:description]}" unless !params[:multi] && v[:multi]
|
|
68
|
-
end.compact
|
|
69
|
-
) { |v| cli[:dataset_type] = v.downcase.to_sym }
|
|
70
|
-
if params[:project_type]
|
|
71
|
-
opt.on(
|
|
72
|
-
'--project-type STRING',
|
|
73
|
-
"Type of project. By default: #{cli[:project_type]}",
|
|
74
|
-
'Recognized types:',
|
|
75
|
-
*MiGA::Project.KNOWN_TYPES
|
|
76
|
-
.map do |k, v|
|
|
77
|
-
"~ #{k}: #{v[:description]}" unless !params[:multi] && v[:multi]
|
|
78
|
-
end.compact
|
|
79
|
-
) { |v| cli[:project_type] = v.downcase.to_sym }
|
|
80
|
-
end
|
|
60
|
+
opt_object_type(opt, :dataset, params[:multi])
|
|
61
|
+
opt_object_type(opt, :project, params[:multi]) if params[:project_type]
|
|
81
62
|
opt.on(
|
|
82
63
|
'--daemon PATH',
|
|
83
64
|
'Use custom daemon configuration in JSON format',
|
|
@@ -106,7 +87,7 @@ module MiGA::Cli::Action::Wf
|
|
|
106
87
|
end
|
|
107
88
|
opt.on(
|
|
108
89
|
'--haai-p STRING',
|
|
109
|
-
'hAAI search engine. One of: blast+ (default), blat, diamond, no'
|
|
90
|
+
'hAAI search engine. One of: blast+ (default), fastaai, blat, diamond, no'
|
|
110
91
|
) { |v| cli[:haai_p] = v }
|
|
111
92
|
opt.on(
|
|
112
93
|
'--aai-p STRING',
|
|
@@ -124,10 +105,14 @@ module MiGA::Cli::Action::Wf
|
|
|
124
105
|
project_type: '--project-type',
|
|
125
106
|
dataset_type: '--dataset-type'
|
|
126
107
|
)
|
|
108
|
+
paired = cli[:input_type].to_s.include?('_paired')
|
|
109
|
+
cli[:regexp] ||= MiGA::Cli.FILE_REGEXP(paired)
|
|
110
|
+
|
|
127
111
|
# Create empty project
|
|
128
112
|
call_cli(
|
|
129
113
|
['new', '-P', cli[:outdir], '-t', cli[:project_type]]
|
|
130
114
|
) unless MiGA::Project.exist? cli[:outdir]
|
|
115
|
+
|
|
131
116
|
# Define project metadata
|
|
132
117
|
p = cli.load_project(:outdir, '-o')
|
|
133
118
|
p_metadata[:type] = cli[:project_type]
|
|
@@ -135,6 +120,7 @@ module MiGA::Cli::Action::Wf
|
|
|
135
120
|
%i[haai_p aai_p ani_p ess_coll min_qual].each do |i|
|
|
136
121
|
p.set_option(i, cli[i])
|
|
137
122
|
end
|
|
123
|
+
|
|
138
124
|
# Download datasets
|
|
139
125
|
unless cli[:ncbi_taxon].nil?
|
|
140
126
|
what = cli[:ncbi_draft] ? '--all' : '--complete'
|
|
@@ -142,6 +128,7 @@ module MiGA::Cli::Action::Wf
|
|
|
142
128
|
['ncbi_get', '-P', cli[:outdir], '-T', cli[:ncbi_taxon], what]
|
|
143
129
|
)
|
|
144
130
|
end
|
|
131
|
+
|
|
145
132
|
# Add datasets
|
|
146
133
|
call_cli(
|
|
147
134
|
[
|
|
@@ -153,6 +140,7 @@ module MiGA::Cli::Action::Wf
|
|
|
153
140
|
'-R', cli[:regexp]
|
|
154
141
|
] + cli.files
|
|
155
142
|
) unless cli.files.empty?
|
|
143
|
+
|
|
156
144
|
# Define datasets metadata
|
|
157
145
|
p.load
|
|
158
146
|
d_metadata[:type] = cli[:dataset_type]
|
|
@@ -208,4 +196,32 @@ module MiGA::Cli::Action::Wf
|
|
|
208
196
|
md.each { |k, v| obj.metadata[k] = v }
|
|
209
197
|
obj.save
|
|
210
198
|
end
|
|
199
|
+
|
|
200
|
+
private
|
|
201
|
+
|
|
202
|
+
##
|
|
203
|
+
# Add option --type or --project-type to +opt+
|
|
204
|
+
def opt_object_type(opt, obj, multi)
|
|
205
|
+
conf =
|
|
206
|
+
case obj
|
|
207
|
+
when :dataset
|
|
208
|
+
['type', 'datasets', :dataset_type, MiGA::Dataset]
|
|
209
|
+
when :project
|
|
210
|
+
['project-type', 'project', :project_type, MiGA::Project]
|
|
211
|
+
else
|
|
212
|
+
raise "Unrecognized object type: #{obj}"
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
options =
|
|
216
|
+
conf[3].KNOWN_TYPES.map do |k, v|
|
|
217
|
+
"~ #{k}: #{v[:description]}" unless !multi && v[:multi]
|
|
218
|
+
end.compact
|
|
219
|
+
|
|
220
|
+
opt.on(
|
|
221
|
+
"--#{conf[0]} STRING",
|
|
222
|
+
"Type of #{conf[1]}. By default: #{cli[conf[2]]}",
|
|
223
|
+
'Recognized types:',
|
|
224
|
+
*options
|
|
225
|
+
) { |v| cli[conf[2]] = v.downcase.to_sym }
|
|
226
|
+
end
|
|
211
227
|
end
|