[9fab9f]: / modules / RawDB / scripts / bisect1.pl

Download this file

43 lines (35 with data), 1.1 kB

 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
#!/usr/bin/perl
# Bisect fm_sample_independent.tab
# Filename provided in command line
# Usage: bisect1.pl fm_sample_independent.tab > out-file
use bytes;
# Take input from file
$samplefile = shift;
open(TAB, "<$samplefile") or die "Can't open file $samplefile \n";
$count = 0;
open(my $headerline, '>>', 'headerline.out'); # Configure out file for headerline
open(my $lungad1, '>>', 'lungad1.out'); # Configure out file for lungad_1
open(my $melanoma1, '>>', 'melanoma1.out'); # Configure out file for melanoma_1
while($line = <TAB>) {
if ($count == 0) { # This is for the header line
print $headerline $line;
close $headerline;
}
else {
if ($count == 2) { # This is for the lungad_1 line
print $lungad1 $line;
close $lungad1;
}
else {
if ($count == 44) { # This is for the melanoma_1 row
print $melanoma1 $line;
close $melanoma1;
}
else {
print "Other lines \n";
}
}
}
$count++;
}
print "Done. \n";