0
|
1 #! /bin/bash
|
|
2
|
|
3 # usage: $0 <probes file> <snps file> <probes_out> <snps_out>
|
|
4
|
|
5 if [ $# -ne 4 ]
|
|
6 then
|
|
7 echo "error, unexpected number of arguments in $0"
|
|
8 exit
|
|
9 fi
|
|
10
|
|
11 probes=$1
|
|
12 snps=$2
|
|
13 probes_out=$3
|
|
14 snps_out=$4
|
|
15
|
|
16 echo ""
|
|
17 echo "$0: "
|
|
18 echo "probes: $probes, snps: $snps, probes_out: $probes_out, snps_out: $snps_out"
|
|
19 echo ""
|
|
20
|
|
21 # convert probes file
|
|
22 sed '1,1d' $probes > $probes_out.tmp
|
|
23 sed -i "s/chr/hs/g" $probes_out.tmp
|
|
24 sed -i '/NaN/d' $probes_out.tmp
|
|
25 sed -i '/hsMT/d' $probes_out.tmp
|
|
26 sed -i '/hsM/d' $probes_out.tmp
|
|
27 cut -f1,2,3,4 $probes_out.tmp > $probes_out
|
|
28
|
|
29
|
|
30 # convert snps file
|
|
31 sed '1,1d' $snps > $snps_out
|
|
32 sed -i "s/chr/hs/g" $snps_out
|
|
33 sed -i '/NaN/d' $snps_out
|
|
34 sed -i '/hsMT/d' $snps_out
|
|
35 sed -i '/hsM/d' $snps_out
|
|
36
|
|
37
|
|
38
|