-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgs_format.pl.save
673 lines (637 loc) · 23.6 KB
/
gs_format.pl.save
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
#!/usr/bin/env perl
# Author: Zhao
# Date: 2011.11.11
# Purpose: format txt file outputed from Genespring
# Update: 2012-01-20 11:54
# Update:支持纯数字命名
use Data::Table;
use Smart::Comments;
use Excel::Writer::XLSX;
use threads;
use Thread::Semaphore;
use 5.010;
use warnings;
$cpus = 4;
$semaphore = new Thread::Semaphore($cpus);
$s_prefix = "sample";
$g_prefix = "group";
$stime = time;
mkdir "go";
mkdir "path";
open( SE, $s_prefix . "Expression.txt" ) || die $!;
while (<SE>) {
last unless (/^#/);
$valid = $1 if (/(\d+) out of \d+/);
$lc = $1 if (/Lower cut-off: (\d+).0/);
$plat = 1 if (/Technology.*NimbleGen/i);
$plat = 2 if (/Technology.*Agilent/i);
}
close(SE);
$name = fromTSV("name.txt");
$sn = $name->nofRow;
$sExp = fromTSV( $s_prefix . "Expression.txt" );
if ( $plat == 1 ) {
# remove space in gene name
$sExp->colMap('GENE_NAME',sub {s/^\s+//;$_});
$sExp->colMap('DESCRIPTION',sub {s/^\s+//;$_});
}
@sDiff = glob "$s_prefix*-*.txt";
open( SD, $sDiff[0] ) || die $!;
while (<SD>) {
last unless (/^#/);
$fc = $1 if (/Fold.Change cut-off.*?([\d\.]+)/i);
$pc = $1 if (/p-value cut-off.*?([\d\.]+)/i);
}
close(SD);
$gn = -f $g_prefix . "Expression.txt" ? 1 : 0;
$gExp = fromTSV( $g_prefix . "Expression.txt" ) if $gn;
@gDiff = glob "$g_prefix*-*.txt" if $gn;
@group = keys %{ { $name->col('Group'), reverse $name->col('Group') } } if $gn;
$gn = scalar @group if $gn;
die "Only one group!" if ( $gn == 1 );
$hc = $gn == 0 ? 1 : 2;
print "\tQ1. clustering was performed based on:\n\t1. \"All Targets Value\"\n\t2. differentially expressed genes\t[$hc]:";
$ci = <STDIN>;
chomp($ci);
$hc = $ci if ( $ci eq 1 || $ci eq 2 );
# 汇总处理
$semaphore->down();
$thread = async {
### ---------- preparing gene.xlsx --------------------------------
$book = Excel::Writer::XLSX->new('Gene Expression Profiling Data.xlsx');
&set_format;
&ag_filter;
if ( $gn != 0 ) {
$exp = subTables(
[
$gExp, [ 0, 2 .. ( $gn * $plat + 1 ) ],
$sExp, [ 2 .. ( $sExp->nofCol - $plat ) ]
]
);
}
else {
$exp = subTables( [ $sExp, [ 0, 2 .. ( $sExp->nofCol - $plat ) ] ] );
}
@title = $exp->header;
&set_note1;
$sheet = $book->add_worksheet("All Targets Value");
$sheet->merge_range( "A1:M1", $noteATV, $note );
$sheet->set_row( 0, 120 );
@title = map { $_ =~ s/raw/normalized/; $_ } $exp->header if $plat == 1;
$sheet->merge_range( 2, 1, 2, $gn, "Group-Raw Intensity", $GRI )
if ( $plat == 2 && $gn > 1 );
$sheet->merge_range(
2, ( $plat - 1 ) * $gn + 1,
2, $plat * $gn,
"Group-Normalized Intensity", $GNI
) if $gn;
$sheet->merge_range(
2, $plat * $gn + 1,
2, $plat * $gn + $sn,
"Raw Intensity", $RI
) if ( $plat == 2 && $sn > 1 );
$sheet->merge_range(
2, $plat * $gn + $sn * ( $plat - 1 ) + 1,
2, $plat * $gn + $sn * $plat,
"Normalized Intensity", $NI
);
$sheet->merge_range(
2, $plat * $gn + $sn * $plat + 1,
2, $exp->nofCol - 1,
"Annotations", $ANN
);
$sheet->write_row( 'A4', \@title, $bold );
$sheet->write_col( 'A5', $$exp{'data'}, $format );
$sheet->set_column( 0, $exp->nofCol - 1, 10 );
$sheet = $book->add_worksheet("Box Plot");
$sheet->merge_range( "A1:M1", $noteBP, $note );
$sheet->set_row( 0, 120 );
$sheet = $book->add_worksheet("Scatter Plot");
$sheet->merge_range( "A1:M1", $noteSP, $note );
$sheet->set_row( 0, 80 );
$sheet = $book->add_worksheet("Hierarchical Clustering Map");
$sheet->merge_range( "A1:M1", $noteHC, $note );
$sheet->set_row( 0, 140 );
$book->close();
### gene.xlsx saved
$semaphore->up();
};
$thread->detach();
$semaphore->down();
$thread = async {
### ---------- preparing diff.xlsx --------------------------------
$book = Excel::Writer::XLSX->new(
$gn == 0
? 'Differentially Expressed Genes.xlsx'
: 'Differentially Expressed Genes(Passed Volcano Plot).xlsx'
);
&set_format;
for ( $i = 0 ; $i < @sDiff ; $i++ ) {
$sDiff[$i] =~ /$s_prefix(\S+-\S+)\.txt/;
$sc = $1;
if ( $gn != 0 ) {
$gDiff[$i] =~ /$g_prefix(\S+-\S+)\.txt/;
$gc = $1;
unless ( $sc eq $gc ) {
say "File missed for $gc $sc.";
}
}
$sc =~ s/-/ vs /;
$sExp = fromTSV( $sDiff[$i] );
$gExp = fromTSV( $gDiff[$i] ) if $gn;
if ( $plat == 1 ) {
# remove space in gene name
$sExp->colMap('GENE_NAME',sub {s/^\s+//;$_});
$sExp->colMap('DESCRIPTION',sub {s/^\s+//;$_});
}
&ag_filter;
if ( $gn != 0 ) {
$exp = subTables( [ $gExp, [ 0 .. ( 2 * $plat + 3 ) ],
$sExp, [ 4 .. ( $sExp->nofCol - $plat ) ] ] );
$up = $exp->match_pattern('$_->[3] eq "up"');
$down = $exp->match_pattern('$_->[3] eq "down"');
}
else {
$exp = subTables( [$sExp, [ 0, 3 .. ( $sExp->nofCol - $plat ) ]] );
$up = $exp->match_pattern('$_->[2] eq "up"');
$down = $exp->match_pattern('$_->[2] eq "down"');
}
$snp = 0;
@title = $sExp->header;
map {if(/raw/){$snp++;}} @title;
&set_note2;
# up
$sheet = $book->add_worksheet( &sheet_name($sc, '_up') );
$sheet->set_tab_color(45);
$sheet->merge_range( 0,0,0,$up->nofCol - 1, $noteUD, $note );
$sheet->set_row( 0, $gn == 0 ? 135 : 130 + $plat * 30 );
@title = $up->header;
@title = map { $_ =~ s/raw/normalized/; $_ } $up->header if $plat == 1;
$sheet->merge_range(
2, 0, 2,
$up->nofCol - 1,
"$sc $fc fold up regulated genes", $UP
);
&title_format;
$sheet->write_row( 'A5', \@title, $bold );
$sheet->write_col( 'A6', $$up{'data'}, $format );
$s_c = $sc;
$s_c =~ s/ /_/g;
open( GO, ">go/$s_c-up.txt" ) || die $!;
open( PA, ">path/$s_c-up.txt" ) || die $!;
foreach $gene ( grep { !/^$|^N\/A$/ }
$up->col( $plat == 1 ? 'GENE_NAME' : 'GeneSymbol' ) ) {
say GO $gene;
say PA "$gene\torange";
}
# down
$sheet = $book->add_worksheet( &sheet_name($sc, '_down') );
$sheet->set_tab_color(42);
$sheet->merge_range( 0,0,0,$down->nofCol - 1, $noteUD, $note );
$sheet->set_row( 0, $gn == 0 ? 135 : 130 + $plat * 30 );
@title = $down->header;
@title = map { $_ =~ s/raw/normalized/; $_ } $down->header
if $plat == 1;
$sheet->merge_range( 2, 0, 2, $down->nofCol - 1,
"$sc $fc fold down regulated genes", $DOWN
);
&title_format;
$sheet->write_row( 'A5', \@title, $bold );
$sheet->write_col( 'A6', $$down{'data'}, $format );
open( GO, ">go/$s_c-down.txt" ) || die $!;
open( PA, ">path/$s_c-down.txt" ) || die $!;
foreach $gene ( grep { !/^$|^N\/A$/ }
$down->col( $plat == 1 ? 'GENE_NAME' : 'GeneSymbol' ) ) {
say GO $gene;
say PA "$gene\tyellow";
}
}
close GO;
close PA;
if ( $gn != 0 ) {
$sheet = $book->add_worksheet("Volcano Plots");
$sheet->merge_range( "A1:M1", $noteVP, $note );
$sheet->set_row( 0, 160 );
}
$book->close();
### diff.xlsx saved
$semaphore->up();
};
$thread->detach();
if ( $plat == 2 && -f '../' . $name->elm( 0, 'Samples' ) ) {
for ( $i = 0 ; $i < $name->nofRow ; $i++ ) {
$sample_name{ '../' . $name->elm( $i, 'Samples' ) } =
'prefix_'.$name->elm( $i, 'Sample' );
# $image_name{ '../' . $name->elm( $i, 'Samples' ) } =
$image_name{$i}[0] = '../' . $name->elm( $i, 'Samples' );
$image_name{$i}[1] = $name->elm( $i, 'Sample' );
}
$semaphore->down();
$thread = async {
### ---------- preparing 'Raw Intensity.xlsx' ---------------------
foreach $i ( sort {$image_name{$a}[1] cmp $image_name{$b}[1]} keys %image_name ) {
$rawfile = $image_name{$i}[0];
$samplename = $image_name{$i}[1];
### loading file: "$rawfile => $samplename"
unless ( defined $raw ) {
$raw = Data::Table::fromTSV( $rawfile, 1, undef,
{ OS => 1, skip_lines => 9 } );
$raw = $raw->subTable( undef,['Row', 'Col', 'ProbeName', 'SystematicName', 'gProcessedSignal' ]);
$raw->header(['Row','Col','ProbeName', 'SystematicName',$sample_name{$rawfile}]);
}
else {
$tmp = Data::Table::fromTSV( $rawfile, 1, undef,
{ OS => 1, skip_lines => 9 } );
$raw->addCol( $tmp->colRef('gProcessedSignal'),
$sample_name{$rawfile} );
}
}
$book = Excel::Writer::XLSX->new('Raw Intensity.xlsx');
&set_format;
$sheet = $book->add_worksheet("Raw Intensity");
&set_note0;
$sheet->merge_range( 0, 0, 0, $raw->nofCol - 1, $noteRI, $note );
$sheet->set_row( 0, 100 );
$sheet->set_column( 0, 1, 5 );
$sheet->set_column( 2, 3, 12 );
$sheet->set_column( 4, $raw->nofCol - 1, 10 );
@rtitle = map { s/prefix_//;$_ } $raw->header;
$sheet->write_row( 'A3', \@rtitle, $bold );
$raw->rotate if ( $raw->type == 0 );
$sheet->write_row( 'A4', $$raw{'data'}, $format );
$book->close();
### Raw Intensity.xlsx saved
$semaphore->up();
};
$thread->detach();
$semaphore->down();
$thread = async {
### ---------- extracting images ----------------------------------
my @file_bmp = glob "../*.bmp"; #get the name list of files;
my $total_image_number = 0;
my ( $image_w, $image_h, $txt );
foreach $bmp_name (@file_bmp) {
foreach $i ( keys %image_name ) {
$txt = $image_name{$i}[0];
next if (-f "$image_name{$i}[1].jpg");
my @content = split( /_/, $txt );
my $txt_image =
$content[0] . "_" . $content[1] . "_" . $content[2] . ".bmp";
my $image_extract_name = $txt;
if ( $txt_image eq $bmp_name ) {
$total_image_number++;
open( TXT, "$txt" ) || die "can't open iamge";
my ( $image_x, $image_y );
my @line = <TXT>;
my @data = split( /\t/, $line[10] );
$image_x = $data[8] / 2 - 15;
$image_y = $data[9] / 2 - 16;
if ( $total_image_number == 1 ) {
my @data2 = split( /\t/, $line[$#line] );
$image_w = $data2[8] / 2 + 15 - $image_x;
$image_h = $data2[9] / 2 + 16 - $image_y;
}
system(
"convert $bmp_name -crop ${image_w}x${image_h}+$image_x+$image_y -quality 100 $image_name{$i}[1].jpg"
);
### image: $image_name{$i}[1].'.jpg generated'
}
}
}
### images generated
$semaphore->up();
};
$thread->detach();
}
&waitquit;
### Job done. <press ENTER to quit> : time - $stime
<STDIN>;
exit;
sub sheet_name {
my $name = shift;
my $suffix = shift || '';
if (length($name) + length($suffix) > 31) {
$name = substr($name,0,31-length($suffix));
}
return $name.$suffix;
}
sub title_format {
if ( $gn == 0 ) {
$sheet->merge_range( 3, 1, 3, 2, 'Fold change and Regulation', $ANN );
$sheet->merge_range( 3, 3, 3, 4, 'Raw Intensity', $GRI ) if $plat == 2;
$sheet->merge_range(
3, $plat * 2 + 1,
3, $plat * 2 + 2,
'Normalized Intensity', $RI
);
$sheet->merge_range(
3, $plat * 2 + 3,
3, $up->nofCol - 1,
'Annotation', $ANN
);
}
else {
$sheet->merge_range( 3, 1, 3, 3, 'P-value Fold change and Regulation',
$ANN );
$sheet->merge_range( 3, 4, 3, 5, 'Group-Raw Intensity', $GRI )
if $plat == 2;
$sheet->merge_range(
3, $plat * 2 + 2,
3, $plat * 2 + 3,
'Group-Normalized Intensity', $RI
);
$sheet->merge_range(
3, $plat * 2 + 4,
3, $plat * 2 + $snp + 3,
'Raw Intensity', $GRI
) if $plat == 2;
$sheet->merge_range(
3, $plat * 2 + $snp * ( $plat - 1 ) + 4,
3, $plat * 2 + $snp * $plat + 3,
'Normalized Intensity', $GNI
);
$sheet->merge_range(
3, $plat * 2 + $snp * $plat + 4,
3, $up->nofCol - 1,
'Annotation', $ANN
);
}
$sheet->set_column( 0, $up->nofCol - 1, 10 );
}
sub ag_filter {
if ( $plat == 2 ) {
$sExp = $sExp->match_pattern(
'$_->[' . ( $sExp->nofCol - 1 ) . '] eq "false"' );
$gExp = $gExp->match_pattern(
'$_->[' . ( $gExp->nofCol - 1 ) . '] eq "false"' )
if defined $gExp;
}
}
sub set_format {
$format = $book->add_format();
$format->set_font('Arial');
$format->set_align("left");
$format->set_size(10);
$number = $book->add_format();
$number->set_num_format();
$bold = $book->add_format();
$bold->set_font('Arial');
$bold->set_align("left");
$bold->set_size(10);
$bold->set_bold();
$note = $book->add_format();
$note->set_font('Verdana');
$note->set_size(10);
$note->set_bg_color(43);
$note->set_text_wrap();
$note->set_align("top");
$GRI = $book->add_format();
$GRI->set_font('Arial');
$GRI->set_bold();
$GRI->set_align('center');
$GRI->set_size(10);
$GRI->set_bg_color(44);
$GNI = $book->add_format();
$GNI->set_font('Arial');
$GNI->set_bold();
$GNI->set_align('center');
$GNI->set_size(10);
$GNI->set_bg_color(45);
$RI = $book->add_format();
$RI->set_font('Arial');
$RI->set_bold();
$RI->set_align('center');
$RI->set_size(10);
$RI->set_bg_color(42);
$NI = $book->add_format();
$NI->set_font('Arial');
$NI->set_bold();
$NI->set_align('center');
$NI->set_size(10);
$NI->set_bg_color(50);
$ANN = $book->add_format();
$ANN->set_font('Arial');
$ANN->set_bold();
$ANN->set_align('center');
$ANN->set_size(10);
$ANN->set_bg_color(47);
$book->set_custom_color( 57, 0, 176, 80 );
$DOWN = $book->add_format();
$DOWN->set_font('Arial');
$DOWN->set_bold();
$DOWN->set_align('center');
$DOWN->set_size(10);
$DOWN->set_bg_color(57);
$UP = $book->add_format();
$UP->set_font('Arial');
$UP->set_bold();
$UP->set_align('center');
$UP->set_size(10);
$UP->set_bg_color(10);
}
sub fromTSV {
my $file = $_[0] || die "File not declared!";
### read: $file
my $t =
Data::Table::fromTSV( $file, 1, undef,
{ OS => 0, skip_pattern => '^\s*#' } );
$t->rotate if ( $t->type == 1 );
return $t;
}
sub outputTSV {
my ( $table, $file, $header ) = @_;
say "outputTSV() parameter ERROR!" unless defined $table;
$header = defined $header ? $header : 1;
if ( defined $file ) {
$table->tsv( $header, { OS => 0, file => $file } );
}
else {
print $table->tsv( $header, { OS => 0, file => undef } );
}
return $table->tsv( $header, { OS => 0, file => undef } );
}
sub headerCol {
my ( $table, $idx ) = @_;
return ( $table->header )[ @{$idx} ];
}
sub subTables { # [$table, [@colIdxs]]
my $para = $_[0];
my ( $table, $i );
for ( $i = 0 ; $i < $#$para ; $i += 2 ) {
unless ( defined $table ) {
$table =
$$para[$i]->subTable( undef,
[ headerCol( $$para[$i], $$para[ $i + 1 ] ) ] );
}
else {
$table->colMerge(
$$para[$i]->subTable(
undef, [ headerCol( $$para[$i], $$para[ $i + 1 ] ) ]
)
);
}
}
$table->rotate if ( $table->type == 1 );
return $table;
}
sub char {
my $no = $_[0];
$ch = chr( ( $no - 1 ) % 26 + 65 );
if ( $no / 26 > 1 ) {
$ch = chr( int( ( $no - 1 ) / 26 ) + 64 ) . $ch;
}
return $ch;
}
sub waitquit {
my $num = 0;
while ( $num < $cpus ) {
$semaphore->down();
$num++;
}
$semaphore->up($cpus);
}
sub set_note0 {
$noteRI = '# Column A: Row, the row number of the feature.
# Column B: Column, the column number of the feature.
# Column C: ProbeName, the name of each probe.
# Column D: SystematicName, the Genbank accession number.
# Column E~'
. char( 4 + $sn )
. ': Signal, the signal left after all the Feature Extracted Software processing steps have been completed (used for GeneSpring data normalization and further analysis).';
}
sub set_note1 {
my $ann_ids = join(', ',@title[($gn + $sn)*$plat + 1 .. ($exp->nofCol - 1) ]);
if ( $plat == 1 ) {
$noteATV =
"All Targets Value (Entities where at least $valid out of $sn samples have values greater than or equal to Lower cut-off: $lc.0)\n
# Column A: SEQ_ID, the sequence identifier.
" . (
$gn == 0
? ""
: "# Column B~"
. char( 1 + $gn )
. ": Normalized intensity of each group
"
)
. "# Column "
. char( $gn + 2 ) . "~"
. char( 1 + $gn + $sn )
. ": Normalized intensity of each sample, the gene expression summary value for the gene.
# Column "
. char( 2 + $gn + $sn ) . "~"
. char( $exp->nofCol )
. ": Annotations to each probe, including $ann_ids.";
}
else {
$noteATV =
"All Targets Value (Entities where at least $valid out of $sn samples have flags in Detected )\n
# Column A: ProbeName, it represents the probe name.
" . (
$gn == 0
? ""
: "# Column B~"
. char( 1 + $gn )
. ": Raw Intensity of each group (averaged intensity of replicate samples).
# Column "
. char( 2 + $gn ) . "~"
. char( 2 * $gn + 1 )
. ": log2 value of normalized intensity of each group (averaged intensity of replicate samples).
"
)
. "# Column "
. char( 2 * $gn + 2 ) . "~"
. char( 2 * $gn + $sn + 1 )
. ": Raw Intensity of each sample.
# Column "
. char( 2 * $gn + $sn + 2 ) . "~"
. char( 2 * $gn + 2 * $sn + 1 )
. ": log2 value of normalized intensity of each sample.
# Column "
. char( 2 * $gn + 2 * $sn + 2 ) . "~"
. char( $exp->nofCol )
. ": Annotations to each probe, including $ann_ids.";
}
$noteBP = "Box Plot\n
The boxplot is a traditional method for visualizing the distribution of a dataset. They are most useful for comparing the distributions of several datasets.
Here, a boxplot view is used to look at, and compare, the distributions of expression values for the samples or conditions in an experiment after normalization.\n
Press Ctrl and rolling button of your mouse to zoom in.";
$noteSP = "Scatter Plot\n
The scatterplot is a visualization that is useful for assessing the variation (or reproducibility) between chips.\n
Press Ctrl and rolling button of your mouse to zoom in.";
$hc = $hc == 1 ? '"All Targets Value"' : "differentially expressed genes";
$noteHC = "Heat Map and Unsupervised Hierarchical Clustering\n
Hierarchical clustering is one of the simplest and widely used clustering techniques for analysis of gene expression data. Cluster analysis arranges samples into groups based on their expression levels, which allows us to hypothesize about the relationships among samples. The dendrogram shows the relationships among the expression levels of samples.\n
Here, hierarchical clustering was performed based on $hc. Your experiment consists of $sn different conditions. The result of hierarchical clustering on conditions shows distinguishable gene expression profiling among samples.\n
Press Ctrl and rolling button of your mouse to zoom in.";
}
sub set_note2 {
my @title = $sExp->header;
# note in diff table in grouped condition
if ( $gn == 0 ) {
$ann_ids = join(', ',@title[(2*$plat + 5 ) .. ($sExp->nofCol - $plat)]);
$endcol = char( $up->nofCol );
$noteUD = $plat == 2
? "# Condition pairs: $sc
# Fold Change cut-off: $fc\n
# Column A: ProbeName, it represents probe name.
# Column B: Absolute Fold change, the absolute ratio (no log scale) of normalized intensities between two samples.
# Column C: Regulation, it depicts which one of the samples has greater or lower intensity values wrt other sample.
# Column D,E: Raw Intensity of each sample.
# Column F,G: log2 value of normalized intensity of each sample.
# Column H~$endcol: Annotations to each probe, including $ann_ids."
: "# Condition pairs: $sc
# Fold Change cut-off: $fc\n
# Column A: SEQ_ID, the sequence identifier.
# Column B: Absolute Fold change, the absolute ratio (no log scale) of normalized intensities between two samples.
# Column C: Regulation, it depicts which sample has greater or lower intensity values wrt other sample.
# Column D~E: Normalized Intensity of each sample, the gene expression summary value for the gene.
# Column F~$endcol: Annotations for each gene, including $ann_ids.";
}
else {
$ann_ids = join(', ',@title[($snp*$plat + 4 ) .. ($sExp->nofCol - $plat)]);
$noteUD = "# Condition pairs: $sc
# Fold Change cut-off: $fc
# P-value cut-off: $pc\n
" . (
$plat == 1
? "# Column A: SEQ_ID, the sequence identifier.
"
: "# Column A: ProbeName, it represents probe name.
"
)
. "# Column B: p-value, p-value calculated from T-Test.
# Column C: FCAbsolute, the absolute ratio (no log scale) of normalized intensities between two groups.
# Column D: Regulation, it depicts which one of the groups has greater or lower intensity values wrt other group.
" . (
$plat == 1
? ""
: "# Column E,F: Raw Intensity of each group (averaged intensity of replicate samples).
"
)
. "# Column "
. char( 3 + $plat * 2 ) . ","
. char( 4 + $plat * 2 )
. ": log2 value of normalized intensity of each group (averaged intensity of replicate samples).
" . (
$plat == 1
? ""
: "# Column "
. char( 5 + $plat * 2 ) . "~"
. char( 4 + $plat * 2 + $snp )
. ": Raw Intensity of each sample.
"
)
. "# Column "
. char( 5 + $plat * 2 + $snp * ( $plat - 1 ) ) . "~"
. char( 4 + $plat * ( 2 + $snp ) )
. ": log2 value of normalized intensity of each sample.
# Column "
. char( 5 + $plat * ( 2 + $snp ) ) . "~"
. char( $up->nofCol )
. ": Annotations to each probe, including $ann_ids.";
$noteVP = "Volcano plots\n
Volcano plots are a useful tool for visualizing differential expression between two different conditions. They are constructed using fold-change values and p-values, and thus allow you to visualize the relationship between fold-change and statistical significance (which takes both magnitude of change and variability into consideration).\n
The vertical lines correspond to $fc-fold up and down, respectively, and the horizontal line represents a p-value of $pc. So the red point in the plot represents the differentially expressed genes with statistical significance.\n
Press Ctrl and rolling button of your mouse to zoom in.";
}
}