miga-base 1.0.5.0 → 1.0.5.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/miga-env +6 -0
- data/lib/miga/version.rb +2 -2
- data/scripts/miga.bash +2 -2
- data/scripts/mytaxa_scan.bash +1 -1
- data/utils/enveomics/Manifest/Tasks/blasttab.json +12 -8
- data/utils/enveomics/Manifest/Tasks/sequence-identity.json +28 -16
- data/utils/enveomics/Manifest/examples.json +16 -8
- data/utils/enveomics/Scripts/BlastTab.topHits_sorted.rb +109 -87
- data/utils/enveomics/Scripts/aai.rb +2 -0
- data/utils/enveomics/Scripts/lib/enveomics_rb/match.rb +52 -27
- data/utils/enveomics/Scripts/lib/enveomics_rb/utils.rb +4 -3
- data/utils/enveomics/Scripts/rbm.rb +13 -5
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5f917644f7f3cf91b850400459b98fedfd130b002d9ef964fbbb4a0e7df446b
|
4
|
+
data.tar.gz: c7bed61b0725aa425fd1bb6ac69a5f45f3ee9b6d678096c91ee4d4a326283b51
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db5767035a229029bdc77d7ced5ca104bce12947c7fd18b9947328aa79b0708527537c951fdef414a24ca7d1f394db5c92c4c45ade830c0114baff2fc38260d3
|
7
|
+
data.tar.gz: f4ce4050068ad347a35442d346a502817738082fbfb23dc3d721e0be8ee3244e83608ff0273bef57f8c3d4bb443597c95ec18f26fc218959f47ea95159842b3a
|
data/bin/miga-env
ADDED
data/lib/miga/version.rb
CHANGED
@@ -12,7 +12,7 @@ module MiGA
|
|
12
12
|
# - String indicating release status:
|
13
13
|
# - rc* release candidate, not released as gem
|
14
14
|
# - [0-9]+ stable release, released as gem
|
15
|
-
VERSION = [1.0, 5,
|
15
|
+
VERSION = [1.0, 5, 4].freeze
|
16
16
|
|
17
17
|
##
|
18
18
|
# Nickname for the current major.minor version.
|
@@ -20,7 +20,7 @@ module MiGA
|
|
20
20
|
|
21
21
|
##
|
22
22
|
# Date of the current gem release.
|
23
|
-
VERSION_DATE = Date.new(2021,
|
23
|
+
VERSION_DATE = Date.new(2021, 9, 14)
|
24
24
|
|
25
25
|
##
|
26
26
|
# References of MiGA
|
data/scripts/miga.bash
CHANGED
data/scripts/mytaxa_scan.bash
CHANGED
@@ -21,7 +21,7 @@ else
|
|
21
21
|
MT=$(dirname -- "$(which MyTaxa)")
|
22
22
|
DB="$MIGA_HOME/.miga_db/AllGenomes.faa.dmnd"
|
23
23
|
[[ -e "$DB" ]] || DB="$MT/AllGenomes.faa.dmnd"
|
24
|
-
if [[ ! -e "$
|
24
|
+
if [[ ! -e "$DB" ]] ; then
|
25
25
|
echo "Cannot locate the database: AllGenomes.faa.dmnd:" \
|
26
26
|
"no such file or directory" >&2
|
27
27
|
exit 1
|
@@ -589,7 +589,17 @@
|
|
589
589
|
"|",
|
590
590
|
{ "arg": "task" },
|
591
591
|
"--blast",
|
592
|
-
"
|
592
|
+
"-",
|
593
|
+
{
|
594
|
+
"name": "Output",
|
595
|
+
"opt": "--out",
|
596
|
+
"arg": "out_file",
|
597
|
+
"mandatory": true,
|
598
|
+
"description": [
|
599
|
+
"Output filtered BLAST file.",
|
600
|
+
"Supports compression with .gz extension."
|
601
|
+
]
|
602
|
+
},
|
593
603
|
{
|
594
604
|
"opt": "--top",
|
595
605
|
"arg": "integer",
|
@@ -599,19 +609,13 @@
|
|
599
609
|
{
|
600
610
|
"opt": "--sort-by",
|
601
611
|
"arg": "select",
|
602
|
-
"values": ["bitscore", "evalue", "identity", "length"],
|
612
|
+
"values": ["bitscore", "evalue", "identity", "length", "no"],
|
603
613
|
"default": "bitscore",
|
604
614
|
"description": "Parameter used to detect the 'best' hits."
|
605
615
|
},
|
606
616
|
{
|
607
617
|
"opt": "--quiet",
|
608
618
|
"description": "Run quietly."
|
609
|
-
},
|
610
|
-
">",
|
611
|
-
{
|
612
|
-
"arg": "out_file",
|
613
|
-
"mandatory": true,
|
614
|
-
"description": "Output (filtered) Tabular BLAST."
|
615
619
|
}
|
616
620
|
]
|
617
621
|
},
|
@@ -536,8 +536,10 @@
|
|
536
536
|
},
|
537
537
|
{
|
538
538
|
"task": "rbm.rb",
|
539
|
-
"description": [
|
540
|
-
"
|
539
|
+
"description": [
|
540
|
+
"Finds the reciprocal best matches between two sets of",
|
541
|
+
"sequences."
|
542
|
+
],
|
541
543
|
"help_arg": "--help",
|
542
544
|
"cite":[
|
543
545
|
["Camacho et al, 2009, BMC Bioinf (BLAST+)",
|
@@ -564,11 +566,22 @@
|
|
564
566
|
"mandatory": true,
|
565
567
|
"description": "FastA file containing the genome 2."
|
566
568
|
},
|
569
|
+
{
|
570
|
+
"name": "Output",
|
571
|
+
"opt": "--out",
|
572
|
+
"arg": "out_file",
|
573
|
+
"mandatory": true,
|
574
|
+
"description": [
|
575
|
+
"Reciprocal Best Matches in BLAST tabular format.",
|
576
|
+
"Supports compression with .gz extension."
|
577
|
+
]
|
578
|
+
},
|
567
579
|
{
|
568
580
|
"name": "Nucleotides",
|
569
581
|
"opt": "--nucl",
|
570
|
-
"description": [
|
571
|
-
"by default)."
|
582
|
+
"description": [
|
583
|
+
"Sequences are assumed to be nucleotides (proteins by default)."
|
584
|
+
]
|
572
585
|
},
|
573
586
|
{
|
574
587
|
"name": "Length",
|
@@ -582,8 +595,10 @@
|
|
582
595
|
"opt": "--fract",
|
583
596
|
"arg": "float",
|
584
597
|
"default": 0.0,
|
585
|
-
"description": [
|
586
|
-
"
|
598
|
+
"description": [
|
599
|
+
"Minimum alignment length (as a fraction of the query).",
|
600
|
+
"If set, requires BLAST+ or Diamond (see Program)."
|
601
|
+
]
|
587
602
|
},
|
588
603
|
{
|
589
604
|
"name": "Identity",
|
@@ -603,8 +618,9 @@
|
|
603
618
|
"name": "Executables",
|
604
619
|
"opt": "--bin",
|
605
620
|
"arg": "in_dir",
|
606
|
-
"description": [
|
607
|
-
"program."
|
621
|
+
"description": [
|
622
|
+
"Directory containing the binaries of the search program."
|
623
|
+
]
|
608
624
|
},
|
609
625
|
{
|
610
626
|
"opt": "--program",
|
@@ -612,9 +628,11 @@
|
|
612
628
|
"values": ["blast+", "blast", "blat", "diamond"],
|
613
629
|
"default": "blast+",
|
614
630
|
"description": "Search program to be used. Default: blast+.",
|
615
|
-
"note": [
|
631
|
+
"note": [
|
632
|
+
"Make sure that you have installed the search program you",
|
616
633
|
"want to use. If you have downloaded the program, but it's not",
|
617
|
-
"installed, please use the Executables option above."
|
634
|
+
"installed, please use the Executables option above."
|
635
|
+
]
|
618
636
|
},
|
619
637
|
{
|
620
638
|
"opt": "--threads",
|
@@ -625,12 +643,6 @@
|
|
625
643
|
{
|
626
644
|
"opt": "--quiet",
|
627
645
|
"description": "Run quietly (no STDERR output)."
|
628
|
-
},
|
629
|
-
">",
|
630
|
-
{
|
631
|
-
"arg": "out_file",
|
632
|
-
"mandatory": true,
|
633
|
-
"description": "Reciprocal Best Matches in BLAST tabular format."
|
634
646
|
}
|
635
647
|
]
|
636
648
|
}
|
@@ -26,10 +26,14 @@
|
|
26
26
|
},
|
27
27
|
{
|
28
28
|
"task": "rbm.rb",
|
29
|
-
"description": [
|
30
|
-
"
|
31
|
-
|
32
|
-
|
29
|
+
"description": [
|
30
|
+
"Reciprocal Best Matches between the proteomes of the",
|
31
|
+
"two major HIV types (HIV-1 and HIV-2)."
|
32
|
+
],
|
33
|
+
"values": [
|
34
|
+
"hiv1.faa", "hiv2.faa", "hiv1-hiv2.rbm", null, null, null, null, null,
|
35
|
+
null, null,null, null
|
36
|
+
]
|
33
37
|
},
|
34
38
|
{
|
35
39
|
"task": "ogs.mcl.rb",
|
@@ -83,10 +87,14 @@
|
|
83
87
|
{
|
84
88
|
"_": "== Examples of BLAST statistics and manipulation",
|
85
89
|
"task": "BlastTab.topHits_sorted.rb",
|
86
|
-
"description": [
|
87
|
-
"
|
88
|
-
|
89
|
-
|
90
|
+
"description": [
|
91
|
+
"Extract the best match of metagenome-derived proteins",
|
92
|
+
"(from the 'A metagenome') against a Gene Ontology collection."
|
93
|
+
],
|
94
|
+
"values": [
|
95
|
+
"sort","a_mg.cds-go.blast.tsv", null, null, null, null,
|
96
|
+
"a_mg.cds-go.blast-bm.tsv", 1, null, null
|
97
|
+
]
|
90
98
|
},
|
91
99
|
{
|
92
100
|
"task": "BlastTab.sumPerHit.pl",
|
@@ -1,101 +1,123 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
#
|
4
|
-
# @author: Luis M. Rodriguez-R <lmrodriguezr at gmail dot com>
|
5
|
-
# @update: Dec-11-2015
|
6
|
-
# @license: artistic license 2.0
|
7
|
-
#
|
3
|
+
# frozen_string_literal: true
|
8
4
|
|
9
|
-
|
5
|
+
$:.push File.expand_path('../lib', __FILE__)
|
6
|
+
require 'enveomics_rb/enveomics'
|
7
|
+
require 'enveomics_rb/match'
|
8
|
+
$VERSION = 1.0
|
10
9
|
|
11
|
-
|
12
|
-
$cols = {"bitscore"=>11, "evalue"=>10, "identity"=>2, "length"=>3}
|
13
|
-
ARGV << "-h" if ARGV.size==0
|
10
|
+
o = { n: 5, sortby: :bitscore, out: '-' }
|
14
11
|
OptionParser.new do |opts|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
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 ''
|
35
46
|
end.parse!
|
36
47
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
class Hit
|
42
|
-
attr_reader :blast_line
|
43
|
-
def initialize(blast_line)
|
44
|
-
@blast_line = blast_line.chomp.split(/\t/)
|
45
|
-
end
|
46
|
-
def col(i)
|
47
|
-
@blast_line[i]
|
48
|
-
end
|
49
|
-
def <=>(other)
|
50
|
-
ans = self.col( $cols[ $opts[:sortby] ] ).to_f <=> other.col( $cols[ $opts[:sortby] ] ).to_f
|
51
|
-
ans = ans * -1 unless $opts[:sortby] == "evalue"
|
52
|
-
return ans
|
53
|
-
end
|
54
|
-
def to_s
|
55
|
-
@blast_line.join("\t")
|
56
|
-
end
|
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]}")
|
57
51
|
end
|
58
52
|
|
59
|
-
class
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
@query = hit.col(0) if @query.nil?
|
67
|
-
raise "Inconsistent query, expecting #{self.query}" unless
|
68
|
-
self.query == hit.col(0)
|
69
|
-
@hits << hit
|
70
|
-
end
|
71
|
-
def empty?
|
72
|
-
self.hits.length == 0
|
73
|
-
end
|
74
|
-
def filter!
|
75
|
-
@hits.sort!
|
76
|
-
@hits.slice!($opts[:n], @hits.length)
|
77
|
-
end
|
78
|
-
def to_s
|
79
|
-
@hits.join("\n")
|
80
|
-
end
|
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
|
81
60
|
end
|
82
61
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
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
|
95
92
|
end
|
96
|
-
$stderr.print "Parsed #{$.} lines. \n" unless $opts[:q]
|
97
|
-
fh.close
|
98
93
|
|
99
|
-
|
100
|
-
|
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
|
101
123
|
|
@@ -316,6 +316,7 @@ Dir.mktmpdir do |dir|
|
|
316
316
|
end
|
317
317
|
res = File.open(o[:res], "w") unless o[:res].nil?
|
318
318
|
rbm = File.open(o[:rbm], "w") unless o[:rbm].nil?
|
319
|
+
sqlite_db.execute('BEGIN TRANSACTION') unless o[:sqlite3].nil?
|
319
320
|
[1,2].each do |i|
|
320
321
|
qry_seen = []
|
321
322
|
q = "#{dir}/seq#{i}.fa"
|
@@ -413,6 +414,7 @@ Dir.mktmpdir do |dir|
|
|
413
414
|
o[:sqlite3].nil?
|
414
415
|
puts id2/n2 if o[:auto]
|
415
416
|
end
|
417
|
+
sqlite_db.execute('COMMIT') unless o[:sqlite3].nil?
|
416
418
|
res.close unless o[:res].nil?
|
417
419
|
fo.close unless o[:out].nil?
|
418
420
|
end
|
@@ -4,44 +4,69 @@ module Enveomics
|
|
4
4
|
# A simple object representing a sequence match from a search engine
|
5
5
|
# supporting tabular BLAST output
|
6
6
|
class Match
|
7
|
-
|
7
|
+
class << self
|
8
|
+
def column_types
|
9
|
+
{
|
10
|
+
qseqid: String, sseqid: String, pident: Float,
|
11
|
+
length: Integer, mismatch: Integer, gapopen: Integer,
|
12
|
+
q_start: Integer, q_end: Integer, s_start: Integer,
|
13
|
+
s_end: Integer, evalue: Float, bitscore: Float,
|
14
|
+
# Non-standard (but frequently used in Enveomics Collection):
|
15
|
+
qry_len: Integer, sbj_len: Integer
|
16
|
+
}
|
17
|
+
end
|
8
18
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
@row = ln.chomp.split("\t")
|
13
|
-
end
|
19
|
+
def column_type(sym)
|
20
|
+
column_types[colname(sym)]
|
21
|
+
end
|
14
22
|
|
15
|
-
|
16
|
-
|
17
|
-
|
23
|
+
def to_column_type(sym, value)
|
24
|
+
case column_type(sym).to_s
|
25
|
+
when 'String' ; value.to_s
|
26
|
+
when 'Float' ; value.to_f
|
27
|
+
when 'Integer'; value.to_i
|
28
|
+
end
|
29
|
+
end
|
18
30
|
|
19
|
-
|
20
|
-
|
21
|
-
|
31
|
+
def columns
|
32
|
+
column_types.keys
|
33
|
+
end
|
22
34
|
|
23
|
-
|
24
|
-
|
25
|
-
|
35
|
+
def column(sym)
|
36
|
+
columns.index(colname(sym))
|
37
|
+
end
|
26
38
|
|
27
|
-
|
28
|
-
|
29
|
-
|
39
|
+
def colsynonyms
|
40
|
+
{
|
41
|
+
qry: :qseqid, sbj: :sseqid,
|
42
|
+
id: :pident, len: :length, score: :bitscore
|
43
|
+
}
|
44
|
+
end
|
30
45
|
|
31
|
-
|
32
|
-
|
33
|
-
|
46
|
+
def colnames
|
47
|
+
columns + colsynonyms.keys
|
48
|
+
end
|
34
49
|
|
35
|
-
|
36
|
-
|
50
|
+
def colname(sym)
|
51
|
+
s = sym.to_sym
|
52
|
+
column_types[s] ? s : colsynonyms[s]
|
53
|
+
end
|
37
54
|
end
|
38
55
|
|
39
|
-
|
40
|
-
|
56
|
+
####--- Instance Level ---###
|
57
|
+
|
58
|
+
attr :row
|
59
|
+
|
60
|
+
##
|
61
|
+
# Initialize Enveomics::Match object from a tabular blast line String +ln+
|
62
|
+
def initialize(ln)
|
63
|
+
@row = ln.chomp.split("\t")
|
41
64
|
end
|
42
65
|
|
43
|
-
|
44
|
-
|
66
|
+
colnames.each do |sym|
|
67
|
+
define_method sym do
|
68
|
+
self.class.to_column_type(sym, row[self.class.column(sym)])
|
69
|
+
end
|
45
70
|
end
|
46
71
|
|
47
72
|
def qry_fract
|
@@ -18,10 +18,11 @@ def use(gems, mandatory = true)
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def say(*msg)
|
21
|
-
|
21
|
+
$stderr.puts('[%s] %s' % [Time.now, msg.join('')]) unless $QUIET ||= false
|
22
|
+
end
|
22
23
|
|
23
|
-
|
24
|
-
$stderr.
|
24
|
+
def say_inline(*msg)
|
25
|
+
$stderr.print('[%s] %s' % [Time.now, msg.join('')]) unless $QUIET ||= false
|
25
26
|
end
|
26
27
|
|
27
28
|
##
|
@@ -2,18 +2,19 @@
|
|
2
2
|
|
3
3
|
# frozen_string_literal: true
|
4
4
|
|
5
|
-
$VERSION = 1.
|
5
|
+
$VERSION = 1.01
|
6
6
|
$:.push File.expand_path('../lib', __FILE__)
|
7
7
|
require 'enveomics_rb/rbm'
|
8
8
|
require 'tmpdir'
|
9
9
|
|
10
10
|
bms_dummy = Enveomics::RBM.new('1', '2').bms1
|
11
|
-
o = { q: false }
|
11
|
+
o = { q: false, out: '-' }
|
12
12
|
%i[thr len id fract score bin program nucl].each do |k|
|
13
13
|
o[k] = bms_dummy.opt(k)
|
14
14
|
end
|
15
15
|
|
16
16
|
OptionParser.new do |opts|
|
17
|
+
opts.version = $VERSION
|
17
18
|
cmd = File.basename($0)
|
18
19
|
opts.banner = <<~BANNER
|
19
20
|
|
@@ -34,6 +35,11 @@ OptionParser.new do |opts|
|
|
34
35
|
'-2', '--seq2 FILE',
|
35
36
|
'Path to the FastA file containing the set 2'
|
36
37
|
) { |v| o[:seq2] = v }
|
38
|
+
opts.on(
|
39
|
+
'-o', '--out FILE',
|
40
|
+
'Reciprocal Best Matches in BLAST tabular format.',
|
41
|
+
'Supports compression with .gz extension, use - for STDOUT (default)'
|
42
|
+
) { |v| o[:out] = v }
|
37
43
|
opts.separator ''
|
38
44
|
opts.separator 'Search Options'
|
39
45
|
opts.on(
|
@@ -80,7 +86,7 @@ OptionParser.new do |opts|
|
|
80
86
|
) { |v| o[:thr] = v }
|
81
87
|
opts.separator ''
|
82
88
|
opts.separator 'Other Options'
|
83
|
-
opts.on('-q', '--quiet', 'Run quietly (no STDERR output)') {
|
89
|
+
opts.on('-q', '--quiet', 'Run quietly (no STDERR output)') { $QUIET = true }
|
84
90
|
opts.on('-h', '--help', 'Display this screen') { puts opts ; exit }
|
85
91
|
opts.separator ''
|
86
92
|
end.parse!
|
@@ -90,10 +96,12 @@ raise Enveomics::OptionError.new('-2 is mandatory') if o[:seq2].nil?
|
|
90
96
|
raise Enveomics::OptionError.new(
|
91
97
|
'Argument -f/--fract requires -p blast+ or -p diamond'
|
92
98
|
) if o[:fract] > 0.0 && !%i[blast+ diamond].include?(o[:program])
|
93
|
-
$QUIET = o[:q]
|
94
99
|
|
95
100
|
rbm = Enveomics::RBM.new(o[:seq1], o[:seq2], o)
|
96
|
-
|
101
|
+
ofh = writer(o[:out])
|
102
|
+
rbm.each { |bm| ofh.puts bm.to_s }
|
103
|
+
ofh.close
|
104
|
+
|
97
105
|
say('Forward Best Matches: ', rbm.bms1.count)
|
98
106
|
say('Reverse Best Matches: ', rbm.bms2.count)
|
99
107
|
say('Reciprocal Best Matches: ', rbm.count)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: miga-base
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.5.
|
4
|
+
version: 1.0.5.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luis M. Rodriguez-R
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-09-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: daemons
|
@@ -107,6 +107,7 @@ files:
|
|
107
107
|
- README.md
|
108
108
|
- Rakefile
|
109
109
|
- bin/miga
|
110
|
+
- bin/miga-env
|
110
111
|
- lib/miga.rb
|
111
112
|
- lib/miga/_data/aai-intax-blast.tsv.gz
|
112
113
|
- lib/miga/_data/aai-intax-diamond.tsv.gz
|