cwords 0.1.12 → 0.1.13

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.
Files changed (2) hide show
  1. data/scripts/cwords.rb +6 -5
  2. metadata +3 -3
@@ -50,7 +50,7 @@ $coptions = OptionParser.new do |opts|
50
50
  opts.on( "--onlyanno", "only process annotated (i.e. mirbase) words") {|o| options[:onlyanno] = true}
51
51
 
52
52
  # rank control
53
- opts.on("-x", "--rank_all", "do not split positive and neg. values") {|o| options[:rank_all] = true}
53
+ opts.on("-x", "--rank_split", "analyze positive and neg. values separetely") {|o| options[:rank_all] = true}
54
54
  opts.on("-m", "--rank_split_median", "split ranked list at median") {|o| options[:rank_split_median] = true}
55
55
  opts.on("-i", "--rank_inverse", "inverse all ranked lists") {|o| options[:rank_inverse] = true}
56
56
  opts.on("-a", "--rank_abs", "rank by absolute value") {|o| options[:rank_abs] = true}
@@ -107,6 +107,7 @@ nperms=options[:permutations]
107
107
  ### Main program
108
108
  ###
109
109
 
110
+ puts ">> Analysis date: " + Time.now.to_s
110
111
  puts ">> Parameters"
111
112
  options.each{|k,v| puts sprintf("%-20s: %s",k,v) if !v.nil?}
112
113
 
@@ -216,7 +217,7 @@ if sequences
216
217
  seqsh = us.shuffle
217
218
  expected = Array.new(wids.size,0)
218
219
  options[:wordsize].each{|ws| (0..seqsize-ws).each{|i| wid = wids[seqsh[i, ws]]; expected[wid] += 1 if !wid.nil?}}
219
- observed.each_with_index{|x,widx| wordscores[seqidx][widx] =+ 1 if expected[widx]>=x}
220
+ observed.each_with_index{|x,widx| wordscores[seqidx][widx] += 1 if expected[widx]>=x}
220
221
  end
221
222
  end
222
223
  end
@@ -359,7 +360,7 @@ analyze.each do |set,nm|
359
360
  pmaxrs_pos << pmaxrs.abs
360
361
  plotfile.puts(([word+".rs."+pidx.to_s] + prsa).join(",")) if options[:plot_words]
361
362
  end
362
-
363
+
363
364
  pmean = pmaxrs_pos.mean
364
365
  pstd = pmaxrs_pos.stddev
365
366
 
@@ -372,7 +373,7 @@ analyze.each do |set,nm|
372
373
  zsc = (maxrs-pmean)/pstd
373
374
  plotfile.close if options[:plot_words]
374
375
  report[wid] = [wid,zsc,nil,leading_edge]
375
-
376
+
376
377
  end # wordsize
377
378
  pbar.finish
378
379
 
@@ -386,7 +387,7 @@ analyze.each do |set,nm|
386
387
  pfdrz.compact!
387
388
  fdrrank = pfdrz.map{|x| [x,nil]} # [zscore,word_report_index]
388
389
  report.each_with_index{|x,idx| fdrrank << [x[1],idx]}
389
- fdrrank = fdrrank.sort_by{|x| x[0]}.reverse # sort high zscore to low zscore
390
+ fdrrank = fdrrank.sort_by{|x| x[0].to_f}.reverse # sort high zscore to low zscore
390
391
  nfp, ntp = pfdrz.size.to_f, report.size.to_f
391
392
  ifp, itp = 0, 0
392
393
  fdrrank.each do |zsc,idx|
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 12
9
- version: 0.1.12
8
+ - 13
9
+ version: 0.1.13
10
10
  platform: ruby
11
11
  authors:
12
12
  - Anders Jacobsen
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-09-17 00:00:00 +02:00
17
+ date: 2010-09-21 00:00:00 +02:00
18
18
  default_executable:
19
19
  - bin/cwords
20
20
  dependencies: