text_alignment 0.2.3 → 0.2.4

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
  SHA256:
3
- metadata.gz: 1ff237d2f6a69a7328f334b39dd355e2f35c45552219d874d4630957d80f3516
4
- data.tar.gz: 133f403758f32ce67fa340cedab21bd02945525a9a004519e245340f9cd2f9fb
3
+ metadata.gz: c61a711930d19f5a72bd4a4128f5f36038a185eeb203b9ca68afce143694dbd3
4
+ data.tar.gz: 173fa1ed0277f0384f0804e7a1ea02c3bd1a1eda20a5d3f57523028f815e69ac
5
5
  SHA512:
6
- metadata.gz: 050dc4978efd7e63a9862f4a8f5ac58e439e30c737d5a07bd6f5cd6dd9157be36324c12cec0957f4fe8b700265c54147701dd7bfd1d0107ecef84b31a20a95e7
7
- data.tar.gz: e542e4a90a02e9d8063355edb47fba2284ffc29e02090c9adce691012d1130b7782f624665b2f7bf772140983e548a130476a7d604a2166f0b835a48f245051b
6
+ metadata.gz: 8f2a018145a07ec1d9a5c2277fd4d1e4bdb694726cf0936c92e8f25addb325e485545b7a1373a265e3b60fe2da0e39cdccbad586968aef093ed2154070242173
7
+ data.tar.gz: 488390234e0e3b9d7d67389f303aed6e59bb0e16b1ad94908c8020be64b9c0bac9a9f404e42944fd37ece188377c930fd43596678a80ee24f3b00174c9e33aa4
@@ -0,0 +1,31 @@
1
+ #!/usr/bin/env ruby
2
+ require 'text_alignment'
3
+
4
+ require 'json'
5
+ require 'pp'
6
+
7
+ unless ARGV.length == 2
8
+ warn "align_annotations target_annotations(.json) reference_annotations(.json)"
9
+ exit
10
+ end
11
+
12
+ anns1 = JSON.parse File.read(ARGV[0].strip), :symbolize_names => true
13
+ anns2 = JSON.parse File.read(ARGV[1].strip), :symbolize_names => true
14
+
15
+ str1 = anns1[:text]
16
+ str2 = anns2[:text]
17
+
18
+ denotations = anns1[:denotations]
19
+
20
+ align = TextAlignment::TextAlignment.new(str1, str2, TextAlignment::MAPPINGS)
21
+ puts TextAlignment::sdiff2cdiff(align.sdiff)
22
+ puts "\n=====\n\n"
23
+
24
+ pp denotations
25
+ puts "-----"
26
+ new_denotations = align.transform_hdenotations(denotations)
27
+ pp new_denotations
28
+
29
+ # p align.common_elements
30
+ # puts "---------------"
31
+ # p align.mapped_elements
@@ -27,6 +27,7 @@ class TextAlignment::TextAlignment
27
27
  ## preprocessing
28
28
  str1 = str1.dup
29
29
  str2 = str2.dup
30
+ mappings = mappings.dup
30
31
 
31
32
  ## find the first nomatch character
32
33
  TextAlignment::NOMATCH_CHARS.each_char do |c|
@@ -181,35 +182,3 @@ class TextAlignment::TextAlignment
181
182
  @position_map_end = posmap_end.sort.to_h
182
183
  end
183
184
  end
184
-
185
- if __FILE__ == $0
186
- require 'json'
187
- require 'pp'
188
-
189
- str1 = "TI - Identification of a region which directs the monocytic activity of the\n colony-stimulating factor 1 (macrophage colony-stimulating factor) receptor\n promoter and binds PEBP2/CBF (AML1)."
190
- str2 = "Identification of a region which directs the monocytic activity of the colony-stimulating factor 1 (macrophage colony-stimulating factor) receptor promoter and binds PEBP2/CBF (AML1).\nThe receptor for the macrophage colony-stimulating factor (or colony-stimulating factor 1 [CSF-1]) is expressed from different promoters in monocytic cells and placental trophoblasts. We have demonstrated that the monocyte-specific expression of the CSF-1 receptor is regulated at the level of transcription by a tissue-specific promoter whose activity is stimulated by the monocyte/B-cell-specific transcription factor PU.1 (D.-E. Zhang, C.J. Hetherington, H.-M. Chen, and D.G. Tenen, Mol. Cell. Biol. 14:373-381, 1994). Here we report that the tissue specificity of this promoter is also mediated by sequences in a region II (bp -88 to -59), which lies 10 bp upstream from the PU.1-binding site. When analyzed by DNase footprinting, region II was protected preferentially in monocytic cells. Electrophoretic mobility shift assays confirmed that region II interacts specifically with nuclear proteins from monocytic cells. Two gel shift complexes (Mono A and Mono B) were formed with separate sequence elements within this region. Competition and supershift experiments indicate that Mono B contains a member of the polyomavirus enhancer-binding protein 2/core-binding factor (PEBP2/CBF) family, which includes the AML1 gene product, while Mono A is a distinct complex preferentially expressed in monocytic cells. Promoter constructs with mutations in these sequence elements were no longer expressed specifically in monocytes. Furthermore, multimerized region II sequence elements enhanced the activity of a heterologous thymidine kinase promoter in monocytic cells but not other cell types tested. These results indicate that the monocyte/B-cell-specific transcription factor PU.1 and the Mono A and Mono B protein complexes act in concert to regulate monocyte-specific transcription of the CSF-1 receptor."
191
-
192
-
193
- if ARGV.length == 2
194
- anns1 = JSON.parse File.read(ARGV[0].strip), :symbolize_names => true
195
- anns2 = JSON.parse File.read(ARGV[1].strip), :symbolize_names => true
196
- end
197
-
198
- str1 = anns1[:text]
199
- str2 = anns2[:text]
200
-
201
- denotations = anns1[:denotations]
202
-
203
- align = TextAlignment::TextAlignment.new(str1, str2, TextAlignment::MAPPINGS)
204
- puts TextAlignment::sdiff2cdiff(align.sdiff)
205
- puts "\n=====\n\n"
206
-
207
- pp denotations
208
- puts "-----"
209
- new_denotations = align.transform_hdenotations(denotations)
210
- pp new_denotations
211
-
212
- # p align.common_elements
213
- # puts "---------------"
214
- # p align.mapped_elements
215
- end
@@ -1,3 +1,3 @@
1
1
  class TextAlignment
2
- VERSION = '0.2.3'
2
+ VERSION = '0.2.4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: text_alignment
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jin-Dong Kim
@@ -49,7 +49,8 @@ description: |-
49
49
  of two character strings and annotations made to them.
50
50
  email:
51
51
  - jdkim@dbcls.rois.ac.jp
52
- executables: []
52
+ executables:
53
+ - align_annotations
53
54
  extensions: []
54
55
  extra_rdoc_files: []
55
56
  files:
@@ -58,6 +59,7 @@ files:
58
59
  - Gemfile.lock
59
60
  - LICENSE.txt
60
61
  - README.md
62
+ - bin/align_annotations
61
63
  - lib/text_alignment.rb
62
64
  - lib/text_alignment/approximate_fit.rb
63
65
  - lib/text_alignment/find_divisions.rb