indication

master
chaopower 2023-12-12 11:20:52 +08:00
parent 2844ff3592
commit f31e71b0b7
3 changed files with 40 additions and 7 deletions

View File

@ -191,7 +191,8 @@ workflow pipeline {
name=tumor, name=tumor,
normal=normal, normal=normal,
output_dir=workdir, output_dir=workdir,
cancer=cancer cancer=cancer,
project=project
} }
output { output {

View File

@ -2,8 +2,8 @@
use strict; use strict;
use warnings; use warnings;
my ($output_dir, $cancer_type) = @ARGV; die "useage:perl $0 output_dir cancer_type project" unless @ARGV == 3;
die "useage:perl $0 output_dir cancer_type" unless @ARGV == 2; my ($output_dir, $cancer_type, $project) = @ARGV;
my $database_path = defined $ENV{'DATABASE'} ? $ENV{'DATABASE'} : "/dataseq/jmdna/codes/reportbase"; my $database_path = defined $ENV{'DATABASE'} ? $ENV{'DATABASE'} : "/dataseq/jmdna/codes/reportbase";
@ -76,9 +76,38 @@ while (<THERAPY>) {
} }
} }
my $muts_ref = info();
my @muts = @$muts_ref;
for my $gene (sort keys %therapy) { for my $gene (sort keys %therapy) {
print OUT "$gene\t", join("/", @{$therapy{$gene}}), "\t未检出变异\t", join("/", @{$cancer{$gene}}), "\n"; # 是否检测
if (grep {$_ eq $gene} @muts) {
print OUT "$gene\t", join("/", @{$therapy{$gene}}), "\t未检出变异\t", join("/", @{$cancer{$gene}}), "\n";
}
}
sub info {
open INFO, "$database_path/info.csv";
# 读取并解析表头
my $header = <INFO>;
chomp($header);
my @column_names = split(',', $header);
while (<INFO>) {
chomp;
my @line = split(/,/, $_);
# 将数据与表头对应
my %record;
@record{@column_names} = @line;
if ($record{'project'} eq $project) {
if ($record{'mutation'} ne "NA") {
@muts = split(/\//, $record{'mutation'});
}
}
}
return \@muts
} }

View File

@ -10,12 +10,13 @@ task run_post {
String? normal String? normal
String output_dir String output_dir
String cancer String cancer
String project
command <<< command <<<
if [ ! -d ${output_dir}/report ];then if [ ! -d ${output_dir}/report ];then
mkdir ${output_dir}/report mkdir ${output_dir}/report
fi fi
indication.pl ${output_dir} ${cancer} indication.pl ${output_dir} ${cancer} ${project}
sample_post.py -s ${name} -o ${output_dir} sample_post.py -s ${name} -o ${output_dir}
postprocess.py -n ${name} -s ${normal} -c ${output_dir} -o ${output_dir}/report/${name}.merged_file.xlsx postprocess.py -n ${name} -s ${normal} -c ${output_dir} -o ${output_dir}/report/${name}.merged_file.xlsx
>>> >>>
@ -40,6 +41,7 @@ workflow call_postprocess {
String? normal String? normal
String output_dir String output_dir
String cancer String cancer
String project
if (run) { if (run) {
call run_post { call run_post {
@ -54,7 +56,8 @@ workflow call_postprocess {
name=name, name=name,
normal=normal, normal=normal,
output_dir=output_dir, output_dir=output_dir,
cancer=cancer cancer=cancer,
project=project
} }
} }