lorem_ipsum_bio 0.0.0 → 0.0.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2c1aeb80766af60230bf51edc2ea39af0a2dd4e9
4
- data.tar.gz: f872f3d272ad607e80390d7083099976fff7b4b0
3
+ metadata.gz: 2e4b6f5bad8822d2e4650414fc31d1da2945f020
4
+ data.tar.gz: 87a826da65789556449fe8a24857fe87ed043e18
5
5
  SHA512:
6
- metadata.gz: 3eb288ace2a792e63015f31c76e075e561d84271b8f358d577084e7c4213805e1e96023aae48af9789f867730fa797262a2f07afaee847aa73ab81b95de96a54
7
- data.tar.gz: 9e6bebc0d8ff9fb476ae240006f37c4d154dffb02cc34eec85d0c62905fa298b9a4e94743639802d25f7e0b841bd8673f9d528d335d668968f178b951187c546
6
+ metadata.gz: 8f87224d623dcb80926d28e8c6aedb6a28a6c5a85fb2eeeb76813ca2cb1c26d7ef86851e04bd683417a8ba0f2b00ca99c09165a8f94b5b1a84c8db53c5cfce97
7
+ data.tar.gz: d2515d7bfb23a446c35267526db68a3a67c8219c636e51f1b54ee27a8beba95157c0c91f7e7c05d3fccacf276ead5884d4e998a595ed1f97d2f40bc181d95ffa
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'lorem_ipsum_bio'
4
+
5
+ n = ARGV[0].to_i
6
+ print case ARGV[1..-1]
7
+ when [] # TODO
8
+ ''
9
+ when ['DNA'], ['dna']
10
+ LoremIpsumBio.random_DNA(n)
11
+ when ['RNA'], ['rna']
12
+ LoremIpsumBio.random_RNA(n)
13
+ when ['PROTEIN'], ['protein'], ['Protein'],
14
+ ['PROTEINS'], ['proteins'], ['Proteins'],
15
+ ['AA'], ['aa']
16
+ LoremIpsumBio.random_protein(n)
17
+ else
18
+ LoremIpsumBio.random_string(n, ARGV[1..-1])
19
+ end
@@ -1,5 +1,5 @@
1
1
  class LoremIpsumBio
2
- def self.random_chars(a, n)
2
+ def self.random_string(n, a)
3
3
  out_str = ''
4
4
  n.times { out_str << a.sample }
5
5
 
@@ -7,18 +7,18 @@ class LoremIpsumBio
7
7
  end
8
8
 
9
9
  def self.random_DNA(n)
10
- random_chars(['A', 'C', 'G', 'T'], n)
10
+ random_chars(n, ['A', 'C', 'G', 'T'])
11
11
  end
12
12
 
13
13
  def self.random_RNA(n)
14
- random_chars(['A', 'C', 'G', 'U'], n)
14
+ random_chars(n, ['A', 'C', 'G', 'U'])
15
15
  end
16
16
 
17
17
  def self.random_protein(n)
18
- random_chars(['A', 'C', 'D', 'E',
19
- 'F', 'G', 'H', 'I',
20
- 'K', 'L', 'M', 'N',
21
- 'P', 'Q', 'R', 'S',
22
- 'T', 'W', 'V', 'Y'], n)
18
+ random_chars(n, ['A', 'C', 'D', 'E',
19
+ 'F', 'G', 'H', 'I',
20
+ 'K', 'L', 'M', 'N',
21
+ 'P', 'Q', 'R', 'S',
22
+ 'T', 'W', 'V', 'Y'])
23
23
  end
24
24
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lorem_ipsum_bio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paweł Jankowski
@@ -13,10 +13,12 @@ dependencies: []
13
13
  description: Lorem Ipsum Bio is a toolkit for generating varied random biological
14
14
  sequences (especially usable as a control group in analysis)
15
15
  email: p94jankowski@gmail.com
16
- executables: []
16
+ executables:
17
+ - lorem_ipsum_bio
17
18
  extensions: []
18
19
  extra_rdoc_files: []
19
20
  files:
21
+ - bin/lorem_ipsum_bio
20
22
  - lib/lorem_ipsum_bio.rb
21
23
  homepage: http://rubygems.org/gems/lorem_ipsum_bio
22
24
  licenses: