This file is indexed.

/usr/share/logol/tools/cassiopeeSearch.rb is in logol 1.7.0-2.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/usr/bin/ruby

require 'open3'

# args: Err,Min,Sequence,MotifFileName,Mute,Max
#$1 = nb error
#minStart=$2
# If maxStart is equal to 0, do not take it into account
#maxStart=$6
#muteOnly=$5
#motifFileName=$4
#$3 sequence , add .index to name

nbSub = ARGV[0]
nbError = ARGV[1]
minStart = ARGV[2]
sequence = ARGV[3]
motifFileName = ARGV[4]
muteOnly = ARGV[5]
maxStart = ARGV[6]
# DNA/RNA/PROTEIN, no ambiguity for PROTEIN
type = " -m "+ARGV[7]
if ARGV[7].to_i != 2
  type += " -a "
end

#or_condition.logol.b61b7cbe-42b3-4c7a-9bf4-1b46eff4173f.1-41.fasta.tmp_486.fsa
# => or_condition.logol.b61b7cbe-42b3-4c7a-9bf4-1b46eff4173f.1-41.cass

DIR="${cassiopee_path}"

cmd = DIR+"cassiopeeknife -s "+sequence+" -o "+sequence+".cass"

#File.open('/tmp/debug.out', 'a') { |file| file.write(cmd+"\n") }

if ! File.exists?(sequence+".cass")
  Open3.popen3(cmd) do |stdin,stdout,stderr, wait_thr|
#    while line=stdout.gets
#        File.open('/tmp/debug.out', 'a') { |file| file.write(line+"\n") }
#    end
  end
#else
#    File.open('/tmp/debug.out', 'a') { |file| file.write("Index sequence already exists\n") }
end

index = ""
if ! File.exists?(sequence+".cass.idx")
  index = " -u "
end

outfile = " -o "+sequence+".cass.out"

if muteOnly.to_i == 1
  cmd = DIR+"cassiopee -r -s "+sequence+".cass -f "+motifFileName+" -e "+nbSub+" -x "+minStart+" -y "+maxStart + index + outfile +type
else
  cmd = DIR+"cassiopee -r -s "+sequence+".cass -f "+motifFileName+" -i "+nbError+" -e "+nbSub+" -x "+minStart+" -y "+maxStart + index + outfile +type
end

#File.open('/tmp/debug.out', 'a') { |file| file.write(cmd+"\n") }

Open3.popen3(cmd) do |stdin,stdout,stderr, wait_thr|
    #stdout.each {||}
    pid = wait_thr.pid # pid of the started process.
    exit_status = wait_thr.value # Process::Status object returned.
end

File.open(sequence+".cass.out", "r").each_line do |line|
   vals = line.split(/\t/)
   $stdout.puts vals[0]
   $stdout.puts vals[1]
   errs = vals[2].to_i+vals[3].to_i
   $stdout.puts errs.to_s
   $stdout.flush
end

File.delete(sequence+".cass.out")