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,90 +0,0 @@
|
|
1
|
-
#!/usr/bin/env perl
|
2
|
-
#
|
3
|
-
# @author Luis M. Rodriguez-R <lmrodriguezr at gmail dot com>
|
4
|
-
# @license artistic 2.0
|
5
|
-
# @update Oct-13-2015
|
6
|
-
#
|
7
|
-
|
8
|
-
use warnings;
|
9
|
-
use strict;
|
10
|
-
|
11
|
-
my($blast, $nodes, $names, $rank, $bh) = @ARGV;
|
12
|
-
($blast and $nodes and $names) or die <<HELP
|
13
|
-
|
14
|
-
Takes a BLAST with NCBI Taxonomy IDs as subjects and replaces them by names at a
|
15
|
-
given taxonomic rank.
|
16
|
-
|
17
|
-
Usage:
|
18
|
-
$0 tax_blast.txt nodes.dmp names.dmp[ rank[ best-hit]] > taxrank_blast.txt
|
19
|
-
|
20
|
-
tax_blast.txt BLAST output, where subject IDs are NCBI Taxonomy IDs.
|
21
|
-
nodes.dmp Nodes file from NCBI Taxonomy*.
|
22
|
-
names.dmp Names file from NCBI Taxonomy*.
|
23
|
-
rank The rank to be reported. All the reported nodes will
|
24
|
-
have the same rank. By default, genus. To see
|
25
|
-
supported values, run:
|
26
|
-
cut -f 5 nodes.dmp | sort -u
|
27
|
-
best-hit A word (yes or no) telling the program whether or not it
|
28
|
-
should take into account the best hit per query only.
|
29
|
-
By default: yes.
|
30
|
-
taxrank_list.txt BLAST-like output, where subject IDs are Taxonomy names.
|
31
|
-
|
32
|
-
* Download from ftp://ftp.ncbi.nih.gov/pub/taxonomy/taxdump.tar.gz
|
33
|
-
|
34
|
-
HELP
|
35
|
-
;
|
36
|
-
$rank ||= "genus";
|
37
|
-
$bh ||= "yes";
|
38
|
-
|
39
|
-
# %nodes structure:
|
40
|
-
# taxid => [parent's taxid, rank, nil, name, name type]
|
41
|
-
|
42
|
-
print STDERR "Reading $nodes.\n";
|
43
|
-
open NODES, "<", $nodes or die "Cannot read file: $nodes: $!\n";
|
44
|
-
my %nodes = map { my @a=split /\t\|\t/; ($a[0] => [$a[1], $a[2]]) } <NODES>;
|
45
|
-
close NODES;
|
46
|
-
|
47
|
-
print STDERR "Reading $names.\n";
|
48
|
-
open NAMES, "<", $names or die "Cannot read file: $names: $!\n";
|
49
|
-
while(<NAMES>){
|
50
|
-
my @a=split /\t\|\t/;
|
51
|
-
next if exists $nodes{$a[0]}->[3] and
|
52
|
-
$nodes{$a[0]}->[4] eq "scientific name";
|
53
|
-
next if exists $nodes{$a[0]}->[3] and
|
54
|
-
$a[3] ne "scientific name";
|
55
|
-
$nodes{$a[0]}->[3] = $a[1];
|
56
|
-
$nodes{$a[0]}->[4] = $a[3];
|
57
|
-
}
|
58
|
-
close NAMES;
|
59
|
-
|
60
|
-
my $i = 0;
|
61
|
-
my $nomap = 0;
|
62
|
-
my $qry = "";
|
63
|
-
open BLAST, "<", $blast or die "Cannot read file: $blast: $!\n";
|
64
|
-
HIT:while(<BLAST>){
|
65
|
-
if(/^#/){
|
66
|
-
print $_;
|
67
|
-
next;
|
68
|
-
}
|
69
|
-
chomp;
|
70
|
-
my @row = split /\t/;
|
71
|
-
next if $bh eq "yes" and $row[0] eq $qry;
|
72
|
-
$i++;
|
73
|
-
print STDERR " Mapping hit $i\r" unless $i%10;
|
74
|
-
exists $nodes{$row[1]} or die "Cannot find Taxonomy node: $row[1].\n";
|
75
|
-
my $n = $nodes{$row[1]};
|
76
|
-
while($n->[1] ne $rank){
|
77
|
-
if($n->[0] eq $nodes{$n->[0]}->[0]){
|
78
|
-
$nomap++;
|
79
|
-
next HIT;
|
80
|
-
}
|
81
|
-
$n = $nodes{$n->[0]};
|
82
|
-
}
|
83
|
-
$row[1] = $n->[3];
|
84
|
-
print "".join("\t", @row)."\n";
|
85
|
-
}
|
86
|
-
close BLAST;
|
87
|
-
print STDERR " Mapped $i hits\n";
|
88
|
-
print STDERR
|
89
|
-
" WARNING: $nomap hits above rank or in a lineage without rank.\n" if $nomap;
|
90
|
-
|
@@ -1,123 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
# frozen_string_literal: true
|
4
|
-
|
5
|
-
$:.push File.expand_path('../lib', __FILE__)
|
6
|
-
require 'enveomics_rb/enveomics'
|
7
|
-
require 'enveomics_rb/match'
|
8
|
-
$VERSION = 1.0
|
9
|
-
|
10
|
-
o = { n: 5, sortby: :bitscore, out: '-' }
|
11
|
-
OptionParser.new do |opts|
|
12
|
-
opts.version = $VERSION
|
13
|
-
Enveomics.opt_banner(
|
14
|
-
opts, 'Reports the top-N best hits of a BLAST, pre-sorted by query',
|
15
|
-
"#{File.basename($0)} -i in.tsv -o out.tsv [options]"
|
16
|
-
)
|
17
|
-
|
18
|
-
opts.separator 'Mandatory'
|
19
|
-
opts.on(
|
20
|
-
'-i', '--blast FILE',
|
21
|
-
'Path to the BLAST file',
|
22
|
-
'Supports compression with .gz extension, use - for STDIN'
|
23
|
-
) { |v| o[:in] = v }
|
24
|
-
opts.on(
|
25
|
-
'-o', '--out FILE',
|
26
|
-
'Output filtered BLAST file',
|
27
|
-
'Supports compression with .gz extension, use - for STDOUT (default)'
|
28
|
-
) { |v| o[:out] = v }
|
29
|
-
opts.separator ''
|
30
|
-
opts.separator 'Filter Options'
|
31
|
-
opts.on(
|
32
|
-
'-n', '--top INTEGER', Integer,
|
33
|
-
'Maximum number of hits to report for each query',
|
34
|
-
"By default: #{o[:n]}"
|
35
|
-
) { |v| o[:n] = v }
|
36
|
-
opts.on(
|
37
|
-
'-s', '--sort-by STRING',
|
38
|
-
'Parameter used to detect the "best" hits',
|
39
|
-
'Any of: bitscore (default), evalue, identity, length, no (pick first)'
|
40
|
-
) { |v| o[:sortby] = v.to_sym }
|
41
|
-
opts.separator ''
|
42
|
-
opts.separator 'Other Options'
|
43
|
-
opts.on('-q', '--quiet', 'Run quietly (no STDERR output)') { $QUIET = true }
|
44
|
-
opts.on('-h', '--help', 'Display this screen') { puts opts; exit }
|
45
|
-
opts.separator ''
|
46
|
-
end.parse!
|
47
|
-
|
48
|
-
raise Enveomics::OptionError.new('-i is mandatory') if o[:in].nil?
|
49
|
-
unless o[:sortby] == :no || Enveomics::Match.column(o[:sortby])
|
50
|
-
raise Enveomics::OptionError.new("Unrecognized value for -s: #{o[:sortby]}")
|
51
|
-
end
|
52
|
-
|
53
|
-
class Enveomics::Match
|
54
|
-
attr_accessor :sortby
|
55
|
-
|
56
|
-
def <=>(other)
|
57
|
-
ans = send(sortby) <=> other.send(sortby)
|
58
|
-
sortby == :evalue ? ans : ans * -1
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
class Enveomics::MatchSet
|
63
|
-
attr_reader :query, :hits, :sortby
|
64
|
-
|
65
|
-
def initialize(sortby)
|
66
|
-
@hits = []
|
67
|
-
@query = nil
|
68
|
-
@sortby = sortby
|
69
|
-
end
|
70
|
-
|
71
|
-
def <<(hit)
|
72
|
-
@query ||= hit.qry
|
73
|
-
unless query == hit.qry
|
74
|
-
raise "Inconsistent query, expecting #{query}"
|
75
|
-
end
|
76
|
-
|
77
|
-
@hits << hit.tap { |i| i.sortby = sortby }
|
78
|
-
end
|
79
|
-
|
80
|
-
def empty?
|
81
|
-
hits.empty?
|
82
|
-
end
|
83
|
-
|
84
|
-
def filter!(n)
|
85
|
-
@hits.sort! unless sortby == :no
|
86
|
-
@hits.slice!(n, @hits.length)
|
87
|
-
end
|
88
|
-
|
89
|
-
def to_s
|
90
|
-
hits.join("\n")
|
91
|
-
end
|
92
|
-
end
|
93
|
-
|
94
|
-
begin
|
95
|
-
ifh = reader(o[:in])
|
96
|
-
ofh = writer(o[:out])
|
97
|
-
|
98
|
-
say 'Parsing BLAST'
|
99
|
-
hs = Enveomics::MatchSet.new(o[:sortby])
|
100
|
-
lno = 0
|
101
|
-
ifh.each do |ln|
|
102
|
-
lno += 1
|
103
|
-
hit = Enveomics::Match.new(ln)
|
104
|
-
if hs.query != hit.qry
|
105
|
-
hs.filter! o[:n]
|
106
|
-
ofh.puts hs unless hs.empty?
|
107
|
-
hs = Enveomics::MatchSet.new(o[:sortby])
|
108
|
-
say_inline("Parsing line #{lno}... \r")
|
109
|
-
end
|
110
|
-
hs << hit
|
111
|
-
end
|
112
|
-
say("Parsed #{lno} lines ")
|
113
|
-
ifh.close
|
114
|
-
|
115
|
-
hs.filter! o[:n]
|
116
|
-
ofh.puts hs unless hs.empty?
|
117
|
-
ofh.close
|
118
|
-
rescue => err
|
119
|
-
$stderr.puts "Exception: #{err}\n\n"
|
120
|
-
err.backtrace.reverse.each { |l| $stderr.puts "DEBUG: %s\n" % l }
|
121
|
-
err
|
122
|
-
end
|
123
|
-
|
@@ -1,97 +0,0 @@
|
|
1
|
-
#!/usr/bin/env perl
|
2
|
-
#
|
3
|
-
# @author Luis M. Rodriguez-R <lmrodriguezr at gmail dot com>
|
4
|
-
# @license artistic license 2.0
|
5
|
-
# @update Dec-29-2015
|
6
|
-
#
|
7
|
-
|
8
|
-
use warnings;
|
9
|
-
use strict;
|
10
|
-
use Getopt::Std;
|
11
|
-
use List::Util qw/min max/;
|
12
|
-
|
13
|
-
sub VERSION_MESSAGE(){print "Home-made Chao1 (enveomics)\n"}
|
14
|
-
sub HELP_MESSAGE(){die "
|
15
|
-
Description:
|
16
|
-
Takes a table of OTU abundance in one or more samples and calculates the
|
17
|
-
chao1 index (with 95% Confidence Interval) for each sample. To use it with
|
18
|
-
Qiime OTU Tables, run it as:
|
19
|
-
$0 -i OTU_Table.txt -c 1 -h
|
20
|
-
|
21
|
-
Usage:
|
22
|
-
$0 [opts]
|
23
|
-
|
24
|
-
-i <str> * Input table (columns:samples, rows:OTUs).
|
25
|
-
-r <int> Number of rows to ignore. By default: 0.
|
26
|
-
-c <int> Number of columns to ignore. By default: 0.
|
27
|
-
-C <int> Number of columns to ignore at the end. By default: 0.
|
28
|
-
-d <str> Delimiter. Supported escaped characters are: \"\\t\"
|
29
|
-
(tabulation), and \"\\0\" (null bit). By default: \"\\t\".
|
30
|
-
-h If set, the first row is assumed to have the names of the
|
31
|
-
samples.
|
32
|
-
--help This help message.
|
33
|
-
|
34
|
-
* Mandatory.
|
35
|
-
|
36
|
-
To improve:
|
37
|
-
o Account for n1==0 and n2==0 cases. See http://www.mothur.org/wiki/Chao.
|
38
|
-
|
39
|
-
"}
|
40
|
-
|
41
|
-
my %o;
|
42
|
-
getopts('i:c:C:r:d:h', \%o);
|
43
|
-
|
44
|
-
&HELP_MESSAGE() unless $o{i};
|
45
|
-
$o{c} ||= 0;
|
46
|
-
$o{C} ||= 0;
|
47
|
-
$o{r} ||= 0;
|
48
|
-
$o{d} ||= "\\t";
|
49
|
-
|
50
|
-
$o{d}="\t" if $o{d} eq "\\t";
|
51
|
-
$o{d}="\0" if $o{d} eq "\\0";
|
52
|
-
|
53
|
-
my @names = ();
|
54
|
-
my @values = ();
|
55
|
-
open TABLE, "<", $o{i} or die "Cannot open file: ".$o{i}.": $!\n";
|
56
|
-
<TABLE> for (1 .. $o{r});
|
57
|
-
if($o{h}){
|
58
|
-
my $h = <TABLE>;
|
59
|
-
$h or die "Empty table!\n";
|
60
|
-
chomp $h;
|
61
|
-
@names = split $o{d}, $h;
|
62
|
-
shift @names for (1 .. $o{c});
|
63
|
-
pop @names for (1 .. $o{C});
|
64
|
-
}
|
65
|
-
while(<TABLE>){
|
66
|
-
chomp;
|
67
|
-
my @ln = split $o{d};
|
68
|
-
shift @ln for (1 .. $o{c});
|
69
|
-
pop @ln for (1 .. $o{C});
|
70
|
-
push @{$values[$_] ||= []}, $ln[$_] for (0 .. $#ln);
|
71
|
-
}
|
72
|
-
close TABLE;
|
73
|
-
|
74
|
-
print "Sample\tObs\tChao1\tChao1_LB\tChao1_UL\n";
|
75
|
-
for my $i (0 .. $#values){
|
76
|
-
print "".(exists $names[$i] ? $names[$i] : $i).$o{d};
|
77
|
-
my $n1=0;
|
78
|
-
my $n2=0;
|
79
|
-
my $ob=0;
|
80
|
-
for my $v (@{$values[$i]}){
|
81
|
-
$n1++ if $v==1;
|
82
|
-
$n2++ if $v==2;
|
83
|
-
$ob++ if $v>=1;
|
84
|
-
}
|
85
|
-
if($ob and $n1 and $n2){
|
86
|
-
my $m = $n1/$n2;
|
87
|
-
my $ch = $ob + (($n1**2)/(2*$n2));
|
88
|
-
my $var = ($n2*((($m**4)/4) + ($m**3) + (($m**2)/2)));
|
89
|
-
my $c = exp(1.96*sqrt(log(1+ $var/(($ch-$ob)**2))));
|
90
|
-
my $lc = max($ob + ($ch-$ob)/$c, $ob);
|
91
|
-
my $uc = $ob + $c*($ch-$ob);
|
92
|
-
print "".join($o{d}, $ob, $ch, $lc, $uc)."\n"
|
93
|
-
}else{
|
94
|
-
print "".join($o{d}, $ob, $ob, 0, 0)."\n"
|
95
|
-
}
|
96
|
-
}
|
97
|
-
|
@@ -1,234 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
#
|
4
|
-
# @author Luis M. Rodriguez-R
|
5
|
-
# @update Jan-13-2016
|
6
|
-
# @license artistic license 2.0
|
7
|
-
#
|
8
|
-
|
9
|
-
require "optparse"
|
10
|
-
|
11
|
-
o = {:q=>false}
|
12
|
-
ARGV << "-h" if ARGV.size==0
|
13
|
-
OptionParser.new do |opts|
|
14
|
-
opts.banner = "
|
15
|
-
Uses a dichotomous key to classify objects parsing a character table.
|
16
|
-
|
17
|
-
Usage: #{$0} [options]"
|
18
|
-
opts.separator ""
|
19
|
-
opts.separator "Input Options (mandatory)"
|
20
|
-
opts.on("-t", "--table FILE",
|
21
|
-
"Input table containing the states (columns) per object (row).",
|
22
|
-
"It must be tab-delimited and with row and column names.",
|
23
|
-
"See Tests/anthrax-cansnp-data.tsv for an example."){ |v| o[:table]=v }
|
24
|
-
opts.on("-k", "--key FILE",
|
25
|
-
"Input table containing the dychotomous key in linked style, defined in",
|
26
|
-
"four columns (can contain #-lead comment lines):",
|
27
|
-
" 1. ID of the step, typically a sequential integer.",
|
28
|
-
" 2. Name of character to evaluate. Must coincide with the -t headers.",
|
29
|
-
" 3. First character decision (see below).",
|
30
|
-
" 4. Second character decision (see below).",
|
31
|
-
"A character decision must be formated as: state (must coincide with the",
|
32
|
-
"values in -t), colon (:), step to follow. If the state is * (star) any",
|
33
|
-
"state triggers the decision (this should be the norm in column 4). The",
|
34
|
-
"step to follow should be a step ID in square brackets, or the name of",
|
35
|
-
"the classification. See Tests/anthrax-cansnp-key.tsv for an example."
|
36
|
-
){ |v| o[:key]=v }
|
37
|
-
opts.separator ""
|
38
|
-
opts.separator "Output Options"
|
39
|
-
opts.on("-c", "--classification FILE",
|
40
|
-
"Two-column table with the classification of the input objects."
|
41
|
-
){ |v| o[:class]=v }
|
42
|
-
opts.on("-n", "--newick FILE",
|
43
|
-
"Tree containing all the classified objects. This only makes sense for",
|
44
|
-
"synoptic keys."){ |v| o[:nwk]=v }
|
45
|
-
opts.separator ""
|
46
|
-
opts.separator "Additional Options"
|
47
|
-
opts.on("-q", "--quiet", "Run quietly (no STDERR output)."){ o[:q] = true }
|
48
|
-
opts.on("-h", "--help", "Display this screen.") do
|
49
|
-
puts opts
|
50
|
-
exit
|
51
|
-
end
|
52
|
-
opts.separator ""
|
53
|
-
end.parse!
|
54
|
-
abort "-t is mandatory" if o[:table].nil?
|
55
|
-
abort "-k is mandatory" if o[:key].nil?
|
56
|
-
|
57
|
-
##### Extensions:
|
58
|
-
class String
|
59
|
-
def nwk_sanitize() self.gsub(/[\(\):;,"'\s]/,'_') ; end
|
60
|
-
end
|
61
|
-
|
62
|
-
##### Classes:
|
63
|
-
module Dychotomous
|
64
|
-
class Decision
|
65
|
-
attr_reader :state, :terminal, :conclusion
|
66
|
-
def initialize(string)
|
67
|
-
r = string.split /:/
|
68
|
-
@state = r[0]
|
69
|
-
@terminal = !(r[1] =~ /^\[(.*)\]$/)
|
70
|
-
@conclusion = @terminal ? r[1] : $1
|
71
|
-
end
|
72
|
-
def ==(state)
|
73
|
-
return true if self.state == '*'
|
74
|
-
self.state == state.to_s
|
75
|
-
end
|
76
|
-
end
|
77
|
-
class Character
|
78
|
-
attr_reader :name, :a, :b
|
79
|
-
def initialize(name, a, b)
|
80
|
-
@name = name
|
81
|
-
@a = a
|
82
|
-
@b = b
|
83
|
-
end
|
84
|
-
def eval(object)
|
85
|
-
state = object.state(self.name)
|
86
|
-
return self.a if self.a == state
|
87
|
-
return self.b if self.b == state
|
88
|
-
raise "Impossible to make a decision for #{object.name} based on " +
|
89
|
-
"character #{self.name}. Offending state: #{state.to_s}."
|
90
|
-
end
|
91
|
-
end
|
92
|
-
class Key
|
93
|
-
attr_reader :first
|
94
|
-
def initialize(file)
|
95
|
-
@characters = {}
|
96
|
-
fh = File.open(file, 'r')
|
97
|
-
while ln = fh.gets
|
98
|
-
next if ln=~/^#/ or ln=~/^\s*$/
|
99
|
-
r = ln.chomp.split /\t/
|
100
|
-
@characters[ r[0] ] = Character.new(r[1],
|
101
|
-
Decision.new(r[2]), Decision.new(r[3]))
|
102
|
-
@first = @characters[ r[0] ] if @first.nil?
|
103
|
-
end
|
104
|
-
fh.close
|
105
|
-
end
|
106
|
-
def [](name)
|
107
|
-
raise "Cannot find character #{name} in key." if @characters[name].nil?
|
108
|
-
@characters[name]
|
109
|
-
end
|
110
|
-
end
|
111
|
-
end
|
112
|
-
module CharData
|
113
|
-
class Object
|
114
|
-
attr_reader :name, :states
|
115
|
-
def initialize(name)
|
116
|
-
@name = name
|
117
|
-
@states = {}
|
118
|
-
end
|
119
|
-
def <<(state) @states[state.character] = state ; end
|
120
|
-
def state(name) @states[name] ; end
|
121
|
-
end
|
122
|
-
class State
|
123
|
-
attr_reader :character, :state
|
124
|
-
def initialize(character, state)
|
125
|
-
@character = character
|
126
|
-
@state = state
|
127
|
-
end
|
128
|
-
def to_s() self.state.to_s ; end
|
129
|
-
end
|
130
|
-
class Table
|
131
|
-
attr_reader :objects
|
132
|
-
def initialize(file)
|
133
|
-
@objects = []
|
134
|
-
fh = File.open(file, 'r')
|
135
|
-
header = fh.gets.chomp.split(/\t/)
|
136
|
-
while ln = fh.gets
|
137
|
-
next if ln=~/^#/ or ln=~/^\s*$/
|
138
|
-
r = ln.chomp.split /\t/
|
139
|
-
o = Object.new(r[0])
|
140
|
-
(1 .. r.size).each{ |i| o << State.new(header[i], r[i]) }
|
141
|
-
self << o
|
142
|
-
end
|
143
|
-
fh.close
|
144
|
-
end
|
145
|
-
def <<(object) @objects << object ; end
|
146
|
-
end
|
147
|
-
end
|
148
|
-
module ClassData
|
149
|
-
class Classification
|
150
|
-
attr_reader :key, :object, :result
|
151
|
-
def initialize key, object
|
152
|
-
@key = key
|
153
|
-
@object = object
|
154
|
-
self.classify!
|
155
|
-
end
|
156
|
-
def classify!
|
157
|
-
@result = self.key.first.eval(object)
|
158
|
-
while ! self.result.terminal
|
159
|
-
@result = self.key[ self.result.conclusion ].eval(object)
|
160
|
-
end
|
161
|
-
end
|
162
|
-
end
|
163
|
-
class Collection
|
164
|
-
attr_reader :key, :table, :classifications
|
165
|
-
def initialize(key, table)
|
166
|
-
@key = key
|
167
|
-
@table = table
|
168
|
-
@classifications = []
|
169
|
-
self.classify!
|
170
|
-
end
|
171
|
-
def classify!
|
172
|
-
table.objects.each do |object|
|
173
|
-
@classifications << Classification.new(key, object)
|
174
|
-
end
|
175
|
-
end
|
176
|
-
def classified_as(conclusion)
|
177
|
-
self.classifications.select{ |c|
|
178
|
-
c.result.conclusion==conclusion }.map{ |c| c.object }
|
179
|
-
end
|
180
|
-
def to_nwk
|
181
|
-
self.to_nwk_node(self.key.first) + ";"
|
182
|
-
end
|
183
|
-
def to_nwk_node(node)
|
184
|
-
if node.is_a? Dychotomous::Character
|
185
|
-
a = self.to_nwk_node(node.a)
|
186
|
-
b = self.to_nwk_node(node.b)
|
187
|
-
return "" if (a + b)==""
|
188
|
-
return "(" + a + b + ")#{node.name.nwk_sanitize}" if a=="" or b==""
|
189
|
-
return "(" + self.to_nwk_node(node.a) + "," +
|
190
|
-
self.to_nwk_node(node.b) + ")#{node.name.nwk_sanitize}"
|
191
|
-
end
|
192
|
-
if node.is_a? Dychotomous::Decision and node.terminal
|
193
|
-
objects = self.classified_as(node.conclusion)
|
194
|
-
return '' if objects.empty?
|
195
|
-
return objects[0].name.nwk_sanitize if objects.size==1
|
196
|
-
return "(" + objects.map{|o| o.name.nwk_sanitize}.join(",") + ")"
|
197
|
-
end
|
198
|
-
return self.to_nwk_node( self.key[node.conclusion] ) if
|
199
|
-
node.is_a? Dychotomous::Decision
|
200
|
-
raise "Unsupported class: to_nwk_node: #{node}."
|
201
|
-
end
|
202
|
-
end
|
203
|
-
end
|
204
|
-
|
205
|
-
##### MAIN:
|
206
|
-
begin
|
207
|
-
$stderr.puts "Reading dychotomous key." unless o[:q]
|
208
|
-
key = Dychotomous::Key.new(o[:key])
|
209
|
-
$stderr.puts "Reading character table." unless o[:q]
|
210
|
-
table = CharData::Table.new(o[:table])
|
211
|
-
$stderr.puts "Classifying objects." unless o[:q]
|
212
|
-
classif = ClassData::Collection.new(key, table)
|
213
|
-
|
214
|
-
unless o[:class].nil?
|
215
|
-
$stderr.puts "Generating classification table." unless o[:q]
|
216
|
-
fh = File.open(o[:class], 'w')
|
217
|
-
classif.classifications.each do |c|
|
218
|
-
fh.puts c.object.name + "\t" + c.result.conclusion
|
219
|
-
end
|
220
|
-
fh.close
|
221
|
-
end
|
222
|
-
|
223
|
-
unless o[:nwk].nil?
|
224
|
-
$stderr.puts "Generating classification tree." unless o[:q]
|
225
|
-
fh = File.open(o[:nwk], 'w')
|
226
|
-
fh.puts classif.to_nwk
|
227
|
-
fh.close
|
228
|
-
end
|
229
|
-
|
230
|
-
rescue => err
|
231
|
-
$stderr.puts "Exception: #{err}\n\n"
|
232
|
-
err.backtrace.each { |l| $stderr.puts l + "\n" }
|
233
|
-
err
|
234
|
-
end
|
@@ -1,83 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
#
|
4
|
-
# @author Luis M. Rodriguez-R <lmrodriguezr at gmail dot com>
|
5
|
-
# @update Oct-13-2015
|
6
|
-
# @license Artistic License 2.0
|
7
|
-
#
|
8
|
-
|
9
|
-
$:.push File.expand_path(File.dirname(__FILE__) + "/lib")
|
10
|
-
require "enveomics_rb/remote_data"
|
11
|
-
use "nokogiri"
|
12
|
-
|
13
|
-
#================================[ Options parsing ]
|
14
|
-
$o = {
|
15
|
-
q: false, ids: [], dbfrom: "uniprotkb", header: true,
|
16
|
-
ret: "ScientificName",
|
17
|
-
ranks: %w(superkingdom phylum class order family genus species)}
|
18
|
-
|
19
|
-
OptionParser.new do |opt|
|
20
|
-
opt.banner = "
|
21
|
-
Maps a list of EBI-supported IDs to their corresponding NCBI taxonomy using
|
22
|
-
EBI RESTful API. Avoid using this script on millions of entries at a time,
|
23
|
-
since each entry elicits requests to EBI and NCBI servers.
|
24
|
-
|
25
|
-
Usage: #{$0} [options]".gsub(/^ +/,"")
|
26
|
-
opt.separator ""
|
27
|
-
opt.on("-i", "--ids ID1,ID2,...", Array,
|
28
|
-
"Comma-separated list of EBI IDs. Required unless -I is passed."
|
29
|
-
){ |v| $o[:ids]=v }
|
30
|
-
opt.on("-I", "--infile FILE",
|
31
|
-
"Raw text file containing the list of EBI IDs, one per line.",
|
32
|
-
"Required unless -i is passed."){ |v| $o[:infile]=v }
|
33
|
-
opt.on("-d", "--database DB",
|
34
|
-
"EBI database defining the EBI IDs. By default: " + $o[:dbfrom].to_s + "."
|
35
|
-
){ |v| $o[:dbfrom]=v }
|
36
|
-
opt.on("-r", "--ranks RANK1,RANK2,...", Array,
|
37
|
-
"Taxonomic ranks to report. By default:",
|
38
|
-
$o[:ranks].join(",") + "."){ |v| $o[:ranks]=v }
|
39
|
-
opt.on("-n", "--noheader",
|
40
|
-
"Do not includ a header in the output."){ $o[:header]=false }
|
41
|
-
opt.on("-t", "--taxids",
|
42
|
-
"Return Taxonomy IDs instead of scientific names."){ $o[:ret]="TaxId" }
|
43
|
-
opt.on("-q", "--quiet", "Run quietly."){ |v| $o[:q]=true }
|
44
|
-
opt.on("-h", "--help","Display this screen") do
|
45
|
-
puts opt
|
46
|
-
exit
|
47
|
-
end
|
48
|
-
opt.separator ""
|
49
|
-
end.parse!
|
50
|
-
|
51
|
-
#================================[ Main ]
|
52
|
-
begin
|
53
|
-
$o[:ids] += File.readlines($o[:infile]).map{ |l| l.chomp } unless
|
54
|
-
$o[:infile].nil?
|
55
|
-
$o[:ranks].map!{ |r| r.downcase }
|
56
|
-
puts (["ID", "TaxId"] + $o[:ranks].map{ |r| r.capitalize }).join("\t") if
|
57
|
-
$o[:header]
|
58
|
-
$o[:ids].each do |id|
|
59
|
-
id = $1 if id =~ /^[a-z]+\|\S+\|(\S+)/
|
60
|
-
taxid = RemoteData.ebiseq2taxid(id, $o[:dbfrom])
|
61
|
-
if taxid.nil?
|
62
|
-
warn "Cannot find link to taxonomy: #{id}"
|
63
|
-
next
|
64
|
-
end
|
65
|
-
taxonomy = {}
|
66
|
-
unless taxid.nil?
|
67
|
-
doc = Nokogiri::XML( RemoteData.efetch({db: "taxonomy", id: taxid}) )
|
68
|
-
taxonomy[ doc.at_xpath("/TaxaSet/Taxon/Rank").content ] =
|
69
|
-
doc.at_xpath("/TaxaSet/Taxon/#{$o[:ret]}").content
|
70
|
-
doc.xpath("/TaxaSet/Taxon/LineageEx/Taxon").each do |taxon|
|
71
|
-
taxonomy[ taxon.at_xpath("./Rank").content ] =
|
72
|
-
taxon.at_xpath("./#{$o[:ret]}").content
|
73
|
-
end
|
74
|
-
end
|
75
|
-
puts ([id, taxid] +
|
76
|
-
$o[:ranks].map{ |rank| taxonomy[ rank ] ||= "" }).join("\t")
|
77
|
-
end # $o[:ids].each
|
78
|
-
rescue => err
|
79
|
-
$stderr.puts "Exception: #{err}\n\n"
|
80
|
-
err.backtrace.each { |l| $stderr.puts l + "\n" }
|
81
|
-
err
|
82
|
-
end
|
83
|
-
|
@@ -1,60 +0,0 @@
|
|
1
|
-
#!/usr/bin/env perl
|
2
|
-
|
3
|
-
# @author: Luis M. Rodriguez-R <lmrodriguezr at gmail dot com>
|
4
|
-
# @license: Artistic-2.0
|
5
|
-
|
6
|
-
use strict;
|
7
|
-
use warnings;
|
8
|
-
use List::Util qw/sum min max/;
|
9
|
-
|
10
|
-
my ($seqs, $minlen, $n__) = @ARGV;
|
11
|
-
$seqs or die "
|
12
|
-
Description:
|
13
|
-
Calculates the N50 value of a set of sequences. Alternatively, it
|
14
|
-
can calculate other N** values. It also calculates the total number
|
15
|
-
of sequences, the total added length, and the longest sequence length.
|
16
|
-
|
17
|
-
Usage:
|
18
|
-
$0 seqs.fa [minlen [**]]
|
19
|
-
|
20
|
-
seqs.fa A FastA file containing the sequences
|
21
|
-
minlen (optional) The minimum length to take into consideration
|
22
|
-
By default: 0
|
23
|
-
** (optional) Value N** to calculate. By default: 50 (N50)
|
24
|
-
|
25
|
-
";
|
26
|
-
|
27
|
-
$minlen ||= 0;
|
28
|
-
$n__ ||= 50;
|
29
|
-
|
30
|
-
my @len = ();
|
31
|
-
open SEQ, "<", $seqs or die "Cannot open file: $seqs: $!\n";
|
32
|
-
while(<SEQ>){
|
33
|
-
if(/^>/){
|
34
|
-
push @len, 0;
|
35
|
-
}else{
|
36
|
-
next if /^;/;
|
37
|
-
chomp;
|
38
|
-
s/\W//g;
|
39
|
-
$len[-1] += length $_;
|
40
|
-
}
|
41
|
-
}
|
42
|
-
close SEQ;
|
43
|
-
|
44
|
-
@len = sort { $a <=> $b } map { $_ >= $minlen ? $_ : () } @len;
|
45
|
-
my $tot = (sum(@len) || 0);
|
46
|
-
|
47
|
-
my $thr = $n__ * $tot / 100;
|
48
|
-
my $pos = 0;
|
49
|
-
for(@len){
|
50
|
-
$pos += $_;
|
51
|
-
if($pos >= $thr){
|
52
|
-
print "N$n__: $_\n";
|
53
|
-
last;
|
54
|
-
}
|
55
|
-
}
|
56
|
-
|
57
|
-
print "Sequences: " . scalar(@len) . "\n";
|
58
|
-
print "Total length: $tot\n";
|
59
|
-
print "Longest sequence: " . pop(@len) . "\n";
|
60
|
-
|