bio-bigbio 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -33,8 +33,15 @@ fasta.each do | rec |
33
33
  end
34
34
  ```
35
35
 
36
- Write a FASTA file. Any object can be passed in, as long
37
- as it responds to 'descr' and 'seq.to_s', or 'id' and 'seq.to_s'. E.g.
36
+ Write a FASTA file. The simple way
37
+
38
+ ```ruby
39
+ fasta = FastaWriter.new(fn)
40
+ fasta.write('Test',"agtcta")
41
+ ```
42
+
43
+ Any object can be passed in, however, as long as it responds to
44
+ 'descr' and 'seq.to_s', or 'id' and 'seq.to_s'. E.g.
38
45
 
39
46
  ```ruby
40
47
  class StorageObject
@@ -46,7 +53,7 @@ mysequence.descr = 'Test'
46
53
  mysequence.seq = "agtcta"
47
54
  ```
48
55
 
49
- now we can write a FASTA file
56
+ write the FASTA file
50
57
 
51
58
  ```ruby
52
59
  fasta = FastaWriter.new(fn)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.3
1
+ 0.1.4
data/bio-bigbio.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "bio-bigbio"
8
- s.version = "0.1.3"
8
+ s.version = "0.1.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Pjotr Prins"]
@@ -7,15 +7,21 @@ class FastaWriter
7
7
  @f = File.open(fn,"w")
8
8
  end
9
9
 
10
- # write a FASTA item. An itex should respond to descr and seq,
11
- # or id and seq
12
- def write item
13
- if item.respond_to?(:descr)
14
- @f.write ">"+item.descr+"\n"
10
+ # write a FASTA item. Normally write using id,seq. If only one item is
11
+ # passed in, the item should respond to descr and seq, or id and seq.
12
+ def write id, seq = nil
13
+ if seq == nil
14
+ item = id
15
+ if item.respond_to?(:descr)
16
+ @f.write ">"+item.descr+"\n"
17
+ else
18
+ @f.write ">"+item.id+"\n"
19
+ end
20
+ @f.write item.seq.to_s.strip+"\n"
15
21
  else
16
- @f.write ">"+item.id+"\n"
22
+ @f.write ">"+id+"\n"
23
+ @f.write seq.to_s.strip+"\n"
17
24
  end
18
- @f.write item.seq.to_s.strip+"\n"
19
25
  end
20
26
 
21
27
  def close
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bio-bigbio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-02-03 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bio
16
- requirement: &13483940 !ruby/object:Gem::Requirement
16
+ requirement: &15446660 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 1.4.1
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *13483940
24
+ version_requirements: *15446660
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: bio-logger
27
- requirement: &13483220 !ruby/object:Gem::Requirement
27
+ requirement: &15445800 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 0.9.0
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *13483220
35
+ version_requirements: *15445800
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec
38
- requirement: &13482380 !ruby/object:Gem::Requirement
38
+ requirement: &15445180 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 2.3.0
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *13482380
46
+ version_requirements: *15445180
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: bundler
49
- requirement: &13467960 !ruby/object:Gem::Requirement
49
+ requirement: &15444540 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 1.0.0
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *13467960
57
+ version_requirements: *15444540
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: jeweler
60
- requirement: &13466160 !ruby/object:Gem::Requirement
60
+ requirement: &15443800 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 1.5.2
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *13466160
68
+ version_requirements: *15443800
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rcov
71
- requirement: &13465220 !ruby/object:Gem::Requirement
71
+ requirement: &15440240 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,7 +76,7 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *13465220
79
+ version_requirements: *15440240
80
80
  description: Fasta reader, ORF emitter, sequence translation
81
81
  email: pjotr.public01@thebird.nl
82
82
  executables:
@@ -139,7 +139,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
139
139
  version: '0'
140
140
  segments:
141
141
  - 0
142
- hash: -2925433248995829761
142
+ hash: -2436097965031091716
143
143
  required_rubygems_version: !ruby/object:Gem::Requirement
144
144
  none: false
145
145
  requirements: