miga-base 1.2.15.1 → 1.2.15.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/miga/cli/action/download/gtdb.rb +4 -1
- data/lib/miga/cli/action/gtdb_get.rb +4 -0
- data/lib/miga/remote_dataset/download.rb +3 -2
- data/lib/miga/remote_dataset.rb +44 -8
- data/lib/miga/taxonomy.rb +6 -0
- data/lib/miga/version.rb +2 -2
- data/test/remote_dataset_test.rb +3 -1
- metadata +6 -302
- data/utils/FastAAI/00.Libraries/01.SCG_HMMs/Archaea_SCG.hmm +0 -41964
- data/utils/FastAAI/00.Libraries/01.SCG_HMMs/Bacteria_SCG.hmm +0 -32439
- data/utils/FastAAI/00.Libraries/01.SCG_HMMs/Complete_SCG_DB.hmm +0 -62056
- data/utils/FastAAI/FastAAI +0 -3659
- data/utils/FastAAI/FastAAI-legacy/FastAAI +0 -1336
- data/utils/FastAAI/FastAAI-legacy/kAAI_v1.0_virus.py +0 -1296
- data/utils/FastAAI/README.md +0 -84
- 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 -790
- data/utils/enveomics/Manifest/Tasks/distances.json +0 -161
- data/utils/enveomics/Manifest/Tasks/fasta.json +0 -802
- data/utils/enveomics/Manifest/Tasks/fastq.json +0 -291
- data/utils/enveomics/Manifest/Tasks/graphics.json +0 -126
- data/utils/enveomics/Manifest/Tasks/mapping.json +0 -137
- data/utils/enveomics/Manifest/Tasks/ogs.json +0 -382
- data/utils/enveomics/Manifest/Tasks/other.json +0 -906
- data/utils/enveomics/Manifest/Tasks/remote.json +0 -355
- data/utils/enveomics/Manifest/Tasks/sequence-identity.json +0 -650
- 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 -165
- data/utils/enveomics/Manifest/examples.json +0 -162
- 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 -221
- 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 -123
- 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 -60
- 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 -100
- 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 -98
- 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.toFastQ.rb +0 -69
- 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.maskQual.rb +0 -89
- 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 -70
- 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 -55
- 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.prefScore.R +0 -60
- 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 -421
- data/utils/enveomics/Scripts/ani.rb +0 -362
- data/utils/enveomics/Scripts/anir.rb +0 -137
- 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/anir.rb +0 -293
- data/utils/enveomics/Scripts/lib/enveomics_rb/bm_set.rb +0 -175
- data/utils/enveomics/Scripts/lib/enveomics_rb/enveomics.rb +0 -24
- data/utils/enveomics/Scripts/lib/enveomics_rb/errors.rb +0 -17
- data/utils/enveomics/Scripts/lib/enveomics_rb/gmm_em.rb +0 -30
- data/utils/enveomics/Scripts/lib/enveomics_rb/jplace.rb +0 -253
- data/utils/enveomics/Scripts/lib/enveomics_rb/match.rb +0 -88
- data/utils/enveomics/Scripts/lib/enveomics_rb/og.rb +0 -182
- data/utils/enveomics/Scripts/lib/enveomics_rb/rbm.rb +0 -49
- 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/stats/rand.rb +0 -31
- data/utils/enveomics/Scripts/lib/enveomics_rb/stats/sample.rb +0 -152
- data/utils/enveomics/Scripts/lib/enveomics_rb/stats.rb +0 -3
- data/utils/enveomics/Scripts/lib/enveomics_rb/utils.rb +0 -74
- 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-legacy.rb +0 -172
- data/utils/enveomics/Scripts/rbm.rb +0 -108
- data/utils/enveomics/Scripts/sam.filter.rb +0 -148
- 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/prefscore.R +0 -79
- 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 -80
- data/utils/enveomics/enveomics.R/README.md +0 -81
- 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 -16
- data/utils/enveomics/enveomics.R/man/cash-enve.RecPlot2-method.Rd +0 -16
- data/utils/enveomics/enveomics.R/man/cash-enve.RecPlot2.Peak-method.Rd +0 -16
- 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 -40
- data/utils/enveomics/enveomics.R/man/enve.barplot.Rd +0 -103
- data/utils/enveomics/enveomics.R/man/enve.cliopts.Rd +0 -67
- 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 -45
- data/utils/enveomics/enveomics.R/man/enve.df2dist.group.Rd +0 -44
- data/utils/enveomics/enveomics.R/man/enve.df2dist.list.Rd +0 -47
- data/utils/enveomics/enveomics.R/man/enve.growthcurve.Rd +0 -75
- data/utils/enveomics/enveomics.R/man/enve.prefscore.Rd +0 -50
- data/utils/enveomics/enveomics.R/man/enve.prune.dist.Rd +0 -44
- data/utils/enveomics/enveomics.R/man/enve.recplot.Rd +0 -139
- 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 -77
- 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 -47
- 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 -45
- 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 -52
- 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 -51
- data/utils/enveomics/enveomics.R/man/enve.recplot2.findPeaks.emauto.Rd +0 -43
- data/utils/enveomics/enveomics.R/man/enve.recplot2.findPeaks.mower.Rd +0 -82
- 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 -36
- data/utils/enveomics/enveomics.R/man/enve.selvector.Rd +0 -23
- data/utils/enveomics/enveomics.R/man/enve.tribs.Rd +0 -68
- 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 -78
- data/utils/enveomics/enveomics.R/man/plot.enve.TRIBS.Rd +0 -46
- data/utils/enveomics/enveomics.R/man/plot.enve.TRIBStest.Rd +0 -45
- data/utils/enveomics/enveomics.R/man/plot.enve.recplot2.Rd +0 -125
- 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
- data/utils/multitrim/Multitrim How-To.pdf +0 -0
- data/utils/multitrim/README.md +0 -67
- data/utils/multitrim/multitrim.py +0 -1555
- data/utils/multitrim/multitrim.yml +0 -13
@@ -1,184 +0,0 @@
|
|
1
|
-
#' Enveomics: Barplot
|
2
|
-
#'
|
3
|
-
#' Creates nice barplots from tab-delimited tables.
|
4
|
-
#'
|
5
|
-
#' @param x Can be either the input data or the path to the file containing
|
6
|
-
#' the table.
|
7
|
-
#' \itemize{
|
8
|
-
#' \item{If it contains the data, it must be a data frame or an
|
9
|
-
#' object coercible to a data frame.}
|
10
|
-
#' \item{If it is a path, it must point to a
|
11
|
-
#' tab-delimited file containing a header (first row) and row names
|
12
|
-
#' (first column).}
|
13
|
-
#' }
|
14
|
-
#' @param sizes A numeric vector containing the real size of the samples
|
15
|
-
#' (columns) in the same order of the input table. If set, the values are
|
16
|
-
#' assumed to be 100\%. Otherwise, the sum of the columns is used.
|
17
|
-
#' @param top Maximum number of categories to display. Any additional
|
18
|
-
#' categories will be listed as "Others".
|
19
|
-
#' @param colors.per.group Number of categories in the first two saturation
|
20
|
-
#' groups of colors. The third group contains the remaining categories if
|
21
|
-
#' needed.
|
22
|
-
#' @param bars.width Width of the barplot with respect to the legend.
|
23
|
-
#' @param legend.ncol Number of columns in the legend.
|
24
|
-
#' @param other.col Color of the "Others" category.
|
25
|
-
#' @param add.trend Controls if semi-transparent areas are to be plotted
|
26
|
-
#' between the bars to connect the regions (trend regions).
|
27
|
-
#' @param organic.trend Controls if the trend regions are to be smoothed
|
28
|
-
#' (curves). By default, trend regions have straight edges. If \code{TRUE},
|
29
|
-
#' forces \code{add.trend=TRUE}.
|
30
|
-
#' @param sort.by Any function that takes a numeric vector and returns a
|
31
|
-
#' numeric scalar. This function is applied to each row, and the resulting
|
32
|
-
#' values are used to sort the rows (decreasingly). Good options include:
|
33
|
-
#' \code{sd, min, max, mean, median}.
|
34
|
-
#' @param min.report Minimum percentage to report the value in the plot.
|
35
|
-
#' Any value above 100 indicates that no values are to be reported.
|
36
|
-
#' @param order Controls how the rows should be ordered.
|
37
|
-
#' \itemize{
|
38
|
-
#' \item{If \code{NULL}
|
39
|
-
#' (default), \code{sort.by} is applied per row and the results are
|
40
|
-
#' sorted decreasingly.}
|
41
|
-
#' \item{If \code{NA}, no sorting is performed, i.e., the original
|
42
|
-
#' order is respected.}
|
43
|
-
#' \item{If a vector is provided, it is assumed to be the
|
44
|
-
#' custom order to be used (either by numeric index or by row names).}
|
45
|
-
#' }
|
46
|
-
#' @param col Colors to use. If provided, overrides the variables \code{top}
|
47
|
-
#' and \code{colors.per.group}, but \code{other.col} is still used if the
|
48
|
-
#' vector is insufficient for all the rows. An additional palette is available with
|
49
|
-
#' \code{col='coto'} (contributed by Luis (Coto) Orellana).
|
50
|
-
#' @param ... Any additional parameters to be passed to barplot.
|
51
|
-
#'
|
52
|
-
#' @author Luis M. Rodriguez-R [aut, cre]
|
53
|
-
#'
|
54
|
-
#' @examples
|
55
|
-
#' # Load data
|
56
|
-
#' data("phyla.counts", package="enveomics.R", envir=environment())
|
57
|
-
#' # Create a barplot sorted by variance with organic trends
|
58
|
-
#' enve.barplot(
|
59
|
-
#' phyla.counts, # Counts of phyla in four sites
|
60
|
-
#' sizes=c(250,100,75,200), # Total sizes of the datasets of each site
|
61
|
-
#' bars.width=2, # Decrease from default, so the names are fully displayed
|
62
|
-
#' organic.trend=TRUE, # Nice curvy background
|
63
|
-
#' sort.by=var # Sort by variance across sites
|
64
|
-
#' )
|
65
|
-
#'
|
66
|
-
#' @export
|
67
|
-
|
68
|
-
enve.barplot <- function(
|
69
|
-
x,
|
70
|
-
sizes,
|
71
|
-
top=25,
|
72
|
-
colors.per.group=9,
|
73
|
-
bars.width=4,
|
74
|
-
legend.ncol=1,
|
75
|
-
other.col='#000000',
|
76
|
-
add.trend=FALSE,
|
77
|
-
organic.trend=FALSE,
|
78
|
-
sort.by=median,
|
79
|
-
min.report=101,
|
80
|
-
order=NULL,
|
81
|
-
col,
|
82
|
-
...
|
83
|
-
){
|
84
|
-
|
85
|
-
# Read input
|
86
|
-
if(is.character(x)){
|
87
|
-
c <- read.table(x, sep='\t', header=TRUE, row.names=1, quote='',
|
88
|
-
comment.char='')
|
89
|
-
}else{
|
90
|
-
c <- as.data.frame(x)
|
91
|
-
}
|
92
|
-
if(missing(sizes)) sizes = colSums(c)
|
93
|
-
p <- c
|
94
|
-
for (i in 1:ncol(c)) p[, i] <- c[, i]*100/sizes[i]
|
95
|
-
if(top > nrow(p)) top = nrow(p)
|
96
|
-
|
97
|
-
# Sort
|
98
|
-
if(is.null(order[1])){
|
99
|
-
p <- p[order(apply(p, 1, sort.by)), ]
|
100
|
-
}else if(is.na(order[1])){
|
101
|
-
|
102
|
-
}else{
|
103
|
-
p <- p[order, ]
|
104
|
-
}
|
105
|
-
if(organic.trend) add.trend=TRUE
|
106
|
-
|
107
|
-
# Colors
|
108
|
-
if(is.null(top)) top <- nrow(p)
|
109
|
-
if(missing(col)){
|
110
|
-
color.col <- rainbow(min(colors.per.group, top), s=1, v=4/5)
|
111
|
-
if(top > colors.per.group) color.col <- c(color.col,
|
112
|
-
rainbow(min(colors.per.group*2, top)-colors.per.group, s=3/4, v=3/5))
|
113
|
-
if(top > colors.per.group*2) color.col <- c(color.col,
|
114
|
-
rainbow(top-colors.per.group*2, s=1, v=1.25/4))
|
115
|
-
}else if(length(col)==1 & col[1]=="coto"){
|
116
|
-
color.col <- c("#5BC0EB","#FDE74C","#9BC53D","#E55934","#FA7921","#EF476F",
|
117
|
-
"#FFD166","#06D6A0","#118AB2","#073B4C","#264653","#2A9D8F",
|
118
|
-
"#E9C46A","#F4A261","#E76F51")
|
119
|
-
color.col <- head(color.col, n=nrow(p))
|
120
|
-
top <- length(color.col)
|
121
|
-
}else{
|
122
|
-
color.col <- col
|
123
|
-
color.col <- tail(color.col, n=nrow(p))
|
124
|
-
top <- length(color.col)
|
125
|
-
}
|
126
|
-
|
127
|
-
# Plot
|
128
|
-
layout(matrix(1:2, nrow=1), widths=c(bars.width,1))
|
129
|
-
mar <- par('mar')
|
130
|
-
par(mar=c(5,4,4,0)+0.1)
|
131
|
-
mp <- barplot(as.matrix(p),
|
132
|
-
col=rev(c(color.col, rep(other.col, nrow(p)-length(color.col)))),
|
133
|
-
border=NA,space=ifelse(add.trend,ifelse(organic.trend,0.75,0.5),0.2), ...)
|
134
|
-
if(add.trend || min.report < max(p)){
|
135
|
-
color.alpha <- enve.col.alpha(c(color.col, other.col), 1/4)
|
136
|
-
if(top < nrow(p)){
|
137
|
-
cf <- colSums(p[1:(nrow(p)-top), ])
|
138
|
-
}else{
|
139
|
-
cf <- rep(0, ncol(p))
|
140
|
-
}
|
141
|
-
for(i in (nrow(p)-top+1):nrow(p)){
|
142
|
-
f <- as.numeric(p[i, ])
|
143
|
-
cf <- as.numeric(cf + f)
|
144
|
-
if(nrow(p)-i < top){
|
145
|
-
if(organic.trend){
|
146
|
-
spc <- 0.5
|
147
|
-
x <- c(mp[1]-spc)
|
148
|
-
y1 <- c(cf[1]-f[1])
|
149
|
-
y2 <- c(cf[1])
|
150
|
-
for(j in 2:ncol(p)){
|
151
|
-
x <- c(x, seq(mp[j-1]+spc, mp[j]-spc, length.out=22))
|
152
|
-
y1 <- c(y1, cf[j-1]-f[j-1],
|
153
|
-
(tanh(seq(-2.5,2.5,length.out=20))/2+.5)*
|
154
|
-
((cf[j]-f[j])-(cf[j-1]-f[j-1]))+(cf[j-1]-f[j-1]), cf[j]-f[j])
|
155
|
-
y2 <- c(y2, cf[j-1],
|
156
|
-
(tanh(seq(-2.5,2.5,length.out=20))/2+.5)*
|
157
|
-
(cf[j]-cf[j-1])+(cf[j-1]), cf[j])
|
158
|
-
}
|
159
|
-
x <- c(x, mp[length(mp)]+spc)
|
160
|
-
y1 <- c(y1, cf[length(cf)]-f[length(f)])
|
161
|
-
y2 <- c(y2, cf[length(cf)])
|
162
|
-
polygon(c(x, rev(x)), c(y1, rev(y2)), col=color.alpha[nrow(p)-i+1],
|
163
|
-
border=NA)
|
164
|
-
}else if(add.trend){
|
165
|
-
x <- rep(mp, each=2)+c(-0.5,0.5)
|
166
|
-
if(add.trend) polygon(c(x, rev(x)),
|
167
|
-
c(rep(cf-f, each=2), rev(rep(cf, each=2))),
|
168
|
-
col=color.alpha[nrow(p)-i+1], border=NA)
|
169
|
-
}
|
170
|
-
text(mp, cf-f/2, ifelse(f>min.report, signif(f, 3), ''), col='white')
|
171
|
-
}
|
172
|
-
}
|
173
|
-
}
|
174
|
-
|
175
|
-
# Legend
|
176
|
-
par(mar=rep(0,4)+0.1)
|
177
|
-
plot(1, t='n', bty='n', xlab='', ylab='', xaxt='n', yaxt='n')
|
178
|
-
nam <- rownames(p[nrow(p):(nrow(p)-top+1), ])
|
179
|
-
if(top < nrow(p)) nam <- c(nam,
|
180
|
-
paste('Other (',nrow(p)-length(color.col),')', sep=''))
|
181
|
-
legend('center', col=c(color.col, other.col), legend=nam, pch=15, bty='n',
|
182
|
-
pt.cex=2, ncol=legend.ncol)
|
183
|
-
par(mar=mar)
|
184
|
-
}
|
@@ -1,135 +0,0 @@
|
|
1
|
-
#' Enveomics: Cliopts
|
2
|
-
#'
|
3
|
-
#' Generates nicely formatted command-line interfaces for functions
|
4
|
-
#' (\strong{closures} only).
|
5
|
-
#'
|
6
|
-
#' @param fx Function for which the interface should be generated.
|
7
|
-
#' @param rd_file (Optional) .Rd file with the standard documentation of
|
8
|
-
#' the function.
|
9
|
-
#' @param positional_arguments (Optional) Number of \strong{positional}
|
10
|
-
#' arguments passed to \code{\link[optparse]{parse_args}}
|
11
|
-
#' (package: \pkg{optparse}).
|
12
|
-
#' @param usage (Optional) Usage passed to \code{\link[optparse]{OptionParser}}
|
13
|
-
#' (package: \pkg{optparse}).
|
14
|
-
#' @param mandatory Mandatory arguments.
|
15
|
-
#' @param vectorize Arguments of the function to vectorize (comma-delimited).
|
16
|
-
#' If numeric, use also \code{number}.
|
17
|
-
#' @param ignore Arguments of the function to ignore.
|
18
|
-
#' @param number Force these arguments as numerics. Useful for numeric
|
19
|
-
#' vectors (see \code{vectorize}) or arguments with no defaults.
|
20
|
-
#' @param defaults Defaults to use instead of the ones provided by the
|
21
|
-
#' formals.
|
22
|
-
#' @param o_desc Descriptions of the options. Help from \code{rd} is ignored
|
23
|
-
#' for arguments present in this list.
|
24
|
-
#' @param p_desc Description Description of the function. Help from \code{rd}
|
25
|
-
#' is ignored for the function description unless this value is an empty string.
|
26
|
-
#'
|
27
|
-
#' @return Returns a list with keys:
|
28
|
-
#' \itemize{
|
29
|
-
#' \item{\code{options}, a named list with the values for the function's
|
30
|
-
#' arguments}
|
31
|
-
#' \item{\code{args}, a vector with zero or more strings containing the
|
32
|
-
#' positional arguments}}
|
33
|
-
#'
|
34
|
-
#' @author Luis M. Rodriguez-R [aut, cre]
|
35
|
-
#'
|
36
|
-
#' @export
|
37
|
-
|
38
|
-
enve.cliopts <- function(
|
39
|
-
fx,
|
40
|
-
rd_file,
|
41
|
-
positional_arguments,
|
42
|
-
usage,
|
43
|
-
mandatory=c(),
|
44
|
-
vectorize=c(),
|
45
|
-
ignore=c(),
|
46
|
-
number=c(),
|
47
|
-
defaults=list(),
|
48
|
-
o_desc=list(),
|
49
|
-
p_desc=""
|
50
|
-
){
|
51
|
-
|
52
|
-
#= Load stuff
|
53
|
-
if(!suppressPackageStartupMessages(
|
54
|
-
requireNamespace("optparse", quietly=TRUE)))
|
55
|
-
stop("Package 'optparse' is required.")
|
56
|
-
requireNamespace("tools", quietly=TRUE)
|
57
|
-
if(missing(positional_arguments)) positional_arguments <- FALSE
|
58
|
-
if(missing(usage)) usage <- "usage: %prog [options]"
|
59
|
-
|
60
|
-
#= Get help (if any)
|
61
|
-
if(!missing(rd_file)){
|
62
|
-
rd <- tools::parse_Rd(rd_file)
|
63
|
-
for(i in 1:length(rd)){
|
64
|
-
tag <- attr(rd[[i]],'Rd_tag')
|
65
|
-
if(tag=="\\description" && p_desc==""){
|
66
|
-
p_desc <- paste("\n\t",as.character(rd[[i]]),sep='')
|
67
|
-
}else if(tag=="\\arguments"){
|
68
|
-
for(j in 1:length(rd[[i]])){
|
69
|
-
if(length(rd[[i]][[j]])==2){
|
70
|
-
name <- as.character(rd[[i]][[j]][[1]])
|
71
|
-
if(length(o_desc[[name]])==1) next
|
72
|
-
desc <- as.character(rd[[i]][[j]][[2]])
|
73
|
-
o_desc[[name]] <- paste(gsub("\n","\n\t\t",desc), collapse='')
|
74
|
-
}
|
75
|
-
}
|
76
|
-
}
|
77
|
-
}
|
78
|
-
}
|
79
|
-
|
80
|
-
#= Set options
|
81
|
-
o_i <- 0
|
82
|
-
opts <- list()
|
83
|
-
f <- formals(fx)
|
84
|
-
if(length(defaults)>0){
|
85
|
-
for(i in 1:length(defaults)) f[[names(defaults)[i]]] <- defaults[[i]]
|
86
|
-
}
|
87
|
-
for(i in names(f)){
|
88
|
-
if(i=="..." || i %in% ignore) next
|
89
|
-
o_i <- o_i + 1
|
90
|
-
flag <- gsub("\\.","-",i)
|
91
|
-
|
92
|
-
optopt <- list(help="")
|
93
|
-
if(length(o_desc[[i]])==1) optopt$help <- o_desc[[i]]
|
94
|
-
if(!is.null(f[[i]]) && !suppressWarnings(is.na(f[[i]])) && is.logical(f[[i]])){
|
95
|
-
optopt$opt_str <- paste(ifelse(f[[i]], "--no-", "--"), flag, sep='')
|
96
|
-
optopt$action <- ifelse(f[[i]], "store_false", "store_true")
|
97
|
-
}else{
|
98
|
-
optopt$opt_str <- paste("--", flag, sep='')
|
99
|
-
optopt$action <- "store"
|
100
|
-
optopt$help <- paste(optopt$help, "\n\t\t[",
|
101
|
-
ifelse(i %in% mandatory, "** MANDATORY", "default %default"),
|
102
|
-
ifelse(i %in% vectorize, ", separate values by commas", ""),
|
103
|
-
"].", sep="")
|
104
|
-
}
|
105
|
-
if(!is.name(f[[i]])){
|
106
|
-
optopt$default <- f[[i]]
|
107
|
-
optopt$metavar <- class(f[[i]])
|
108
|
-
}
|
109
|
-
if(i %in% number) optopt$metavar <- "NUMERIC"
|
110
|
-
optopt$dest <- i
|
111
|
-
|
112
|
-
opts[[o_i]] <- do.call(optparse::make_option, optopt)
|
113
|
-
}
|
114
|
-
opt <- optparse::parse_args(
|
115
|
-
optparse::OptionParser(option_list=opts, description=p_desc, usage=usage),
|
116
|
-
positional_arguments=positional_arguments)
|
117
|
-
|
118
|
-
#= Post-hoc checks
|
119
|
-
if(length(opt[['options']])==0) opt <- list(options=opt, args=c())
|
120
|
-
for(i in mandatory){
|
121
|
-
if(length(opt$options[[i]])==0) stop('Missing mandatory argument: ',i)
|
122
|
-
}
|
123
|
-
for(i in vectorize){
|
124
|
-
if(length(opt$options[[i]])==1)
|
125
|
-
opt$options[[i]] <- strsplit(opt$options[[i]],",")[[1]]
|
126
|
-
}
|
127
|
-
for(i in number){
|
128
|
-
if(length(opt$options[[i]])>0)
|
129
|
-
opt$options[[i]] <- as.numeric(opt$options[[i]])
|
130
|
-
}
|
131
|
-
opt$options$help <- NULL
|
132
|
-
|
133
|
-
return(opt)
|
134
|
-
}
|
135
|
-
|
@@ -1,154 +0,0 @@
|
|
1
|
-
#' Enveomics: Data Frame to Dist
|
2
|
-
#'
|
3
|
-
#' Transform a dataframe (or coercible object, like a table) into a
|
4
|
-
#' \strong{dist} object.
|
5
|
-
#'
|
6
|
-
#' @param x A dataframe (or coercible object) with at least three columns:
|
7
|
-
#' \enumerate{
|
8
|
-
#' \item ID of the object 1,
|
9
|
-
#' \item ID of the object 2, and
|
10
|
-
#' \item distance between the two objects.}
|
11
|
-
#' @param obj1.index Index of the column containing the ID of the object 1.
|
12
|
-
#' @param obj2.index Index of the column containing the ID of the object 2.
|
13
|
-
#' @param dist.index Index of the column containing the distance.
|
14
|
-
#' @param default.d Default value (for missing values).
|
15
|
-
#' @param max.sim If not zero, assumes that the values are similarity
|
16
|
-
#' (not distance) and this is the maximum similarity (corresponding to
|
17
|
-
#' distance 0). Applies transformation:
|
18
|
-
#' \eqn{distance = (max.sim - values)/max.sim.}
|
19
|
-
#'
|
20
|
-
#' @return Returns a \strong{dist} object.
|
21
|
-
#'
|
22
|
-
#' @author Luis M. Rodriguez-R [aut, cre]
|
23
|
-
#'
|
24
|
-
#' @export
|
25
|
-
|
26
|
-
enve.df2dist <- function(
|
27
|
-
x,
|
28
|
-
obj1.index = 1,
|
29
|
-
obj2.index = 2,
|
30
|
-
dist.index = 3,
|
31
|
-
default.d = NA,
|
32
|
-
max.sim = 0
|
33
|
-
){
|
34
|
-
x <- as.data.frame(x)
|
35
|
-
a <- as.character(x[, obj1.index])
|
36
|
-
b <- as.character(x[, obj2.index])
|
37
|
-
d <- as.double(x[, dist.index])
|
38
|
-
if(max.sim != 0) d <- (max.sim - d) / max.sim
|
39
|
-
ids <- unique(c(a,b))
|
40
|
-
m <- matrix(default.d,
|
41
|
-
nrow = length(ids), ncol = length(ids), dimnames = list(ids, ids))
|
42
|
-
diag(m) <- 0.0
|
43
|
-
m[cbind(a,b)] <- d
|
44
|
-
m <- pmin(m, t(m), na.rm = TRUE)
|
45
|
-
return(as.dist(m))
|
46
|
-
}
|
47
|
-
|
48
|
-
#' Enveomics: Data Frame to Dist (Group)
|
49
|
-
#'
|
50
|
-
#' Transform a dataframe (or coercible object, like a table) into a
|
51
|
-
#' \strong{dist} object, where there are 1 or more distances between each pair
|
52
|
-
#' of objects.
|
53
|
-
#'
|
54
|
-
#' @param x A dataframe (or coercible object) with at least three columns:
|
55
|
-
#' \enumerate{
|
56
|
-
#' \item ID of the object 1,
|
57
|
-
#' \item ID of the object 2, and
|
58
|
-
#' \item distance between the two objects.}
|
59
|
-
#' @param obj1.index Index of the column containing the ID of the object 1.
|
60
|
-
#' @param obj2.index Index of the column containing the ID of the object 2.
|
61
|
-
#' @param dist.index Index of the column containing the distance.
|
62
|
-
#' @param summary Function summarizing the different distances between the
|
63
|
-
#' two objects.
|
64
|
-
#' @param empty.rm Remove rows with empty or \code{NA} groups.
|
65
|
-
#'
|
66
|
-
#' @return Returns a \strong{dist} object.
|
67
|
-
#'
|
68
|
-
#' @author Luis M. Rodriguez-R [aut, cre]
|
69
|
-
#'
|
70
|
-
#' @export
|
71
|
-
|
72
|
-
enve.df2dist.group <- function(
|
73
|
-
x,
|
74
|
-
obj1.index=1,
|
75
|
-
obj2.index=2,
|
76
|
-
dist.index=3,
|
77
|
-
summary=median,
|
78
|
-
empty.rm=TRUE
|
79
|
-
){
|
80
|
-
x <- as.data.frame(x);
|
81
|
-
if(empty.rm) x <- x[ !(is.na(x[,obj1.index]) | is.na(x[,obj2.index]) | x[,obj1.index]=='' | x[,obj2.index]==''), ]
|
82
|
-
a <- as.character(x[, obj1.index]);
|
83
|
-
b <- as.character(x[, obj2.index]);
|
84
|
-
d <- as.double(x[, dist.index]);
|
85
|
-
ids <- unique(c(a,b));
|
86
|
-
if(length(ids)<2) return(NA);
|
87
|
-
m <- matrix(NA, nrow=length(ids), ncol=length(ids), dimnames=list(ids, ids));
|
88
|
-
diag(m) <- 0
|
89
|
-
for(i in 2:length(ids)){
|
90
|
-
id.i <- ids[i];
|
91
|
-
for(j in 1:(i-1)){
|
92
|
-
id.j <- ids[j];
|
93
|
-
d.ij <- summary(c( d[ a==id.i & b==id.j], d[ b==id.i & a==id.j] ));
|
94
|
-
m[id.i, id.j] <- d.ij;
|
95
|
-
m[id.j, id.i] <- d.ij;
|
96
|
-
}
|
97
|
-
}
|
98
|
-
return(as.dist(m));
|
99
|
-
}
|
100
|
-
|
101
|
-
#' Enveomics: Data Frame to Dist (List)
|
102
|
-
#'
|
103
|
-
#' Transform a dataframe (or coercible object, like a table)
|
104
|
-
#' into a \strong{dist} object.
|
105
|
-
#'
|
106
|
-
#' @param x A dataframe (or coercible object) with at least three columns:
|
107
|
-
#' \enumerate{
|
108
|
-
#' \item ID of the object 1,
|
109
|
-
#' \item ID of the object 2, and
|
110
|
-
#' \item distance between the two objects.}
|
111
|
-
#' @param groups Named array where the IDs correspond to the object IDs,
|
112
|
-
#' and the values correspond to the group.
|
113
|
-
#' @param obj1.index Index of the column containing the ID of the object 1.
|
114
|
-
#' @param obj2.index Index of the column containing the ID of the object 2.
|
115
|
-
#' @param dist.index Index of the column containing the distance.
|
116
|
-
#' @param empty.rm Remove incomplete matrices.
|
117
|
-
#' @param ... Any other parameters supported by
|
118
|
-
#' \code{\link{enve.df2dist.group}}.
|
119
|
-
#'
|
120
|
-
#' @return Returns a \strong{list} of \strong{dist} objects.
|
121
|
-
#'
|
122
|
-
#' @author Luis M. Rodriguez-R [aut, cre]
|
123
|
-
#'
|
124
|
-
#' @export
|
125
|
-
|
126
|
-
enve.df2dist.list <- function(
|
127
|
-
x,
|
128
|
-
groups,
|
129
|
-
obj1.index=1,
|
130
|
-
obj2.index=2,
|
131
|
-
dist.index=3,
|
132
|
-
empty.rm=TRUE,
|
133
|
-
...
|
134
|
-
){
|
135
|
-
x <- as.data.frame(x);
|
136
|
-
a <- as.character(x[, obj1.index]);
|
137
|
-
b <- as.character(x[, obj2.index]);
|
138
|
-
d <- as.numeric(x[, dist.index]);
|
139
|
-
ids.all <- unique(c(a,b));
|
140
|
-
l <- list();
|
141
|
-
same_group <- groups[a]==groups[b];
|
142
|
-
same_group <- ifelse(is.na(same_group), FALSE, TRUE);
|
143
|
-
for(group in unique(groups)){
|
144
|
-
ids <- ids.all[ groups[ids.all]==group ];
|
145
|
-
if(length(ids)>1 & group!=""){
|
146
|
-
x.sub <- x[ same_group & (groups[a]==group) & (groups[b]==group), ]
|
147
|
-
if(nrow(x.sub)>0){
|
148
|
-
d.g <- enve.df2dist(x.sub, obj1.index, obj2.index, dist.index, ...);
|
149
|
-
if(!empty.rm | !any(is.na(d.g))) l[[ group ]] <- d.g;
|
150
|
-
}
|
151
|
-
}
|
152
|
-
}
|
153
|
-
return(l);
|
154
|
-
}
|