blib/htdocs/tutorial/bin/expression_levels.pl untested

filter: Statementstmt 0.0% 0 / 32 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 5 Podpod n/a totaltotal 0.0% 0 / 39 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 #!/usr/bin/perl
2  
3 # simulated affy chip
4 use strict;
5  
6 # one affy series laid down every 100 bp
7 use constant SAMPLE_INTERVAL => 100;
8 use constant GENE_SIZE => 5000;
9 use constant GENE_DENSITY => 5; # 1 gene every 5 GENE_SIZE intervals
10 use constant GENOME_SIZE => 50000;
11  
12 my $gene_interval = 1;
13 while ($gene_interval < GENOME_SIZE) {
14 my $in_gene = rand(GENE_DENSITY) < 1;
15 my $base_intensity = $in_gene ? 800 : 200 ;
16 my $gene_size_variance = int(GENE_SIZE/2 - rand(GENE_SIZE/2));
17 my $gene_size += $gene_size_variance;
18 my $last_end;
19 for (my $i = 0; $i < $gene_size; $i += 100) {
20 my $score = int $base_intensity + (100-rand(200));
21 my $start = $gene_interval + $i;
22 my $end = $start + 99;
23 print join ("\t",qw(ctgA affy tlevel),$start,$end,$score,qw(. .),"Affy Expt1"),"\n";
24 $last_end = $end;
25 }
26 # round to nearest 100
27 $gene_interval = $last_end+1;
28 }