-
Notifications
You must be signed in to change notification settings - Fork 4
/
func_x2y.sh
75 lines (66 loc) · 1.32 KB
/
func_x2y.sh
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
# X2Y
#------------------------------------------------------------------------------
lyx2ps()
{
local STRING
for STRING in $*; do
lyx $STRING -e ps
done
}
export -f lyx2ps
lyx2pdf()
{
local STRING
for STRING in $*; do
lyx $STRING -e pdf
done
}
export -f lyx2pdf
lyx2tex()
{
local STRING
for STRING in $*; do
lyx $STRING -e latex
done
}
export -f lyx2tex
tex2pdf()
{
local STRING
for STRING in $*; do
texi2dvi --pdf --quiet --clean $STRING
done
}
export -f tex2pdf
tex2ps()
{
local STRING
for STRING in $*; do
texi2dvi --quiet --clean $STRING
STRING=$(echo $STRING | sed 's/.tex$/.dvi/')
dvips $STRING
rm -f $STRING
done
}
export -f tex2ps
# INV_WOMBAT2ASREML & INV_ASREML2WOMBAT
#-------------------------------------------------------------------------------
# What: Convert inverse covariance matrix file in sparse matrix format
# (triplets i j x) between formats for ASReml and WOMBAT
# Who: Gregor Gorjanc
# When:
# * 2013-12 Initial version
#-------------------------------------------------------------------------------
inv_wombat2asreml()
{
n=$(wc -l $1 | awk '{ print $1 }')
let n=$n-1
tail -n $n $1 | awk '{ print $2" "$1" "$3 }'
}
export -f inv_wombat2asreml
inv_asreml2wombat()
{
echo "0.0"
awk '{ print $2" "$1" "$3 }' $1
}
export -f inv_asreml2wombat