a b/modules/RawDB/scripts/bisect10.pl
1
#!/usr/bin/perl
2
3
# Bisect fm_sample_independent.tab
4
# Filename provided in command line
5
6
# Usage: bisect10.pl fm_sample_independent.tab > out-file
7
8
use bytes;
9
10
# Take input from file
11
$samplefile = shift;
12
open(TAB, "<$samplefile") or die "Can't open file $samplefile \n";
13
14
$count = 0;
15
# open(my $headerline, '>>', 'headerline.out'); # Configure out file for headerline
16
open(my $lungad10, '>>', 'lungad10.out'); # Configure out file for lungad_1
17
open(my $melanoma10, '>>', 'melanoma10.out'); # Configure out file for melanoma_1
18
19
while($line = <TAB>) {
20
    if ($count == 0) { # This is for the header line
21
        print "Hi \n";
22
    }
23
    else {
24
        if ($count == 1) { # This is for the lungad_10 line
25
            print $lungad10 $line;
26
            close $lungad10;
27
        }
28
        else {
29
            if ($count == 43) { # This is for the melanoma_10 row
30
                print $melanoma10 $line;
31
                close $melanoma10;
32
            }
33
            else {
34
                print "Other lines \n";
35
            }
36
        }
37
    }
38
    $count++;
39
}
40
41
print "Done. \n";