snp-search 0.29.0 → 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +21 -4
- data/VERSION +1 -1
- data/bin/snp-search +7 -7
- data/examples/example1.rb +2 -2
- data/snp-search.gemspec +1 -1
- metadata +20 -20
data/README.rdoc
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
= snp-search
|
2
2
|
|
3
|
-
|
3
|
+
SNPsearch is a tool that manages SNP data and allows for data importing, manipulating, editing and complex querying of SNP data. It can be used to evaluate the utility of SNPs for the assessment of genetic diversity between haploid strains and the management of genotype and phenotype data. Once a query is performed, SNPsearch can be used to convert the selected SNP data into FASTA sequences. SNPsearch is particularly useful in the analysis of phylogenetic trees that are based on SNP differences across whole core genomes. Queries can be made to answer critical genomic questions such as the association of SNPs with particular phenotypes.
|
4
4
|
|
5
5
|
== Obtaining and installing the code
|
6
|
-
|
6
|
+
SNPsearch is written in Ruby and operates in a Unix environment. It is made available as a gem. See the github site for more information (https://github.com/hpa-bioinformatics/snp-search).
|
7
7
|
|
8
8
|
To install snp-search, do
|
9
9
|
gem install snp-search
|
@@ -12,7 +12,7 @@ To install snp-search, do
|
|
12
12
|
|
13
13
|
Not much, you just need:
|
14
14
|
|
15
|
-
* Unix.
|
15
|
+
* Unix. Once snp-search is installed, all the necessary gems to run snp-search will also be installed from Rubygems (note that Rubygems requires admin privileges. If you do not have admin privileges then we suggest you install RVM: (http://beginrescueend.com/rvm/install/) and then gem install snp-search).
|
16
16
|
* ruby version 1.8.7 and above.
|
17
17
|
|
18
18
|
Thats it!
|
@@ -42,7 +42,9 @@ Usage:
|
|
42
42
|
The output is your database in sqlite3 format. If you like to view your table(s) and perform queries you can type
|
43
43
|
sqlite3 snp_db.sqlite3
|
44
44
|
|
45
|
-
Alternatively, you may download a SQL tool to view your database (e.g. SQLite sorcerer)
|
45
|
+
Alternatively, you may download a SQL tool to view your database (e.g. SQLite sorcerer).
|
46
|
+
|
47
|
+
Also, depending on the query, a concatenated SNP FASTA file may be outputed (see below).
|
46
48
|
|
47
49
|
== Examples
|
48
50
|
|
@@ -54,12 +56,27 @@ Usage:
|
|
54
56
|
|
55
57
|
ruby example1.rb -D your_db_name.sqlite3 -s list_of_your_species.txt -o output.fasta
|
56
58
|
|
59
|
+
options:
|
60
|
+
|
61
|
+
-V, Enable verbose mode
|
62
|
+
-D, The name of the database you like to query, Required
|
63
|
+
-o, output file, in fasta format
|
64
|
+
-s, The strains/samples you like to query, Required
|
65
|
+
-a, The gene you like to remove from analysis
|
66
|
+
-h, Print this help message
|
67
|
+
|
57
68
|
* Example2: This script queries the database and selects the number of unique SNPs within the list of the strains/samples provided. The output is the number of unique SNPs.
|
58
69
|
|
59
70
|
Usage:
|
60
71
|
|
61
72
|
ruby example2.rb -D your_db_name.sqlite3 -s list_of_your_species.txt
|
62
73
|
|
74
|
+
options:
|
75
|
+
|
76
|
+
-V, Enable verbose mode
|
77
|
+
-D, The name of the database you like to query, Required
|
78
|
+
-s, The strains/samples you like to query, Required
|
79
|
+
-h, Print this help message
|
63
80
|
|
64
81
|
== Contact
|
65
82
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.30.0
|
data/bin/snp-search
CHANGED
@@ -11,7 +11,7 @@ opts = Slop.new :help do
|
|
11
11
|
|
12
12
|
on :V, :verbose, 'Enable verbose mode'
|
13
13
|
on :n, :name=, 'Name of database, Required', true
|
14
|
-
on :
|
14
|
+
on :d, :database_reference_file=, 'Reference genome file, in gbk or embl file format, Required', true
|
15
15
|
on :v, :vcf_file=, '.vcf file, Required', true
|
16
16
|
on :c, :cuttoff_snp=, 'SNP quality cutoff, (default = 90)', :default => 90
|
17
17
|
on :t, :cuttoff_genotype=, 'Genotype quality cutoff (default = 30)', :default => 30
|
@@ -22,7 +22,7 @@ opts.parse
|
|
22
22
|
error_msg = ""
|
23
23
|
|
24
24
|
error_msg += "You must supply the -n option, it's a required field\n" unless opts[:name]
|
25
|
-
error_msg += "You must supply the -
|
25
|
+
error_msg += "You must supply the -d option, it's a required field\n" unless opts[:database_reference_file]
|
26
26
|
error_msg += "You must supply the -v option, it's a required field" unless opts[:vcf_file]
|
27
27
|
|
28
28
|
unless error_msg == ""
|
@@ -31,7 +31,7 @@ opts.parse
|
|
31
31
|
exit
|
32
32
|
end
|
33
33
|
|
34
|
-
abort "#{opts[:
|
34
|
+
abort "#{opts[:database_reference_file]} file does not exist!" unless File.exist?(opts[:database_reference_file])
|
35
35
|
|
36
36
|
abort "#{opts[:vcf_file]} file does not exist!" unless File.exist?(opts[:vcf_file])
|
37
37
|
|
@@ -42,15 +42,15 @@ establish_connection(opts[:name])
|
|
42
42
|
# Schema will run here
|
43
43
|
db_schema
|
44
44
|
|
45
|
-
ref = opts[:
|
45
|
+
ref = opts[:database_reference_file]
|
46
46
|
|
47
47
|
sequence_format = guess_sequence_format(ref)
|
48
48
|
|
49
49
|
case sequence_format
|
50
50
|
when :genbank
|
51
|
-
sequence_flatfile = Bio::FlatFile.open(Bio::GenBank,opts[:
|
51
|
+
sequence_flatfile = Bio::FlatFile.open(Bio::GenBank,opts[:database_reference_file]).next_entry
|
52
52
|
when :embl
|
53
|
-
sequence_flatfile = Bio::FlatFile.open(Bio::EMBL,opts[:
|
53
|
+
sequence_flatfile = Bio::FlatFile.open(Bio::EMBL,opts[:database_reference_file]).next_entry
|
54
54
|
else
|
55
55
|
puts "All sequence files should be of genbank or embl format"
|
56
56
|
exit
|
@@ -61,7 +61,7 @@ sequence_format = guess_sequence_format(ref)
|
|
61
61
|
vcf_mpileup_file = opts[:vcf_file]
|
62
62
|
|
63
63
|
# The populate_features_and_annotations method populates the features and annotations. It uses the embl/gbk file.
|
64
|
-
|
64
|
+
populate_features_and_annotations(sequence_flatfile)
|
65
65
|
|
66
66
|
#The populate_snps_alleles_genotypes method populates the snps, alleles and genotypes. It uses the vcf file, and if specified, the SNP quality cutoff and genotype quality cutoff
|
67
67
|
populate_snps_alleles_genotypes(vcf_mpileup_file, opts[:cuttoff_snp].to_i, opts[:cuttoff_genotype].to_i)
|
data/examples/example1.rb
CHANGED
@@ -10,7 +10,7 @@ opts = Slop.new :help do
|
|
10
10
|
banner "ruby query.rb [OPTIONS]"
|
11
11
|
|
12
12
|
on :V, :verbose, 'Enable verbose mode'
|
13
|
-
on :
|
13
|
+
on :D, :database=, 'The name of the database you like to query', true
|
14
14
|
on :o, :outfile=, 'output file, in fasta format', true
|
15
15
|
on :s, :strain=, 'The strains/samples you like to query', true
|
16
16
|
on :a, :annotation=, 'The gene you like to remove from analysis', true
|
@@ -22,7 +22,7 @@ end
|
|
22
22
|
opts.parse
|
23
23
|
|
24
24
|
puts "You must supply the -s option, it's a required field" and exit unless opts[:strain]
|
25
|
-
puts "You must supply the -
|
25
|
+
puts "You must supply the -D option, it's a required field" and exit unless opts[:database]
|
26
26
|
|
27
27
|
begin
|
28
28
|
puts "#{opts[:database]} file does not exist!" and exit unless File.exist?(opts[:database])
|
data/snp-search.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "snp-search"
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.30.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Ali Al-Shahib", "Anthony Underwood"]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snp-search
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.30.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -14,7 +14,7 @@ date: 2012-01-05 00:00:00.000000000Z
|
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activerecord
|
17
|
-
requirement: &
|
17
|
+
requirement: &2158653900 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ~>
|
@@ -22,10 +22,10 @@ dependencies:
|
|
22
22
|
version: 3.1.3
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *2158653900
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: bio
|
28
|
-
requirement: &
|
28
|
+
requirement: &2158653400 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
@@ -33,10 +33,10 @@ dependencies:
|
|
33
33
|
version: 1.4.2
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *2158653400
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: slop
|
39
|
-
requirement: &
|
39
|
+
requirement: &2158652900 !ruby/object:Gem::Requirement
|
40
40
|
none: false
|
41
41
|
requirements:
|
42
42
|
- - ~>
|
@@ -44,10 +44,10 @@ dependencies:
|
|
44
44
|
version: 2.4.0
|
45
45
|
type: :runtime
|
46
46
|
prerelease: false
|
47
|
-
version_requirements: *
|
47
|
+
version_requirements: *2158652900
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: sqlite3
|
50
|
-
requirement: &
|
50
|
+
requirement: &2158652340 !ruby/object:Gem::Requirement
|
51
51
|
none: false
|
52
52
|
requirements:
|
53
53
|
- - ~>
|
@@ -55,10 +55,10 @@ dependencies:
|
|
55
55
|
version: 1.3.4
|
56
56
|
type: :runtime
|
57
57
|
prerelease: false
|
58
|
-
version_requirements: *
|
58
|
+
version_requirements: *2158652340
|
59
59
|
- !ruby/object:Gem::Dependency
|
60
60
|
name: activerecord-import
|
61
|
-
requirement: &
|
61
|
+
requirement: &2158651840 !ruby/object:Gem::Requirement
|
62
62
|
none: false
|
63
63
|
requirements:
|
64
64
|
- - ~>
|
@@ -66,10 +66,10 @@ dependencies:
|
|
66
66
|
version: 0.2.8
|
67
67
|
type: :runtime
|
68
68
|
prerelease: false
|
69
|
-
version_requirements: *
|
69
|
+
version_requirements: *2158651840
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: rspec
|
72
|
-
requirement: &
|
72
|
+
requirement: &2158651360 !ruby/object:Gem::Requirement
|
73
73
|
none: false
|
74
74
|
requirements:
|
75
75
|
- - ~>
|
@@ -77,10 +77,10 @@ dependencies:
|
|
77
77
|
version: 2.3.0
|
78
78
|
type: :development
|
79
79
|
prerelease: false
|
80
|
-
version_requirements: *
|
80
|
+
version_requirements: *2158651360
|
81
81
|
- !ruby/object:Gem::Dependency
|
82
82
|
name: bundler
|
83
|
-
requirement: &
|
83
|
+
requirement: &2158650880 !ruby/object:Gem::Requirement
|
84
84
|
none: false
|
85
85
|
requirements:
|
86
86
|
- - ~>
|
@@ -88,10 +88,10 @@ dependencies:
|
|
88
88
|
version: 1.0.0
|
89
89
|
type: :development
|
90
90
|
prerelease: false
|
91
|
-
version_requirements: *
|
91
|
+
version_requirements: *2158650880
|
92
92
|
- !ruby/object:Gem::Dependency
|
93
93
|
name: jeweler
|
94
|
-
requirement: &
|
94
|
+
requirement: &2158650380 !ruby/object:Gem::Requirement
|
95
95
|
none: false
|
96
96
|
requirements:
|
97
97
|
- - ~>
|
@@ -99,10 +99,10 @@ dependencies:
|
|
99
99
|
version: 1.6.4
|
100
100
|
type: :development
|
101
101
|
prerelease: false
|
102
|
-
version_requirements: *
|
102
|
+
version_requirements: *2158650380
|
103
103
|
- !ruby/object:Gem::Dependency
|
104
104
|
name: rcov
|
105
|
-
requirement: &
|
105
|
+
requirement: &2158649880 !ruby/object:Gem::Requirement
|
106
106
|
none: false
|
107
107
|
requirements:
|
108
108
|
- - ! '>='
|
@@ -110,7 +110,7 @@ dependencies:
|
|
110
110
|
version: '0'
|
111
111
|
type: :development
|
112
112
|
prerelease: false
|
113
|
-
version_requirements: *
|
113
|
+
version_requirements: *2158649880
|
114
114
|
description: Use the snp-search toolset to query the SNP database
|
115
115
|
email: ali.al-shahib@hpa.org.uk
|
116
116
|
executables:
|
@@ -155,7 +155,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
155
155
|
version: '0'
|
156
156
|
segments:
|
157
157
|
- 0
|
158
|
-
hash:
|
158
|
+
hash: -2678213948828856035
|
159
159
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
160
160
|
none: false
|
161
161
|
requirements:
|