forked from WGLab/SeqMule
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Build
executable file
·99 lines (95 loc) · 3.41 KB
/
Build
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
#!/usr/bin/env perl
use strict;
use warnings;
use FindBin qw/$RealBin/;
use lib "$RealBin/lib"; #libary just needed for configuration
use SeqMule::Install;
chdir($RealBin); #alway go here for safety
#vars
my $author='Wang Genomics Lab <[email protected]>',
my $intro=
"SeqMule is an automated pipeline designed for next-generation sequencing data analysis.".
"It automatizes the calling of variants (SNPs, indels) from raw sequencing data generated".
"by Illumina and Iontorrent sequencing platforms. It integrates several most popular ".
"variant calling algorithms and is able to produce a comprehensive set of variants. ".
"Subsequently, these variants can be annotated and filtered by ANNOVAR with either a ".
"default or custom procedure";
my %sys_require=( #system-wide executables required
'java' => ['java'],
'GNU_Cplusplus' => ['g++'],
'gcc' => ['gcc'],
'unzip' => ['unzip'],
'r' => ['Rscript'],
'make' => ['make'],
'cmake' => ['cmake'],
'automake' => ['automake'],
'autoconf' => ['autoconf'],
'git' => ['git'],
'gzip' => ['gzip','gunzip'],
'tar' => ['tar'],
);
my %exe_require=( #core executables for each program
'fastqc' => ['fastqc'],
'bowtie' => ['bowtie'],
'bowtie2' => ['bowtie2'],
'bwa' => ['bwa'],
'samtools' => ['samtools','bcftools'],
'gatklite' => ['GenomeAnalysisTKLite.jar'],
'gatk' => ['GenomeAnalysisTK.jar'],
'picard' => ['SortSam.jar','MarkDuplicates.jar'],
'soap' => ['soap'],
'varscan' => ['varscan.jar'],
'soapsnp' => ['soapsnp','msort','soap2sam.pl'],
'tabix' => ['bgzip','tabix'],
'vcftools' => ['vcftools'],
'freebayes' => ['freebayes'],
'snap' => ['snap'],
'vt' => ['vt'],
#'snver' => ['SNVerIndividual.jar'],
);
my %opt_action=(
'status' => \&SeqMule::Install::status,
'installexes' => \&SeqMule::Install::installexes,
'freshinstall' => \&SeqMule::Install::freshinstall,
'clean' => \&SeqMule::Install::clean,
'debug' => \&SeqMule::Install::debug,
###########EXEs######################
'fastqc' => \&SeqMule::Install::fastqc,
'bowtie' => \&SeqMule::Install::bowtie,
'bowtie2' => \&SeqMule::Install::bowtie2,
'bwa' => \&SeqMule::Install::bwa,
'samtools' => \&SeqMule::Install::samtools,
'gatklite' => \&SeqMule::Install::gatklite,
'gatk' => \&SeqMule::Install::gatk,
'picard' => \&SeqMule::Install::picard,
'soap' => \&SeqMule::Install::soap,
'varscan' => \&SeqMule::Install::varscan,
'tabix' => \&SeqMule::Install::tabix,
'java' => \&SeqMule::Install::java,
'soapsnp' => \&SeqMule::Install::soapsnp,
'vcftools' => \&SeqMule::Install::vcftools,
'freebayes' => \&SeqMule::Install::freebayes,
'snap' => \&SeqMule::Install::snap,
'vt' => \&SeqMule::Install::vt,
#'snver' => \&SeqMule::Install::snver,
);
#user input
my $opt=shift @ARGV;
if ( (! defined $opt) or (! defined $opt_action{$opt}) )
{
warn "!" x 40,"\n\nWARNING: Invalid option!\n\n","!" x 40 if (defined $opt && ! defined $opt_action{$opt});
&{$opt_action{'status'}}($RealBin,\%sys_require,\%exe_require); #only status subroutine needs argument
exit 0;
}
if ($opt =~ /status|installexes|freshinstall|clean/)
{
&{$opt_action{$opt}}($RealBin,\%sys_require,\%exe_require);
} elsif ($opt =~ /debug/)
{
die "ERROR: one more argument expected (specify which option [for individual program] to run).\n" unless
defined $ARGV[0];
&{$opt_action{$opt}}($RealBin,$ARGV[0]);
} else
{
&{$opt_action{$opt}}($RealBin);
}