-
Notifications
You must be signed in to change notification settings - Fork 2
/
generate_report_summary_2.pl
50 lines (41 loc) · 1.08 KB
/
generate_report_summary_2.pl
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
#!/usr/bin/perl
use strict;
my $usage = "
This script will read corresponding files for each sample and generate a report which
perl $0 <run folder>
<run folder> = full path of the folder holding files for this sequence run
";
die $usage unless scalar @ARGV == 1;
my ($dir) = @ARGV;
my @temp = split("/", $dir);
my $run_name = pop @temp;
my $outFile = $dir."/Neoantigen_Report_".$run_name;
my %neo=();
open (OUT, ">$outFile") or die "can not open file $outFile!\n";
#&generate_table($dir);
print OUT "Sample","\t","Chr","\t","Pos","\t","WT","\t","Var","\t","Gene","\t","Type","\t","Refseq","\t","HLA","\t","Neoantigen","\t","Binding affinity","\n";
foreach my $s (`ls $dir`) {
my $str=$s;
chomp($str);
my $dirs=$dir."/".$str;
my $f_neo_snv=$dirs."/".$str.".neo.snv.summary";
my $f_neo_ind=$dirs."/".$str.".neo.indel.summary";
if(-f $f_neo_snv)
{
foreach my $l (`cat $f_neo_snv`)
{
my $ltr=$l;
chomp($ltr);
print OUT $str,"\t",$ltr,"\n";
}
}
if(-f $f_neo_ind)
{
foreach my $l (`cat $f_neo_ind`)
{
my $ltr=$l;
chomp($ltr); print OUT $str,"\t",$ltr,"\n";
}
}
}
close OUT;