forked from zy-optimistic/GAEP
-
Notifications
You must be signed in to change notification settings - Fork 1
/
gaap
executable file
·130 lines (113 loc) · 2.87 KB
/
gaap
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
#!/usr/bin/env perl
use warnings;
use strict;
use Getopt::Long;
use Data::Dumper;
use File::Basename;
use FindBin qw ($RealBin);
my $task = 'gaap';
my $mode = 0;
my $command = shift ;
my $usage = qq(
Program: gaap
Version: V1.0
Pipeline to assess genome assembly.
Usage: gaap <command> [options]
Command: pipe run pipeline
stat report genome basic information
macc base accuracy based on reads mapping
bkp breakpoints number detected
snvcov SNV-coverage dot plot
busco run busco
);
die $usage unless $command;
##------------------------------------main------------------------------------##
if ( $command eq 'pipe' ) {
system "perl $RealBin/scripts/pipeline.pl @ARGV" and exit(1);
}elsif ( $command eq 'stat' ) {
system "perl $RealBin/scripts/basic.pl @ARGV" and exit(1);
}elsif ( $command eq 'macc' ) {
system "perl $RealBin/scripts/stat_accuracy_base.pl @ARGV" and exit(1);
}elsif ( $command eq 'bkp' ) {
system "perl $RealBin/scripts/breakpoint_detected.pl @ARGV" and exit(1);
}elsif ( $command eq 'snvcov' ) {
system "perl $RealBin/scripts/cov_snp_dot.pl @ARGV" and exit(1);
}elsif ( $command eq 'busco' ) {
system "perl $RealBin/scripts/run_busco.pl @ARGV" and exit(1);
}else {
die "[$task] Error! Unrecognized command: $command.\n", $usage;
}
##---------------------------------subroutine---------------------------------##
#sub parse_conf {
# my $conf_file = shift;
# open CONF, '<', $conf_file or die "Can't open config file: $conf_file.\n";
# while (<CONF>) {
# chomp;
# next if /^#/;
# my ($parameter, $value) = split /=/, $_;
# next if !$value || $value =~ /^\s*$/;
# $parameter =~ s/^\s+//;
# $parameter =~ s/\s+$//;
# $value =~ s/^\s+//;
# $value =~ s/\s+$//;
# die "[$task] Parse config file error! Make sure there's no space in path.\n" if $value =~ /\s+/;
# $conf{$parameter} = $value;
# }
# %conf ? return %conf : die "[$task] Error! No value has been found in config file.\n";
#}
sub _system {
my $cmd = shift;
my $mode = shift if @_;
if ( $mode == 1 ) {
print $cmd,"\n";
}else {
print $cmd,"\n";
die "[$task] Can't run \"$cmd\".\n" if ( system $cmd );
}
return;
}
sub check_software {
my $software = shift;
my $path = shift if @_;
if ( $path ) {
if ( basename($path) eq "software" && -X $path ) {
$software = $path;
}else {
return "1";
}
}else {
my @path = split /:/, $ENV{PATH};
foreach ( @path ) {
$_ =~ s/\/$//;
return $software = "$_/$software" if -X "$_/$software";
}
return "1";
}
}
__END__
##DATA
#TGS reads
TGS_reads=
#TGS BAM
TGS_BAM=
#NGS reads
NGS_reads1=
NGS_reads2=
NGS_reads1.2=
NGS_reads2.2=
#NGS BAM
NGS_BAM_path=
#RNA seq
RNA_seq_reads1=
RNA_seq_reads2=
##SOFTWARE(path to executable file)
#samtools
path_to_samtools=
#bwa
path_to_bwa=
#hisat2
path_to_hisat2=
#minimap2
path_to_minimap2=
#bcftools
path_to_bcftools=