miga-base 0.7.26.0 → 0.7.26.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/miga/version.rb +1 -1
- data/utils/FastAAI/00.Libraries/01.SCG_HMMs/Archaea_SCG.hmm +41964 -0
- data/utils/FastAAI/00.Libraries/01.SCG_HMMs/Bacteria_SCG.hmm +32439 -0
- data/utils/FastAAI/00.Libraries/01.SCG_HMMs/Complete_SCG_DB.hmm +62056 -0
- data/utils/FastAAI/FastAAI/FastAAI +1336 -0
- data/utils/FastAAI/README.md +84 -0
- data/utils/FastAAI/kAAI_v1.0_virus.py +1296 -0
- data/utils/enveomics/Docs/recplot2.md +244 -0
- data/utils/enveomics/Examples/aai-matrix.bash +66 -0
- data/utils/enveomics/Examples/ani-matrix.bash +66 -0
- data/utils/enveomics/Examples/essential-phylogeny.bash +105 -0
- data/utils/enveomics/Examples/unus-genome-phylogeny.bash +100 -0
- data/utils/enveomics/LICENSE.txt +73 -0
- data/utils/enveomics/Makefile +52 -0
- data/utils/enveomics/Manifest/Tasks/aasubs.json +103 -0
- data/utils/enveomics/Manifest/Tasks/blasttab.json +786 -0
- data/utils/enveomics/Manifest/Tasks/distances.json +161 -0
- data/utils/enveomics/Manifest/Tasks/fasta.json +766 -0
- data/utils/enveomics/Manifest/Tasks/fastq.json +243 -0
- data/utils/enveomics/Manifest/Tasks/graphics.json +126 -0
- data/utils/enveomics/Manifest/Tasks/mapping.json +67 -0
- data/utils/enveomics/Manifest/Tasks/ogs.json +382 -0
- data/utils/enveomics/Manifest/Tasks/other.json +829 -0
- data/utils/enveomics/Manifest/Tasks/remote.json +355 -0
- data/utils/enveomics/Manifest/Tasks/sequence-identity.json +501 -0
- data/utils/enveomics/Manifest/Tasks/tables.json +308 -0
- data/utils/enveomics/Manifest/Tasks/trees.json +68 -0
- data/utils/enveomics/Manifest/Tasks/variants.json +111 -0
- data/utils/enveomics/Manifest/categories.json +156 -0
- data/utils/enveomics/Manifest/examples.json +154 -0
- data/utils/enveomics/Manifest/tasks.json +4 -0
- data/utils/enveomics/Pipelines/assembly.pbs/CONFIG.mock.bash +69 -0
- data/utils/enveomics/Pipelines/assembly.pbs/FastA.N50.pl +1 -0
- data/utils/enveomics/Pipelines/assembly.pbs/FastA.filterN.pl +1 -0
- data/utils/enveomics/Pipelines/assembly.pbs/FastA.length.pl +1 -0
- data/utils/enveomics/Pipelines/assembly.pbs/README.md +189 -0
- data/utils/enveomics/Pipelines/assembly.pbs/RUNME-2.bash +112 -0
- data/utils/enveomics/Pipelines/assembly.pbs/RUNME-3.bash +23 -0
- data/utils/enveomics/Pipelines/assembly.pbs/RUNME-4.bash +44 -0
- data/utils/enveomics/Pipelines/assembly.pbs/RUNME.bash +50 -0
- data/utils/enveomics/Pipelines/assembly.pbs/kSelector.R +37 -0
- data/utils/enveomics/Pipelines/assembly.pbs/newbler.pbs +68 -0
- data/utils/enveomics/Pipelines/assembly.pbs/newbler_preparator.pl +49 -0
- data/utils/enveomics/Pipelines/assembly.pbs/soap.pbs +80 -0
- data/utils/enveomics/Pipelines/assembly.pbs/stats.pbs +57 -0
- data/utils/enveomics/Pipelines/assembly.pbs/velvet.pbs +63 -0
- data/utils/enveomics/Pipelines/blast.pbs/01.pbs.bash +38 -0
- data/utils/enveomics/Pipelines/blast.pbs/02.pbs.bash +73 -0
- data/utils/enveomics/Pipelines/blast.pbs/03.pbs.bash +21 -0
- data/utils/enveomics/Pipelines/blast.pbs/BlastTab.recover_job.pl +72 -0
- data/utils/enveomics/Pipelines/blast.pbs/CONFIG.mock.bash +98 -0
- data/utils/enveomics/Pipelines/blast.pbs/FastA.split.pl +1 -0
- data/utils/enveomics/Pipelines/blast.pbs/README.md +127 -0
- data/utils/enveomics/Pipelines/blast.pbs/RUNME.bash +109 -0
- data/utils/enveomics/Pipelines/blast.pbs/TASK.check.bash +128 -0
- data/utils/enveomics/Pipelines/blast.pbs/TASK.dry.bash +16 -0
- data/utils/enveomics/Pipelines/blast.pbs/TASK.eo.bash +22 -0
- data/utils/enveomics/Pipelines/blast.pbs/TASK.pause.bash +26 -0
- data/utils/enveomics/Pipelines/blast.pbs/TASK.run.bash +89 -0
- data/utils/enveomics/Pipelines/blast.pbs/sentinel.pbs.bash +29 -0
- data/utils/enveomics/Pipelines/idba.pbs/README.md +49 -0
- data/utils/enveomics/Pipelines/idba.pbs/RUNME.bash +95 -0
- data/utils/enveomics/Pipelines/idba.pbs/run.pbs +56 -0
- data/utils/enveomics/Pipelines/trim.pbs/README.md +54 -0
- data/utils/enveomics/Pipelines/trim.pbs/RUNME.bash +70 -0
- data/utils/enveomics/Pipelines/trim.pbs/run.pbs +130 -0
- data/utils/enveomics/README.md +42 -0
- data/utils/enveomics/Scripts/AAsubs.log2ratio.rb +171 -0
- data/utils/enveomics/Scripts/Aln.cat.rb +163 -0
- data/utils/enveomics/Scripts/Aln.convert.pl +35 -0
- data/utils/enveomics/Scripts/AlphaDiversity.pl +152 -0
- data/utils/enveomics/Scripts/BedGraph.tad.rb +93 -0
- data/utils/enveomics/Scripts/BedGraph.window.rb +71 -0
- data/utils/enveomics/Scripts/BlastPairwise.AAsubs.pl +102 -0
- data/utils/enveomics/Scripts/BlastTab.addlen.rb +63 -0
- data/utils/enveomics/Scripts/BlastTab.advance.bash +48 -0
- data/utils/enveomics/Scripts/BlastTab.best_hit_sorted.pl +55 -0
- data/utils/enveomics/Scripts/BlastTab.catsbj.pl +104 -0
- data/utils/enveomics/Scripts/BlastTab.cogCat.rb +76 -0
- data/utils/enveomics/Scripts/BlastTab.filter.pl +47 -0
- data/utils/enveomics/Scripts/BlastTab.kegg_pep2path_rest.pl +194 -0
- data/utils/enveomics/Scripts/BlastTab.metaxaPrep.pl +104 -0
- data/utils/enveomics/Scripts/BlastTab.pairedHits.rb +157 -0
- data/utils/enveomics/Scripts/BlastTab.recplot2.R +48 -0
- data/utils/enveomics/Scripts/BlastTab.seqdepth.pl +86 -0
- data/utils/enveomics/Scripts/BlastTab.seqdepth_ZIP.pl +119 -0
- data/utils/enveomics/Scripts/BlastTab.seqdepth_nomedian.pl +86 -0
- data/utils/enveomics/Scripts/BlastTab.subsample.pl +47 -0
- data/utils/enveomics/Scripts/BlastTab.sumPerHit.pl +114 -0
- data/utils/enveomics/Scripts/BlastTab.taxid2taxrank.pl +90 -0
- data/utils/enveomics/Scripts/BlastTab.topHits_sorted.rb +101 -0
- data/utils/enveomics/Scripts/Chao1.pl +97 -0
- data/utils/enveomics/Scripts/CharTable.classify.rb +234 -0
- data/utils/enveomics/Scripts/EBIseq2tax.rb +83 -0
- data/utils/enveomics/Scripts/FastA.N50.pl +56 -0
- data/utils/enveomics/Scripts/FastA.extract.rb +152 -0
- data/utils/enveomics/Scripts/FastA.filter.pl +52 -0
- data/utils/enveomics/Scripts/FastA.filterLen.pl +28 -0
- data/utils/enveomics/Scripts/FastA.filterN.pl +60 -0
- data/utils/enveomics/Scripts/FastA.fragment.rb +92 -0
- data/utils/enveomics/Scripts/FastA.gc.pl +42 -0
- data/utils/enveomics/Scripts/FastA.interpose.pl +93 -0
- data/utils/enveomics/Scripts/FastA.length.pl +38 -0
- data/utils/enveomics/Scripts/FastA.mask.rb +89 -0
- data/utils/enveomics/Scripts/FastA.per_file.pl +36 -0
- data/utils/enveomics/Scripts/FastA.qlen.pl +57 -0
- data/utils/enveomics/Scripts/FastA.rename.pl +65 -0
- data/utils/enveomics/Scripts/FastA.revcom.pl +23 -0
- data/utils/enveomics/Scripts/FastA.sample.rb +83 -0
- data/utils/enveomics/Scripts/FastA.slider.pl +85 -0
- data/utils/enveomics/Scripts/FastA.split.pl +55 -0
- data/utils/enveomics/Scripts/FastA.split.rb +79 -0
- data/utils/enveomics/Scripts/FastA.subsample.pl +131 -0
- data/utils/enveomics/Scripts/FastA.tag.rb +65 -0
- data/utils/enveomics/Scripts/FastA.wrap.rb +48 -0
- data/utils/enveomics/Scripts/FastQ.filter.pl +54 -0
- data/utils/enveomics/Scripts/FastQ.interpose.pl +90 -0
- data/utils/enveomics/Scripts/FastQ.offset.pl +90 -0
- data/utils/enveomics/Scripts/FastQ.split.pl +53 -0
- data/utils/enveomics/Scripts/FastQ.tag.rb +63 -0
- data/utils/enveomics/Scripts/FastQ.test-error.rb +81 -0
- data/utils/enveomics/Scripts/FastQ.toFastA.awk +24 -0
- data/utils/enveomics/Scripts/GFF.catsbj.pl +127 -0
- data/utils/enveomics/Scripts/GenBank.add_fields.rb +84 -0
- data/utils/enveomics/Scripts/HMM.essential.rb +351 -0
- data/utils/enveomics/Scripts/HMM.haai.rb +168 -0
- data/utils/enveomics/Scripts/HMMsearch.extractIds.rb +83 -0
- data/utils/enveomics/Scripts/JPlace.distances.rb +88 -0
- data/utils/enveomics/Scripts/JPlace.to_iToL.rb +320 -0
- data/utils/enveomics/Scripts/M5nr.getSequences.rb +81 -0
- data/utils/enveomics/Scripts/MeTaxa.distribution.pl +198 -0
- data/utils/enveomics/Scripts/MyTaxa.fragsByTax.pl +35 -0
- data/utils/enveomics/Scripts/MyTaxa.seq-taxrank.rb +49 -0
- data/utils/enveomics/Scripts/NCBIacc2tax.rb +92 -0
- data/utils/enveomics/Scripts/Newick.autoprune.R +27 -0
- data/utils/enveomics/Scripts/RAxML-EPA.to_iToL.pl +228 -0
- data/utils/enveomics/Scripts/RecPlot2.compareIdentities.R +32 -0
- data/utils/enveomics/Scripts/RefSeq.download.bash +48 -0
- data/utils/enveomics/Scripts/SRA.download.bash +57 -0
- data/utils/enveomics/Scripts/TRIBS.plot-test.R +36 -0
- data/utils/enveomics/Scripts/TRIBS.test.R +39 -0
- data/utils/enveomics/Scripts/Table.barplot.R +31 -0
- data/utils/enveomics/Scripts/Table.df2dist.R +30 -0
- data/utils/enveomics/Scripts/Table.filter.pl +61 -0
- data/utils/enveomics/Scripts/Table.merge.pl +77 -0
- data/utils/enveomics/Scripts/Table.replace.rb +69 -0
- data/utils/enveomics/Scripts/Table.round.rb +63 -0
- data/utils/enveomics/Scripts/Table.split.pl +57 -0
- data/utils/enveomics/Scripts/Taxonomy.silva2ncbi.rb +227 -0
- data/utils/enveomics/Scripts/VCF.KaKs.rb +147 -0
- data/utils/enveomics/Scripts/VCF.SNPs.rb +88 -0
- data/utils/enveomics/Scripts/aai.rb +418 -0
- data/utils/enveomics/Scripts/ani.rb +362 -0
- data/utils/enveomics/Scripts/clust.rand.rb +102 -0
- data/utils/enveomics/Scripts/gi2tax.rb +103 -0
- data/utils/enveomics/Scripts/in_silico_GA_GI.pl +96 -0
- 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 +1 -0
- data/utils/enveomics/Scripts/lib/enveomics_rb/enveomics.rb +24 -0
- data/utils/enveomics/Scripts/lib/enveomics_rb/jplace.rb +253 -0
- data/utils/enveomics/Scripts/lib/enveomics_rb/og.rb +182 -0
- data/utils/enveomics/Scripts/lib/enveomics_rb/remote_data.rb +74 -0
- data/utils/enveomics/Scripts/lib/enveomics_rb/seq_range.rb +237 -0
- data/utils/enveomics/Scripts/lib/enveomics_rb/stat.rb +30 -0
- data/utils/enveomics/Scripts/lib/enveomics_rb/vcf.rb +135 -0
- data/utils/enveomics/Scripts/ogs.annotate.rb +88 -0
- data/utils/enveomics/Scripts/ogs.core-pan.rb +160 -0
- data/utils/enveomics/Scripts/ogs.extract.rb +125 -0
- data/utils/enveomics/Scripts/ogs.mcl.rb +186 -0
- data/utils/enveomics/Scripts/ogs.rb +104 -0
- data/utils/enveomics/Scripts/ogs.stats.rb +131 -0
- data/utils/enveomics/Scripts/rbm.rb +146 -0
- data/utils/enveomics/Tests/Makefile +10 -0
- data/utils/enveomics/Tests/Mgen_M2288.faa +3189 -0
- data/utils/enveomics/Tests/Mgen_M2288.fna +8282 -0
- data/utils/enveomics/Tests/Mgen_M2321.fna +8288 -0
- data/utils/enveomics/Tests/Nequ_Kin4M.faa +2970 -0
- data/utils/enveomics/Tests/Xanthomonas_oryzae-PilA.tribs.Rdata +0 -0
- data/utils/enveomics/Tests/Xanthomonas_oryzae-PilA.txt +7 -0
- data/utils/enveomics/Tests/Xanthomonas_oryzae.aai-mat.tsv +17 -0
- data/utils/enveomics/Tests/Xanthomonas_oryzae.aai.tsv +137 -0
- data/utils/enveomics/Tests/a_mg.cds-go.blast.tsv +123 -0
- data/utils/enveomics/Tests/a_mg.reads-cds.blast.tsv +200 -0
- data/utils/enveomics/Tests/a_mg.reads-cds.counts.tsv +55 -0
- data/utils/enveomics/Tests/alkB.nwk +1 -0
- data/utils/enveomics/Tests/anthrax-cansnp-data.tsv +13 -0
- data/utils/enveomics/Tests/anthrax-cansnp-key.tsv +17 -0
- data/utils/enveomics/Tests/hiv1.faa +59 -0
- data/utils/enveomics/Tests/hiv1.fna +134 -0
- data/utils/enveomics/Tests/hiv2.faa +70 -0
- data/utils/enveomics/Tests/hiv_mix-hiv1.blast.tsv +233 -0
- data/utils/enveomics/Tests/hiv_mix-hiv1.blast.tsv.lim +1 -0
- data/utils/enveomics/Tests/hiv_mix-hiv1.blast.tsv.rec +233 -0
- data/utils/enveomics/Tests/phyla_counts.tsv +10 -0
- data/utils/enveomics/Tests/primate_lentivirus.ogs +11 -0
- data/utils/enveomics/Tests/primate_lentivirus.rbm/hiv1-hiv1.rbm +9 -0
- data/utils/enveomics/Tests/primate_lentivirus.rbm/hiv1-hiv2.rbm +8 -0
- data/utils/enveomics/Tests/primate_lentivirus.rbm/hiv1-siv.rbm +6 -0
- data/utils/enveomics/Tests/primate_lentivirus.rbm/hiv2-hiv2.rbm +9 -0
- data/utils/enveomics/Tests/primate_lentivirus.rbm/hiv2-siv.rbm +6 -0
- data/utils/enveomics/Tests/primate_lentivirus.rbm/siv-siv.rbm +6 -0
- data/utils/enveomics/build_enveomics_r.bash +45 -0
- data/utils/enveomics/enveomics.R/DESCRIPTION +31 -0
- data/utils/enveomics/enveomics.R/NAMESPACE +39 -0
- data/utils/enveomics/enveomics.R/R/autoprune.R +155 -0
- data/utils/enveomics/enveomics.R/R/barplot.R +184 -0
- data/utils/enveomics/enveomics.R/R/cliopts.R +135 -0
- data/utils/enveomics/enveomics.R/R/df2dist.R +154 -0
- data/utils/enveomics/enveomics.R/R/growthcurve.R +331 -0
- data/utils/enveomics/enveomics.R/R/recplot.R +354 -0
- data/utils/enveomics/enveomics.R/R/recplot2.R +1631 -0
- data/utils/enveomics/enveomics.R/R/tribs.R +583 -0
- data/utils/enveomics/enveomics.R/R/utils.R +50 -0
- data/utils/enveomics/enveomics.R/README.md +80 -0
- 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 +17 -0
- data/utils/enveomics/enveomics.R/man/cash-enve.RecPlot2-method.Rd +17 -0
- data/utils/enveomics/enveomics.R/man/cash-enve.RecPlot2.Peak-method.Rd +17 -0
- data/utils/enveomics/enveomics.R/man/enve.GrowthCurve-class.Rd +25 -0
- data/utils/enveomics/enveomics.R/man/enve.TRIBS-class.Rd +46 -0
- data/utils/enveomics/enveomics.R/man/enve.TRIBS.merge.Rd +23 -0
- data/utils/enveomics/enveomics.R/man/enve.TRIBStest-class.Rd +47 -0
- data/utils/enveomics/enveomics.R/man/enve.__prune.iter.Rd +23 -0
- data/utils/enveomics/enveomics.R/man/enve.__prune.reduce.Rd +23 -0
- data/utils/enveomics/enveomics.R/man/enve.__tribs.Rd +32 -0
- data/utils/enveomics/enveomics.R/man/enve.barplot.Rd +91 -0
- data/utils/enveomics/enveomics.R/man/enve.cliopts.Rd +57 -0
- data/utils/enveomics/enveomics.R/man/enve.col.alpha.Rd +24 -0
- data/utils/enveomics/enveomics.R/man/enve.col2alpha.Rd +19 -0
- data/utils/enveomics/enveomics.R/man/enve.df2dist.Rd +39 -0
- data/utils/enveomics/enveomics.R/man/enve.df2dist.group.Rd +38 -0
- data/utils/enveomics/enveomics.R/man/enve.df2dist.list.Rd +40 -0
- data/utils/enveomics/enveomics.R/man/enve.growthcurve.Rd +67 -0
- data/utils/enveomics/enveomics.R/man/enve.prune.dist.Rd +37 -0
- data/utils/enveomics/enveomics.R/man/enve.recplot.Rd +122 -0
- data/utils/enveomics/enveomics.R/man/enve.recplot2-class.Rd +45 -0
- data/utils/enveomics/enveomics.R/man/enve.recplot2.ANIr.Rd +24 -0
- data/utils/enveomics/enveomics.R/man/enve.recplot2.Rd +68 -0
- data/utils/enveomics/enveomics.R/man/enve.recplot2.__counts.Rd +25 -0
- data/utils/enveomics/enveomics.R/man/enve.recplot2.__peakHist.Rd +21 -0
- data/utils/enveomics/enveomics.R/man/enve.recplot2.__whichClosestPeak.Rd +19 -0
- data/utils/enveomics/enveomics.R/man/enve.recplot2.changeCutoff.Rd +19 -0
- data/utils/enveomics/enveomics.R/man/enve.recplot2.compareIdentities.Rd +41 -0
- data/utils/enveomics/enveomics.R/man/enve.recplot2.coordinates.Rd +29 -0
- data/utils/enveomics/enveomics.R/man/enve.recplot2.corePeak.Rd +18 -0
- data/utils/enveomics/enveomics.R/man/enve.recplot2.extractWindows.Rd +40 -0
- data/utils/enveomics/enveomics.R/man/enve.recplot2.findPeaks.Rd +36 -0
- data/utils/enveomics/enveomics.R/man/enve.recplot2.findPeaks.__em_e.Rd +19 -0
- data/utils/enveomics/enveomics.R/man/enve.recplot2.findPeaks.__em_m.Rd +19 -0
- data/utils/enveomics/enveomics.R/man/enve.recplot2.findPeaks.__emauto_one.Rd +27 -0
- data/utils/enveomics/enveomics.R/man/enve.recplot2.findPeaks.__mow_one.Rd +41 -0
- data/utils/enveomics/enveomics.R/man/enve.recplot2.findPeaks.__mower.Rd +17 -0
- data/utils/enveomics/enveomics.R/man/enve.recplot2.findPeaks.em.Rd +43 -0
- data/utils/enveomics/enveomics.R/man/enve.recplot2.findPeaks.emauto.Rd +37 -0
- data/utils/enveomics/enveomics.R/man/enve.recplot2.findPeaks.mower.Rd +74 -0
- data/utils/enveomics/enveomics.R/man/enve.recplot2.peak-class.Rd +59 -0
- data/utils/enveomics/enveomics.R/man/enve.recplot2.seqdepth.Rd +27 -0
- data/utils/enveomics/enveomics.R/man/enve.recplot2.windowDepthThreshold.Rd +32 -0
- data/utils/enveomics/enveomics.R/man/enve.tribs.Rd +59 -0
- data/utils/enveomics/enveomics.R/man/enve.tribs.test.Rd +28 -0
- data/utils/enveomics/enveomics.R/man/enve.truncate.Rd +27 -0
- data/utils/enveomics/enveomics.R/man/growth.curves.Rd +14 -0
- data/utils/enveomics/enveomics.R/man/phyla.counts.Rd +13 -0
- data/utils/enveomics/enveomics.R/man/plot.enve.GrowthCurve.Rd +63 -0
- data/utils/enveomics/enveomics.R/man/plot.enve.TRIBS.Rd +38 -0
- data/utils/enveomics/enveomics.R/man/plot.enve.TRIBStest.Rd +38 -0
- data/utils/enveomics/enveomics.R/man/plot.enve.recplot2.Rd +111 -0
- data/utils/enveomics/enveomics.R/man/summary.enve.GrowthCurve.Rd +19 -0
- data/utils/enveomics/enveomics.R/man/summary.enve.TRIBS.Rd +19 -0
- data/utils/enveomics/enveomics.R/man/summary.enve.TRIBStest.Rd +19 -0
- data/utils/enveomics/globals.mk +8 -0
- data/utils/enveomics/manifest.json +9 -0
- metadata +277 -4
@@ -0,0 +1,42 @@
|
|
1
|
+
#!/usr/bin/env perl
|
2
|
+
#
|
3
|
+
# @author Luis M Rodriguez-R
|
4
|
+
# @update Mar-23-2016
|
5
|
+
# @license artistic license 2.0
|
6
|
+
#
|
7
|
+
|
8
|
+
use warnings;
|
9
|
+
use strict;
|
10
|
+
|
11
|
+
$#ARGV>=0 or die "
|
12
|
+
Usage:
|
13
|
+
$0 seqs.fa... > gc.txt
|
14
|
+
|
15
|
+
seqs.fa One or more FastA files.
|
16
|
+
gc.txt A table with the G+C content of the sequences.
|
17
|
+
|
18
|
+
";
|
19
|
+
|
20
|
+
for my $fa (@ARGV){
|
21
|
+
open FA, "<", $fa or die "Cannot open file: $fa: $!\n";
|
22
|
+
my $def = "";
|
23
|
+
my $len = 0;
|
24
|
+
my $gc = 0;
|
25
|
+
while(<FA>){
|
26
|
+
next if /^;/;
|
27
|
+
if(m/^>(\S*)/){
|
28
|
+
print "$def\t".($gc/$len)."\n" if $len;
|
29
|
+
$def = $1;
|
30
|
+
$len = 0;
|
31
|
+
$gc = 0;
|
32
|
+
}else{
|
33
|
+
s/[^ACTGactg]//g;
|
34
|
+
$len += length $_;
|
35
|
+
s/[^GC]//g;
|
36
|
+
$gc += length $_;
|
37
|
+
}
|
38
|
+
}
|
39
|
+
print "$def\t".($gc/$len)."\n" if $len;
|
40
|
+
close FA;
|
41
|
+
}
|
42
|
+
|
@@ -0,0 +1,93 @@
|
|
1
|
+
#!/usr/bin/env perl
|
2
|
+
|
3
|
+
# @author Luis M. Rodriguez-R
|
4
|
+
# @license artistic license 2.0
|
5
|
+
|
6
|
+
use strict;
|
7
|
+
use warnings;
|
8
|
+
use Symbol;
|
9
|
+
|
10
|
+
my $HELP = <<HELP
|
11
|
+
|
12
|
+
Description:
|
13
|
+
Interposes sequences in FastA format from two files into one output file.
|
14
|
+
If more than two files are provided, the script will interpose all the input
|
15
|
+
files.
|
16
|
+
Note that this script will check for the consistency of the names (assuming
|
17
|
+
a pair of related reads contains the same name varying only in a trailing
|
18
|
+
slash (/) followed by a digit. If you want to turn this feature off just
|
19
|
+
set the -T option to zero. If you want to decrease the sampling period (to
|
20
|
+
speed the script up) or increase it (to make it more sensitive to errors)
|
21
|
+
just change the -T option accordingly.
|
22
|
+
|
23
|
+
Usage:
|
24
|
+
$0 [-T <int> ]<output_fasta> <input_fasta_1> <input_fasta_2> [additional input files...]
|
25
|
+
|
26
|
+
Where,
|
27
|
+
-T <int> : Optional. Integer indicating the sampling period for
|
28
|
+
names evaluation (see Description above).
|
29
|
+
By default: 1000.
|
30
|
+
output_fasta : Output file
|
31
|
+
input_fasta_1 : First FastA file
|
32
|
+
input_fasta_2 : Second FastA file
|
33
|
+
... : Any additional FastA files (or none)
|
34
|
+
|
35
|
+
HELP
|
36
|
+
;
|
37
|
+
my $eval_T = 1000;
|
38
|
+
if(exists $ARGV[0] and exists $ARGV[1] and $ARGV[0] eq '-T'){
|
39
|
+
$eval_T = $ARGV[1]+0;
|
40
|
+
shift @ARGV;
|
41
|
+
shift @ARGV;
|
42
|
+
}
|
43
|
+
my $out = shift @ARGV;
|
44
|
+
my @in = @ARGV;
|
45
|
+
$/ = "\n>";
|
46
|
+
|
47
|
+
die $HELP unless $out and $#in >= 1;
|
48
|
+
open OUT, ">", $out or die "Unable to write on $out: $!\n";
|
49
|
+
print "Output file: $out\n";
|
50
|
+
|
51
|
+
my @in_fh = ();
|
52
|
+
|
53
|
+
for my $k (0 .. $#in) {
|
54
|
+
$in_fh[$k] = gensym;
|
55
|
+
open $in_fh[$k], "<", $in[$k] or die "Unable to read $in[$k]: $!\n";
|
56
|
+
print "Input file: $in[$k]\n";
|
57
|
+
}
|
58
|
+
|
59
|
+
my $i = 0;
|
60
|
+
my $frl;
|
61
|
+
LINE: while(1){
|
62
|
+
my $name = "";
|
63
|
+
print STDERR "\rEntry: $i " unless $i % 1000;
|
64
|
+
FILE: for my $k (0 .. $#in_fh){
|
65
|
+
my $ln = readline($in_fh[$k]);
|
66
|
+
last LINE if $k==0 and not defined $ln;
|
67
|
+
defined $ln or die "Impossible to read next entry ($.) from $in[$k]: $!\n";
|
68
|
+
$ln =~ s/^\>?/>/;
|
69
|
+
$ln =~ s/\>$//;
|
70
|
+
$ln =~ s/^;.*//gm;
|
71
|
+
if($eval_T and not $i % $eval_T){
|
72
|
+
unless($name){
|
73
|
+
$ln =~ m/^>(.*?)[\/ \\_]\d+/ or die "Impossible to evaluate names!\n offending entry:\n$ln\n";
|
74
|
+
$name = $1;
|
75
|
+
}
|
76
|
+
die "Inconsistent name!\n base name is $name\n offending entry is:\n$ln\n" unless $ln =~ /^>$name/;
|
77
|
+
}
|
78
|
+
unless($frl){
|
79
|
+
$ln =~ m/^>.*?\n(.*?)\n/ or die "Unexpected format!\n offending entry:\n$ln\n";
|
80
|
+
my $i = $ln;
|
81
|
+
$i =~ s/^>.*?\n//;
|
82
|
+
$i =~ s/\n//g;
|
83
|
+
$frl = length $i;
|
84
|
+
}
|
85
|
+
print OUT $ln;
|
86
|
+
}
|
87
|
+
$i++;
|
88
|
+
}
|
89
|
+
print "\rNumber of entries: $i \nFirst read length: $frl\n";
|
90
|
+
close OUT;
|
91
|
+
|
92
|
+
for my $k(0..$#in_fh){print "ALERT: The file $in[$k] contains trailing entries\n" if defined readline($in_fh[$k])}
|
93
|
+
|
@@ -0,0 +1,38 @@
|
|
1
|
+
#!/usr/bin/env perl
|
2
|
+
#
|
3
|
+
# @author Luis M Rodriguez-R
|
4
|
+
# @update Oct-07-2015
|
5
|
+
# @license artistic license 2.0
|
6
|
+
#
|
7
|
+
|
8
|
+
use warnings;
|
9
|
+
use strict;
|
10
|
+
|
11
|
+
$#ARGV>=0 or die "
|
12
|
+
Usage:
|
13
|
+
$0 seqs.fa... > length.txt
|
14
|
+
|
15
|
+
seqs.fa One or more FastA files.
|
16
|
+
length.txt A table with the lengths of the sequences.
|
17
|
+
|
18
|
+
";
|
19
|
+
|
20
|
+
for my $fa (@ARGV){
|
21
|
+
open FA, "<", $fa or die "Cannot open file: $fa: $!\n";
|
22
|
+
my $def = '';
|
23
|
+
my $len = 0;
|
24
|
+
while(<FA>){
|
25
|
+
next if /^;/;
|
26
|
+
if(m/^>(\S+)\s?/){
|
27
|
+
print "$def\t$len\n" if $def;
|
28
|
+
$def = $1;
|
29
|
+
$len = 0;
|
30
|
+
}else{
|
31
|
+
s/[^A-Za-z]//g;
|
32
|
+
$len+= length $_;
|
33
|
+
}
|
34
|
+
}
|
35
|
+
print "$def\t$len\n" if $def;
|
36
|
+
close FA;
|
37
|
+
}
|
38
|
+
|
@@ -0,0 +1,89 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'optparse'
|
4
|
+
o = {x: 'N', trim: false, wrap: 70}
|
5
|
+
ARGV << '-h' if ARGV.empty?
|
6
|
+
OptionParser.new do |opts|
|
7
|
+
opts.banner = "
|
8
|
+
Mask sequence region(s) in a FastA file.
|
9
|
+
|
10
|
+
Usage: #{$0} [options]"
|
11
|
+
opts.separator ''
|
12
|
+
opts.separator 'Mandatory'
|
13
|
+
opts.on('-i', '--in FILE', 'Input FastA file.'){ |v| o[:in] = v }
|
14
|
+
opts.on('-o', '--out FILE', 'Output FastA file.'){ |v| o[:out] = v }
|
15
|
+
opts.on('-r', '--regions REG1,REG2,...', Array,
|
16
|
+
'Regions to mask separated by commas.',
|
17
|
+
'Each region must be in the format "sequence_id:from..to"'
|
18
|
+
){ |v| o[:reg] = v }
|
19
|
+
opts.separator ''
|
20
|
+
opts.separator 'Options'
|
21
|
+
opts.on('-x', '--symbol CHAR',
|
22
|
+
'Character used to mask the region(s)',
|
23
|
+
"By default: #{o[:x]}."){ |v| o[:x] = v }
|
24
|
+
opts.on('-t', '--trim',
|
25
|
+
'Trim masked regions extending to the edge of a sequence'
|
26
|
+
){ |v| o[:trim] = v }
|
27
|
+
opts.on('-w', '--wrap INT',
|
28
|
+
'Line length to wrap sequences. Use 0 to generate 1-line sequences.',
|
29
|
+
"By default: #{o[:wrap]}."){ |v| o[:wrap] = v.to_i }
|
30
|
+
opts.on('-h', '--help', 'Display this screen.') do
|
31
|
+
puts opts
|
32
|
+
exit
|
33
|
+
end
|
34
|
+
opts.separator ''
|
35
|
+
end.parse!
|
36
|
+
abort '-i is mandatory' if o[:in].nil?
|
37
|
+
abort '-o is mandatory' if o[:out].nil?
|
38
|
+
abort '-r is mandatory' if o[:reg].nil?
|
39
|
+
|
40
|
+
def wrap_width(txt, len)
|
41
|
+
return "" if txt.empty?
|
42
|
+
return "#{txt}\n" if len==0
|
43
|
+
txt.gsub(/(.{1,#{len}})/,"\\1\n")
|
44
|
+
end
|
45
|
+
|
46
|
+
# Read input sequences
|
47
|
+
sq = {}
|
48
|
+
File.open(o[:in], 'r') do |ifh|
|
49
|
+
bf = ''
|
50
|
+
ifh.each('>') do |i|
|
51
|
+
(dln, seq) = i.split(/[\n\r]+/, 2)
|
52
|
+
next if seq.nil?
|
53
|
+
id = dln.gsub(/\s.*/, '')
|
54
|
+
seq.gsub!(/[\s>]/, '')
|
55
|
+
sq[id] = [dln, seq]
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
# Parse coordinates and mask regions
|
60
|
+
last_id = nil
|
61
|
+
o[:reg].each do |i|
|
62
|
+
m = i.match(/^(?:(.+):)?(\d+)\.\.(\d+)$/) or
|
63
|
+
abort "Unexpected region format: #{i}"
|
64
|
+
r = [m[1], m[2].to_i-1, m[3].to_i-1]
|
65
|
+
if r[0].nil?
|
66
|
+
abort "Region missing sequence ID: #{i}" if last_id.nil?
|
67
|
+
r[0] = last_id
|
68
|
+
end
|
69
|
+
last_id = r[0]
|
70
|
+
sq[r[0]] or abort "Cannot find sequence #{r[0]}"
|
71
|
+
r[1] <= r[2] or abort "Malformed range: #{i}"
|
72
|
+
if r[1] < 0 or r[2] > sq[r[0]][1].size
|
73
|
+
abort "Range extends beyond the edge of the sequence: #{i}"
|
74
|
+
end
|
75
|
+
sq[r[0]][1][r[1] .. r[2]] = o[:x]*(1+r[2]-r[1])
|
76
|
+
end
|
77
|
+
|
78
|
+
# Trim sequences and generate output
|
79
|
+
ofh = File.open(o[:out], 'w')
|
80
|
+
sq.each do |_k,v|
|
81
|
+
ofh.puts ">#{v[0]}"
|
82
|
+
if o[:trim]
|
83
|
+
v[1].gsub!(/^#{o[:x]}+/,'')
|
84
|
+
v[1].gsub!(/#{o[:x]}+$/,'')
|
85
|
+
end
|
86
|
+
ofh.print wrap_width(v[1], o[:wrap])
|
87
|
+
end
|
88
|
+
ofh.close
|
89
|
+
|
@@ -0,0 +1,36 @@
|
|
1
|
+
#!/usr/bin/env perl
|
2
|
+
#
|
3
|
+
# @author Luis M Rodriguez-R
|
4
|
+
# @update Mar-17-2016
|
5
|
+
# @license artistic license 2.0
|
6
|
+
#
|
7
|
+
|
8
|
+
use warnings;
|
9
|
+
use strict;
|
10
|
+
|
11
|
+
$#ARGV>=1 or die "
|
12
|
+
Usage:
|
13
|
+
$0 outdir seqs.fa...
|
14
|
+
|
15
|
+
outdir Output directory for the individual files.
|
16
|
+
seqs.fa One or more FastA files.
|
17
|
+
|
18
|
+
";
|
19
|
+
|
20
|
+
my $dir = shift @ARGV;
|
21
|
+
|
22
|
+
for my $fa (@ARGV){
|
23
|
+
open FA, "<", $fa or die "Cannot open file: $fa: $!\n";
|
24
|
+
my $file = '';
|
25
|
+
while(<FA>){
|
26
|
+
next if /^;/;
|
27
|
+
if(m/^>(\S+)\s?/){
|
28
|
+
close ONE if $file;
|
29
|
+
$file = $dir."/".$1.".fasta";
|
30
|
+
open ONE, ">", $file or die "Cannot open file: $file: $!\n";
|
31
|
+
}
|
32
|
+
print ONE $_ if $file;
|
33
|
+
}
|
34
|
+
close ONE if $file;
|
35
|
+
}
|
36
|
+
|
@@ -0,0 +1,57 @@
|
|
1
|
+
#!/usr/bin/env perl
|
2
|
+
#
|
3
|
+
# @author Luis M. Rodriguez-R <lmrodriguezr at gmail dot com>
|
4
|
+
# @update Dec-22-2015
|
5
|
+
# @license artistic license 2.0
|
6
|
+
#
|
7
|
+
use strict;
|
8
|
+
use warnings;
|
9
|
+
use List::Util qw/sum min max/;
|
10
|
+
|
11
|
+
my ($seqs, $minlen) = @ARGV;
|
12
|
+
$seqs or die "
|
13
|
+
Description:
|
14
|
+
Calculates the quartiles of the length in a set of sequences. The Q2 is
|
15
|
+
also known as the median. Q0 is the minimum length, and Q4 is the maximum
|
16
|
+
length. It also calculates TOTAL, the added length of the sequences in
|
17
|
+
the file, and AVG, the average length.
|
18
|
+
|
19
|
+
Usage:
|
20
|
+
$0 seqs.fa[ minlen]
|
21
|
+
|
22
|
+
seqs.fa A FastA file containing the sequences.
|
23
|
+
minlen (optional) The minimum length to take into consideration.
|
24
|
+
By default: 0.
|
25
|
+
|
26
|
+
";
|
27
|
+
$minlen ||= 0;
|
28
|
+
|
29
|
+
# Read files
|
30
|
+
my @len = ();
|
31
|
+
open FA, "<", $seqs or die "Cannot open file: $seqs: $!\n";
|
32
|
+
my $def = '';
|
33
|
+
my $len = 0;
|
34
|
+
while(<FA>){
|
35
|
+
next if /^;/;
|
36
|
+
if(m/^>(\S+)\s?/){
|
37
|
+
push(@len, int($len)) if $def and not $len<$minlen;
|
38
|
+
$def = $1;
|
39
|
+
$len = 0;
|
40
|
+
}else{
|
41
|
+
s/[^A-Za-z]//g;
|
42
|
+
$len+= length $_;
|
43
|
+
}
|
44
|
+
}
|
45
|
+
push(@len, int($len)) if $def and not $len<$minlen;
|
46
|
+
close FA;
|
47
|
+
|
48
|
+
# Sort and estimates quantiles
|
49
|
+
@len = sort { $a <=> $b } @len;
|
50
|
+
for my $q (0 .. 4){
|
51
|
+
my $ii = int(my $i = $#len*$q/4);
|
52
|
+
print "Q$q: ".($i==$ii ? $len[$i] : ($len[$ii]+$len[$ii+1])/2 )."\n";
|
53
|
+
}
|
54
|
+
my $sum = sum @len;
|
55
|
+
print "N: ".scalar(@len)."\n";
|
56
|
+
print "TOTAL: $sum\n";
|
57
|
+
print "AVG: ".($sum/scalar(@len))."\n";
|
@@ -0,0 +1,65 @@
|
|
1
|
+
#!/usr/bin/env perl
|
2
|
+
#
|
3
|
+
# @author Luis M. Rodriguez-R <lmrodriguezr at gmail dot com>
|
4
|
+
# @update Oct-07-2015
|
5
|
+
# @license artistic license 2.0
|
6
|
+
#
|
7
|
+
|
8
|
+
use warnings;
|
9
|
+
use strict;
|
10
|
+
use Getopt::Std;
|
11
|
+
|
12
|
+
sub HELP_MESSAGE { die "
|
13
|
+
.Description:
|
14
|
+
Renames a set of sequences in FastA format.
|
15
|
+
|
16
|
+
.Usage: $0 [options] list.txt seqs.fa > renamed.fa
|
17
|
+
|
18
|
+
[options]
|
19
|
+
-f Filter list. Ignores sequences NOT present in the list.
|
20
|
+
-q Runs quietly.
|
21
|
+
-h Prints this message and exits.
|
22
|
+
|
23
|
+
[mandatory]
|
24
|
+
list.txt Tab-delimited list of sequences, with the original ID in the
|
25
|
+
first column and the ID to use in the second.
|
26
|
+
seqs.fa FastA file containing the superset of sequences.
|
27
|
+
renamed.fa FastA file to be created.
|
28
|
+
|
29
|
+
" }
|
30
|
+
|
31
|
+
my %o=();
|
32
|
+
getopts('fhq', \%o);
|
33
|
+
my($list, $fa) = @ARGV;
|
34
|
+
($list and $fa) or &HELP_MESSAGE;
|
35
|
+
$o{h} and &HELP_MESSAGE;
|
36
|
+
|
37
|
+
print STDERR "Reading list.\n" unless $o{q};
|
38
|
+
open LI, "<", $list or die "Cannot read file: $list: $!\n";
|
39
|
+
my %li = map { my $l=$_; chomp $l; my @r=split(/\t/,$l); $r[0] => $r[1] } <LI>;
|
40
|
+
close LI;
|
41
|
+
|
42
|
+
print STDERR "Renaming FastA.\n" unless $o{q};
|
43
|
+
open FA, "<", $fa or die "Cannot read file: $fa: $!\n";
|
44
|
+
my $good = 0;
|
45
|
+
while(my $ln = <FA>){
|
46
|
+
next if $ln =~ /^;/;
|
47
|
+
chomp $ln;
|
48
|
+
if($ln =~ m/^>((\S+).*)/){
|
49
|
+
my $rep=0;
|
50
|
+
$rep = ">".$li{$ln} if exists $li{$ln};
|
51
|
+
$rep = ">".$li{$1} if exists $li{$1} and not $rep;
|
52
|
+
$rep = ">".$li{">$1"} if exists $li{">$1"} and not $rep;
|
53
|
+
$rep = ">".$li{$2} if exists $li{$2} and not $rep;
|
54
|
+
if($rep){
|
55
|
+
$ln = $rep;
|
56
|
+
$good = 1;
|
57
|
+
}
|
58
|
+
}elsif($ln =~ m/^>/){
|
59
|
+
$good=0;
|
60
|
+
print STDERR "Warning: Non-cannonical defline, line $.: $ln\n";
|
61
|
+
}
|
62
|
+
print "$ln\n" if $good or not $o{f};
|
63
|
+
}
|
64
|
+
close FA;
|
65
|
+
|
@@ -0,0 +1,23 @@
|
|
1
|
+
#!/usr/bin/env perl
|
2
|
+
#
|
3
|
+
# @author: Luis M. Rodriguez-R <lmrodriguezr at gmail dot com>
|
4
|
+
# @update: Dec-25-2015
|
5
|
+
# @license: artistic license 2.0
|
6
|
+
#
|
7
|
+
use strict;
|
8
|
+
use warnings;
|
9
|
+
use Bio::SeqIO;
|
10
|
+
|
11
|
+
($ARGV[0] and $ARGV[0] =~ /--?h(elp)?/) and die "
|
12
|
+
Description:
|
13
|
+
Reverse-complement sequences in FastA format.
|
14
|
+
|
15
|
+
Usage:
|
16
|
+
$0 < input.fa > output.fa
|
17
|
+
|
18
|
+
";
|
19
|
+
|
20
|
+
my @len = ();
|
21
|
+
my $seqI = Bio::SeqIO->new(-fh => \*STDIN, -format=>"FastA");
|
22
|
+
my $seqO = Bio::SeqIO->new(-fh => \*STDOUT, -format=>"FastA");
|
23
|
+
while(my $seq = $seqI->next_seq){ $seqO->write_seq($seq->revcom) }
|