[go: up one dir, main page]

Menu

[78dfa4]: / cutLa.awk  Maximize  Restore  History

Download this file

27 lines (26 with data), 426 Bytes

 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
#awk -f cutLa.awk extra_cuts.txt test.la
(NR==FNR){
++c[$1]
sites[$1,c[$1]]=$2
}
(NR!=FNR){
if ($1 in c) {
start = $7+0
end = $8+0
orientation=$4
found = 0
for (i = 1; i <= c[$1]; ++i) {
s = sites[$1, i]
if (s > start && s < end) {
print $1"\t"start"\t"s"\t"orientation
start = s + 1
++found
}
}
if (found > 0)
print $1"\t"start"\t"end"\t"orientation
else
print
} else
print
}