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 +4 -4
- data/README.md +25 -17
- data/exe/mapp2g +39 -4
- data/lib/mapp2g/version.rb +1 -1
- data/scripts/mapp2g-exonerate_gff2_to_jbgff3.rb +28 -0
- 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: '029a95186aca02659011cc06f0cdc67f85aa7c8fbda820c06e504a772158cd0a'
|
4
|
+
data.tar.gz: bbaac99c22269dfbba7980ee2ee7c90c7f6bc7f0874b57cd397c1f6d803f953e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
5
|
+
### Pre-requisites
|
10
6
|
|
11
|
-
|
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
|
-
|
12
|
+
### Install mapp2g using gem
|
14
13
|
|
15
|
-
|
16
|
-
|
17
|
-
|
14
|
+
```
|
15
|
+
gem install mapp2g
|
16
|
+
```
|
18
17
|
|
19
18
|
## Usage
|
20
19
|
|
21
|
-
|
22
|
-
|
23
|
-
|
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
|
-
|
29
|
+
(example)
|
30
|
+
```
|
31
|
+
mapp2g -q human_genome.fasta -q p53.protein.fasta
|
32
|
+
```
|
26
33
|
|
27
|
-
|
34
|
+
Reference genomes should be formated in blastdb before running mapp2g. blastdb can be made as follws:
|
28
35
|
|
29
|
-
|
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
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
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
|
|
data/lib/mapp2g/version.rb
CHANGED
@@ -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.
|
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-
|
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:
|