-
Notifications
You must be signed in to change notification settings - Fork 0
/
singlecellpipeline.pl
96 lines (83 loc) · 2.18 KB
/
singlecellpipeline.pl
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
#!/usr/bin/perl
use strict;
use warnings;
use Getopt::Long;
use Cwd;
use POSIX qw(strftime);
use File::Basename;
my $configfile = "";
my $analysistype = "";
my $help;
my $date = strftime "%Y-%m-%d", localtime;
my $header = "
This script is used to perform quality control of single cell data.
Usage:
perl singlecellpipeline.pl [OPTIONS]
Options:
--Config = config file specifying the parameters *
--Analysistype = the type of analysis users will want to use *. Users can choose between CellQC, GenotypeQC, filtergenotypes, and filtersomatic.
--help : prints this mesage.
Author: Joanna Tan\n";
if ( @ARGV == 0 ) {
print "$header";
exit 0;
}
GetOptions("Config=s" => \$configfile, "Analysistype=s" => \$analysistype, "help" => \$help) or die "ERROR in input argument. Please type --help for more information\n";
if ($help) {
print $header;
exit 0;
}
my $dir = getcwd();
print "$dir\n";
my $script_dir = dirname(__FILE__);
print "$script_dir\n";
print "$analysistype\n";
if($analysistype eq "CellQC")
{
print "Cell Quality Control pipeline chosen\n";
my $cellcommand = "perl $script_dir/bin/cellqcpipeline.pl --C $configfile --D $script_dir";
my $exit_1=system($cellcommand);
if($exit_1 != 0)
{
print "Error! Cannot complete running pipeline\n";
exit($exit_1 >>8);
}
else
{
print "Pipeline Completed\n";
}
}
elsif($analysistype eq "GenotypeQC")
{
print "GenotypeQC pipeline chosen\n";
my $genocommand = "perl $script_dir/bin/genotypeQC.pl --C $configfile --D $script_dir";
my $exit_2 = system($genocommand);
if($exit_2 != 0)
{
print "Error! Cannot complete running $analysistype pipeline\n";
exit($exit_2 >> 8);
}
else
{
print "$analysistype pipeline completed\n";
}
}
elsif($analysistype eq "filtergenotypes")
{
print "Filtering genotypes and somatic mutations\n";
my $filtercommand = "perl $script_dir/bin/filtergenotype_and_somatic.pl --C $configfile --D $script_dir";
my $exit_3 = system($filtercommand);
if($exit_3 != 0)
{
print "Error! cannot complete running $analysistype pipeline\n";
exit($exit_3 >> 8);
}
else
{
print "$analysistype completed\n";
}
}
else
{
print "No such analysis - $analysistype. Type --help for more information\n";
}