forked from grubbybio/pRNASeqTools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
precheck.pm
119 lines (111 loc) · 3.03 KB
/
precheck.pm
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
#!/usr/bin/env perl
package precheck;
use Modern::Perl;
my $prefix = $1 if($0 =~ /^(.+)\/.+$/);
sub dependencies {
my ($self) = @_;
print STDERR "\nChecking dependent software...\n";
my $cutadapt = qx(cutadapt --version);
my $samtools = qx(samtools --version);
my $bowtie = qx(bowtie --version);
my $bowtie2 = qx(bowtie2 --version);
my $featureCounts = qx(featureCounts -v 2>&1);
my $shortstack = qx(ShortStack --version);
my $bedtools = qx(bedtools --version);
my $R = qx(R --version);
my $star = qx(STAR --version);
# my $clipper = qx(clipper -h 2>&1);
my $fasterq_dump = qx(fasterq-dump -h);
my $gffread = qx(gffread --version 2>&1);
# my $chip = qx(Genrich --version 2>&1);
my $sc = qx(umi_tools -v);
my $deeptools = qx(deeptools --version 2>&1);
my $bedgraphtobigwig = qx(bedGraphToBigWig 2>&1);
if($cutadapt =~ /^\d\./){
print STDERR "cutadapt version $cutadapt";
}else{
die "Please install cutadapt!\n";
}
if($samtools =~ /samtools (\d\.\d+)/){
if($1 lt "1"){
die "Please install samtools v1.x!\n";
}else{
print STDERR "samtools version $1\n";
}
}else{
die "Please install samtools v1.x!\n";
}
if($bowtie =~ /bowtie.+ (\d\.\d\.\d)/){
print STDERR "bowtie version $1\n";
}else{
die "Please install bowtie!\n";
}
if($bowtie2 =~ /version (\d\.\d\.\d)/){
print STDERR "bowtie2 version $1\n";
}else{
die "Please install bowtie2!\n";
}
if($featureCounts =~ /v(\d\.\d+\.\d+)/){
print STDERR "featureCounts version $1\n";
}else{
die "Please install featureCounts!\n";
}
if($shortstack =~ /ShortStack.+[34]/){
print STDERR "$shortstack";
}else{
die "Please install ShortStack!\n";
}
if($bedtools ne ""){
print STDERR "$bedtools";
}else{
die "Please install bedtools!\n";
}
if($R =~ /R version (\d\.\d\.\d+)/){
print STDERR "R version $1\n";
}else{
die "Please install R\n";
}
if($star =~ /(\d.+)/){
print STDERR "STAR version $1\n";
}else{
die "Please install STAR!";
}
# if($clipper =~ /^Usage/){
# print STDERR "CLIPper installed\n";
# }else{
# die "Please install CLIPper";
# }
if($fasterq_dump =~ /fasterq-dump.+(\d\.\d+\.\d)/){
print STDERR "fasterq-dump version $1\n";
}else{
die "Please install fasterq-dump!";
}
if($gffread =~ /(\d\.\d+\.\d)/){
print STDERR "gffread version $1\n";
}else{
die "Please install gffread!";
}
if($deeptools =~ /(\d\.\d+\.\d)/){
print STDERR "deeptools version $1\n";
}else{
die "Please install deeptools!";
}
# if($chip =~ /version (\d\.\d\.\d)/){
# print STDERR "Genrich version $1\n";
# }else{
# die "Please install Genrich!";
# }
if($sc =~ /(\d\.\d+\.\d)/){
print STDERR "UMI-tools version $1\n";
}else{
die "Please install the UMI-tools!";
}
if($bedgraphtobigwig =~ /bedGraphToBigWig v (\d)/){
print STDERR "bedGraphToBigWig version $1\n";
}else{
die "Please install UCSC-bedGraphToBigWig!";
}
system("Rscript --vanilla ".$prefix."/scripts/checkPackages.R");
print STDERR "Precheck completed!\n\n";
}
1;