--- /dev/null
+#!/bin/bash
+
+# This script collects data from
+# /media/oka_raid/backup/data/solexa_analysis/ATH/Transcriptome/Col-0/run_40/
+# and combines the map.vm files to a single map.vm resp. map_2nd.vm
+#
+
+function combine_and_check_maps {
+ # specifies project dir
+ run_dir=$1
+ # specifies vmatch round (either main or spliced)
+ round_dir=$2
+ # this is the result file ( map.vm or map_2nd.vm)
+ new_map=$3
+
+ current_map=$run_dir/1/length_38/${round_dir}/map.vm
+ echo "processing $current_map ..."
+ cat $current_map > $new_map
+ lane1_read_ctr=`cut -f1 $current_map | sort -u | wc -l`
+
+ current_map=$run_dir/2/length_38/${round_dir}/map.vm
+ echo "processing $current_map ..."
+ cat $current_map >> $new_map
+ lane2_read_ctr=`cut -f1 $current_map | sort -u | wc -l`
+
+ current_map=$run_dir/3/length_38/${round_dir}/map.vm
+ echo "processing $current_map ..."
+ cat $current_map >> $new_map
+ lane3_read_ctr=`cut -f1 $current_map | sort -u | wc -l`
+
+ combined_lanes_ctr=`echo "$lane1_read_ctr + $lane2_read_ctr + $lane3_read_ctr" | bc`
+ combined_read_ctr=`cut -f1 $new_map | sort -u | wc -l`
+
+ # here we check whether the number of reads of the combined file is the sum
+ # of the reads of the single lane files
+ if [ $combined_lanes_ctr -ne $combined_read_ctr ] ; then
+ echo "Error during combination of first vmatch run reads!"
+ fi
+}
+
+run_dir=/media/oka_raid/backup/data/solexa_analysis/ATH/Transcriptome/Col-0/run_40
+
+#mkdir /tmp/fabio
+map_1st=/tmp/fabio/map.vm
+map_2nd=/tmp/fabio/map_2nd.vm
+
+combine_and_check_maps $run_dir "main" $map_1st
+combine_and_check_maps $run_dir "spliced" $map_2nd