~ubuntu-branches/ubuntu/vivid/cctools/vivid

« back to all changes in this revision

Viewing changes to sand/test/filter_verification/gen_candidates.sh

  • Committer: Bazaar Package Importer
  • Author(s): Michael Hanke
  • Date: 2011-05-07 09:05:00 UTC
  • Revision ID: james.westby@ubuntu.com-20110507090500-lqpmdtwndor6e7os
Tags: upstream-3.3.2
ImportĀ upstreamĀ versionĀ 3.3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
# Note: cctools has to be installed to execute this script.
 
3
# Generate candidates from FASTA file "random.fa". The candidates will be saved
 
4
# in file "random.cand". The format of each line in the .cand file is: 
 
5
# read1_name   read2_name   direction   start_position_in_read1   start_position_in_read2
 
6
 
 
7
. ../../../dttools/src/test_runner.common.sh
 
8
 
 
9
port=`find_free_port`
 
10
 
 
11
PATH=../../src:../../../dttools/src:$PATH
 
12
export PATH
 
13
 
 
14
error_state=0;
 
15
 
 
16
rm -f random.cfa
 
17
rm -f random.cand 
 
18
rm -rf random.cand.output
 
19
rm -f filter.log
 
20
rm -f worker.log
 
21
 
 
22
echo "Compressing reads ..."
 
23
sand_compress_reads < random.fa > random.cfa
 
24
 
 
25
echo "Starting worker for filtering ..."
 
26
work_queue_worker -t 5s -d all -o worker.log localhost $port &
 
27
wpid=$!
 
28
echo "Worker is process $wpid"
 
29
 
 
30
echo "Starting filter master ..."
 
31
sand_filter_master -s 100 -k 22 -p $port -d all -o filter.log random.cfa random.cand || { echo "Error in filtering."; kill -9 $wpid; exit 1 ; }
 
32
 
 
33
echo "Waiting for worker to exit"
 
34
wait $wpid
 
35
 
 
36
exit 0;