Class: MyWorkerEst

Inherits:
MyWorker
  • Object
show all
Defined in:
lib/full_lengther_next/my_worker_EST.rb

Instance Method Summary collapse

Methods inherited from MyWorker

#check_blast, #check_mapping, #check_ncRNA, #check_prot_db, #check_testcode, #clean_subjec_ids_name, #closing_worker, #full_lenghter2, #get_prot_sequences, #hits_statistics, #map_transcriptome, #refine_analysis_with_exonerate, #replace_hits, #rescue_sequence, #run_blast, #search_best_orf_y_fl, #select_sequences, #write_querys, #write_targets

Instance Method Details

#blast_analysis(blast, array_seqs) ⇒ Object



40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/full_lengther_next/my_worker_EST.rb', line 40

def blast_analysis(blast, array_seqs)
  blast.querys.each_with_index do |query, i|
    if query.hits.first.nil?
      if !array_seqs[i].type == CODING #Keep if is coding
        @unmatch << array_seqs[i]
      end
    else
      seq = array_seqs[i]
      seq.hit = query.hits.first
      @match << seq
    end
  end  
end

#blastEST(array_seqs) ⇒ Object

CUSTOM FUNCTIONS



30
31
32
33
34
35
36
37
38
# File 'lib/full_lengther_next/my_worker_EST.rb', line 30

def blastEST(array_seqs)
  blast = run_blast(array_seqs, @blast_path, 'blastn', 1e-6, nil, false)
  if blast.nil?
    $LOG.info 'BLAST FAILED'
    Process.exit(-1)
  else
    blast_analysis(blast, array_seqs)
  end
end

#process_object(array_seqs) ⇒ Object



19
20
21
22
23
24
# File 'lib/full_lengther_next/my_worker_EST.rb', line 19

def process_object (array_seqs)
  $WORKER_LOG.info "Worker LIST #{array_seqs.length}"
  array_seqs.sort!{|s1, s2| s2.t_code <=> s1.t_code} #Order by testcode
  blastEST(array_seqs)
  return [@match, @unmatch]
end

#receive_initial_config(params) ⇒ Object

WORKER FUNCTIONS



11
12
13
14
15
16
17
# File 'lib/full_lengther_next/my_worker_EST.rb', line 11

def receive_initial_config(params)
  # Reads the parameters
  @options = params.first
  @blast_path = params.last
  @match = [] # Any sequence matching with a EST
  @unmatch = [] # Sequences with :test_code annotation that it hasn't match with a EST
end