更新indication

master
chaopower 2023-12-15 14:35:38 +08:00
parent 1df27e6079
commit 5fb3c8d8f0
1 changed files with 15 additions and 21 deletions

View File

@ -5,26 +5,18 @@ use warnings;
die "useage:perl $0 output_dir cancer_type project" unless @ARGV == 3; die "useage:perl $0 output_dir cancer_type project" unless @ARGV == 3;
my ($output_dir, $cancer_type, $project) = @ARGV; my ($output_dir, $cancer_type, $project) = @ARGV;
my $len = length($cancer_type);
if ($len < 4) {
die "cancer_type 非ST开头且4位长度";
}
my $database_path = defined $ENV{'DATABASE'} ? $ENV{'DATABASE'} : "/dataseq/jmdna/codes/reportbase"; my $database_path = defined $ENV{'DATABASE'} ? $ENV{'DATABASE'} : "/dataseq/jmdna/codes/reportbase";
print "Indication药物注释使用路径$database_path\n"; print "Indication药物注释使用路径$database_path\n";
open OUT, ">$output_dir/mutation/indication.txt"; open OUT, ">$output_dir/mutation/indication.txt";
print OUT "基因\t检测内容\t检测情况\t肿瘤类型\n"; print OUT "基因\t检测内容\t检测情况\t肿瘤类型\n";
##本癌种FDA/NMPA/NCCN批准基因检测
=pod
##疾病翻译信息
open DIS,"/dataseq/jmdna/codes/reportbase/cancer_type.txt";
my (%dis,%dis2);
<DIS>;
while(<DIS>){
chomp;
my @line=split(/\t/);
$dis{lc$line[0]}=$line[1];
push @{$dis2{$line[3]}},$line[0];
push @{$dis2{$line[4]}},$line[0];
}
=cut
open DIS, "$database_path/oncotree.cancertype.20230801.txt"; open DIS, "$database_path/oncotree.cancertype.20230801.txt";
<DIS>; <DIS>;
@ -33,18 +25,20 @@ while (<DIS>) {
chomp; chomp;
my @line = split(/\t/); my @line = split(/\t/);
$dis{lc $line[2]} = $line[3]; $dis{lc $line[2]} = $line[3];
# $dis{lc $line[4]} = $line[5];
push @{$dis2{$line[0]}}, lc $line[2]; push @{$dis2{$line[0]}}, lc $line[2];
# push @{$dis2{$line[0]}}, lc $line[4];
push @id, $line[0]; push @id, $line[0];
} }
foreach my $ID ($cancer_type) { foreach my $ID ($cancer_type) {
my @family; my @family;
my @ids = split("", $ID); # my @ids = split("", $ID);
for (my $i = 1; $i < @ids; $i = $i + 2) { # for (my $i = 1; $i < @ids; $i = $i + 2) {
push @family, join("", @ids[0 .. $i]); # push @family, join("", @ids[0 .. $i]);
} # }
push @family, (grep {/^$ID/} @id); # 取前 4位 再加上ST
my $match_id = substr($cancer_type, 0, 4);
push @family, (grep {/^$match_id/} @id);
push @family, "ST";
foreach my $t (@family) { foreach my $t (@family) {
push @{$dis2{$ID}}, @{$dis2{$t}}; push @{$dis2{$ID}}, @{$dis2{$t}};
} }