mapp2g 0.1.1 → 0.1.3

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: '029a95186aca02659011cc06f0cdc67f85aa7c8fbda820c06e504a772158cd0a'
4
+ data.tar.gz: bbaac99c22269dfbba7980ee2ee7c90c7f6bc7f0874b57cd397c1f6d803f953e
5
5
  SHA512:
6
- metadata.gz: 5bdffdc2931c0c5e1020144e1520566f005607c1911536466e99a784bb7a0201ca1fbd890ac24d083af3fb10a97b2a81c433a85cd196d96fc53939cabcb944be
7
- data.tar.gz: 2c4d4b270c725a472e60f0a3d5bca3bf3c9204282b06015aa928020b22c5fc6d940080b286a3bd4d1a54240669ed9960af1ba67ea9277482398621a6bf2590a6
6
+ metadata.gz: 3f41a7fad9ef596f1af730dfd235895c1f04365f5672d2ead4a6ae1979738ee3ba601707c440d48708e75e6f0d6b49944e6ba2861bfeac1ca004ceebba48783e
7
+ data.tar.gz: ec1c3ecd64349b0b880a35d4148066ce4a4c5888f789c8223b0fe93d089c254d11341f293e9e535e4c29b2e29508489eb945f29c72756b52ac4f0b64f6b90590
data/README.md CHANGED
@@ -1,34 +1,42 @@
1
1
  # Mapp2g
2
2
 
3
- TODO: Delete this and the text below, and describe your gem
4
-
5
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/mapp2g`. To experiment with that code, run `bin/console` for an interactive prompt.
6
-
7
3
  ## Installation
8
4
 
9
- TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
5
+ ### Pre-requisites
10
6
 
11
- Install the gem and add to the application's Gemfile by executing:
7
+ * NCBI blast
8
+ * exonerate
9
+
10
+ These two software should be installed. mapp2g is wrtten in Ruby. Ruby sholud be installed.
12
11
 
13
- $ bundle add UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG
12
+ ### Install mapp2g using gem
14
13
 
15
- If bundler is not being used to manage dependencies, install the gem by executing:
16
-
17
- $ gem install UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG
14
+ ```
15
+ gem install mapp2g
16
+ ```
18
17
 
19
18
  ## Usage
20
19
 
21
- TODO: Write usage instructions here
22
-
23
- ## Development
20
+ ```
21
+ Usage: mapp2g [options]
22
+ -q, --query QUERY query amino acid sequences in FASTA format
23
+ -g, --genome BLASTDB genome reference as blastdb
24
+ -o, --outdir [OUTDIR] output directory. DEFAULT: mapp2g_out_{process_id}
25
+ -v, --version show version number
26
+ -h, --help show this help message and exit
27
+ ```
24
28
 
25
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
29
+ (example)
30
+ ```
31
+ mapp2g -q human_genome.fasta -q p53.protein.fasta
32
+ ```
26
33
 
27
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
34
+ Reference genomes should be formated in blastdb before running mapp2g. blastdb can be made as follws:
28
35
 
29
- ## Contributing
36
+ ```
37
+ makeblastdb -in human_genome.fasta -dbtype nucl -parse_seqids
38
+ ```
30
39
 
31
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/mapp2g.
32
40
 
33
41
  ## License
34
42
 
data/exe/mapp2g CHANGED
@@ -3,11 +3,46 @@
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. REQUIRED."){|v| OPTS[:q] = v}
19
+ opt.on("-g BLASTDB", "--genome", "genome reference as blastdb. REQUIRED."){|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
+
26
+ if ARGV.size == 0
27
+ puts opt
28
+ exit
29
+ end
30
+
31
+ opt.parse!(ARGV)
32
+
33
+
34
+ rescue => e
35
+ puts "ERROR: #{e}\nSee #{opt}"
36
+ exit
37
+ end
38
+
39
+ # p OPTS
40
+
41
+ query = OPTS[:q]
42
+ genome = OPTS[:g]
43
+ outdir = (OPTS[:o] || "mapp2g_out_#{$$}")
44
+
45
+ #p [query, genome, outdir]
11
46
 
12
47
  Dir.mkdir(outdir)
13
48
 
@@ -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.3"
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.3
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-09 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: