lsa 0.1.0 → 0.1.1

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
  SHA1:
3
- metadata.gz: aeb489df0e1e3be796a50a6ed5f44267da76fcdc
4
- data.tar.gz: 03a46fe4c0aee315d155a076026655d42e91f434
3
+ metadata.gz: bce829681f089991e590e51004e9f005aeeaf5fd
4
+ data.tar.gz: f593d26fb0b6acfcc6fab9b78a9ffaefc42e2e1e
5
5
  SHA512:
6
- metadata.gz: 74f92994363b2f3232f22caf4c951970238ce062b40a0044d4ec946fbe51a5c6190c3904678c3d1f2c4f6866c972fde3afd2debd81a15076840a53cd9ff0ebe3
7
- data.tar.gz: 18e4792725af47610fcb0f443ca22389ebea7c6b4414c580b41ca5854094074134ed80efca572e9a65e57caf5465fc8b5d189e6339d021696f41a0f1359ad9b3
6
+ metadata.gz: ed48ee109b8b9716f1d0005b6115a40afb4497da06222d12f935662aead64534b3e5d0ba2c8e24be2f9f1e260281b2124cf5e1c835080b1ff0120a14543de109
7
+ data.tar.gz: 81a6f135ec5217025dbcc4ba16620ccb8292454d6b91453e5fd4cb2ee446dcb891f065c0c1eab345e510bf7bc838fe934c4a68d2374255f71cb729c2a3d34377
data/lib/lsa.rb CHANGED
@@ -4,26 +4,24 @@ require "abort_if"
4
4
 
5
5
  include AbortIf
6
6
 
7
-
8
-
9
-
10
7
  module Lsa
11
-
12
8
  def clean_str str
13
9
  str.strip.gsub(/[^\p{Alnum}_]+/, "_").gsub(/_+/, "_")
14
10
  end
15
11
 
16
-
17
12
  def parse_mapping_file mapping_fname, mmseqs_final_outf
18
13
  data_labels = []
19
14
  label2outf = {}
20
15
  doc2new_doc = {}
21
16
  File.open(mapping_fname, "rt").each_line.with_index do |line, idx|
22
17
  if idx.zero?
23
- curren_label, *data_labels = line.chomp.split("\t").map do |str|
18
+ current_label, *data_labels = line.chomp.split("\t").map do |str|
24
19
  clean_str str
25
20
  end
26
21
 
22
+ abort_if data_labels.any? { |label| label == "original" },
23
+ "Illegal data label: 'original'. Please change it."
24
+
27
25
  abort_unless data_labels.uniq.count == data_labels.count,
28
26
  "The data labels are not unique in #{mapping_fname}"
29
27
 
@@ -1,3 +1,3 @@
1
1
  module Lsa
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -0,0 +1,4 @@
1
+ file name group original
2
+ e_coli.faa.gz bacteria a
3
+ m_mazei.faa.gz archaea a
4
+ s_flexneri.faa.gz bacteria b
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lsa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Moore
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-07-23 00:00:00.000000000 Z
11
+ date: 2017-08-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: abort_if
@@ -109,14 +109,13 @@ files:
109
109
  - lib/lsa.rb
110
110
  - lib/lsa/version.rb
111
111
  - lsa.gemspec
112
- - test_files/#cluster_file.txt#
113
- - test_files/.#cluster_file.txt
114
112
  - test_files/cluster_file_another_group.txt
115
113
  - test_files/cluster_file_group.txt
116
114
  - test_files/cluster_file_original.txt
117
115
  - test_files/e_coli.faa.gz
118
116
  - test_files/m_mazei.faa.gz
119
117
  - test_files/mapping.txt
118
+ - test_files/mapping_with_bad_group_name.txt
120
119
  - test_files/s_flexneri.faa.gz
121
120
  - test_files/small/e_coli.faa.gz
122
121
  - test_files/small/m_mazei.faa.gz
@@ -1,3 +0,0 @@
1
- e_coli_faa_gz~orf_1 e_coli_faa_gz~orf_1
2
- e_coli_faa_gz~orf_1 m_mazei_faa_gz~orf_1
3
- e_coli_faa_gz~orf_1 s_flexneri_faa_gz~orf_1
@@ -1 +0,0 @@
1
- test_files/moorer@roaming-254-155.host.udel.edu.943