mapp2g 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 04ec92d7b3794b5a5d23a8cb58eafc7cbb188349e7efeae94643cff29a37bfe8
4
- data.tar.gz: f1bba896fb88a7f7c9ce5b59cd35169403f4bcfed08def326173c914d9841667
3
+ metadata.gz: 2d3b7c217addd7e92a9b0dc4d2af710c216d7dbcf86c2416018ac80bee287e1c
4
+ data.tar.gz: 562dbf402617e18af3b2e32cb32fb1e5f157ec783aaa6b61f2f44a5cf3877acc
5
5
  SHA512:
6
- metadata.gz: 5bdffdc2931c0c5e1020144e1520566f005607c1911536466e99a784bb7a0201ca1fbd890ac24d083af3fb10a97b2a81c433a85cd196d96fc53939cabcb944be
7
- data.tar.gz: 2c4d4b270c725a472e60f0a3d5bca3bf3c9204282b06015aa928020b22c5fc6d940080b286a3bd4d1a54240669ed9960af1ba67ea9277482398621a6bf2590a6
6
+ metadata.gz: 6df38d0b72858bd49d354d0b72eeca57a70cfc80a075444bcffd8ecfcd4b59945395a76a3d38e70caea74254bce0e62f82039f15db6ca23566204444bc9bb5b2
7
+ data.tar.gz: 01174fd8de53e2e5f7d6a3021ff8789b242a53af4d8968bc3eaf6c3e1c67795826af82b95e7f0c1290e6c9d888d560d4488de5f1de4774c78d3b793dd52f2dcf
data/exe/mapp2g CHANGED
@@ -3,11 +3,38 @@
3
3
  require "mapp2g"
4
4
  require 'bio'
5
5
  require 'tempfile'
6
+ require 'optparse'
6
7
 
7
- query = ARGV[0]
8
- genome = ARGV[1]
9
- outdir = (ARGV[2] || "mapp2g_out_#{$$}")
10
- mapp2g_exe = "./mapp2g.rb"
8
+
9
+ opt = OptionParser.new
10
+ OPTS = {}
11
+
12
+ begin
13
+ #opt.banner = "Usage: #{opt.program_name} [options] QUERY GENOME "
14
+ opt.on_tail("-v", "--version", "show version number") do
15
+ puts Mapp2g::VERSION
16
+ exit
17
+ end
18
+ opt.on("-q QUERY", "--query", "query amino acid sequences in FASTA format"){|v| OPTS[:q] = v}
19
+ opt.on("-g BLASTDB", "--genome", "genome reference as blastdb"){|v| OPTS[:g] = v}
20
+ opt.on("-o [OUTDIR]", "--outdir", "output directory. DEFAULT: mapp2g_out_{process_id}"){|v| OPTS[:o] = v}
21
+ opt.on_tail('-h', '--help', 'show this help message and exit') do
22
+ puts opt
23
+ exit
24
+ end
25
+ opt.parse!(ARGV)
26
+ rescue => e
27
+ puts "ERROR: #{e}\nSee #{opt}"
28
+ exit
29
+ end
30
+
31
+ # p OPTS
32
+
33
+ query = OPTS[:q]
34
+ genome = OPTS[:g]
35
+ outdir = (OPTS[:o] || "mapp2g_out_#{$$}")
36
+
37
+ #p [query, genome, outdir]
11
38
 
12
39
  Dir.mkdir(outdir)
13
40
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mapp2g
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2"
5
5
  end
@@ -0,0 +1,28 @@
1
+ name = nil
2
+ target = nil
3
+ ARGF.each do |l|
4
+
5
+ if m = /\s+Query:\s/.match(l)
6
+ name = m.post_match.chomp.split[0]
7
+ elsif m = /\s+Target:\s/.match(l)
8
+ target = m.post_match.split[0]
9
+ elsif /^#{target}/.match(l) &&
10
+ (/\texonerate:est2genome\t/.match(l) || /\texonerate:protein2genome:local\t/.match(l)) &&
11
+ (/\tcds\t/.match(l) || /\texon\t/.match(l) || /\tgene\t/.match(l))
12
+ # puts l
13
+ a = l.chomp.split(/\t/)
14
+ b = Array.new(9)
15
+ a.each_with_index{|x, i| b[i] = x}
16
+ if b[2] == "gene"
17
+ b[-1] = "ID=#{name}"
18
+ b[2] = "match"
19
+ elsif (b[2] == "cds" || b[2] == "exon")
20
+ b[-1] = "Parent=#{name}"
21
+ b[2] = "match_part"
22
+ else
23
+ raise
24
+ end
25
+ puts b.join("\t")
26
+ end
27
+
28
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mapp2g
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shuji Shigenobu
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-02-04 00:00:00.000000000 Z
11
+ date: 2023-02-05 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: mapp2g is a bioinformatics software, which map and align protein sequences
14
14
  (amino acid sequences) to genome references in a splicing-aware way. mapp2g alignment
@@ -30,6 +30,7 @@ files:
30
30
  - lib/mapp2g/mapper.rb
31
31
  - lib/mapp2g/version.rb
32
32
  - mapp2g.gemspec
33
+ - scripts/mapp2g-exonerate_gff2_to_jbgff3.rb
33
34
  - sig/mapp2g.rbs
34
35
  homepage: https://github.com/shujishigenobu/mapp2g
35
36
  licenses: