-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathscafe.download.demo.input
274 lines (188 loc) · 8.43 KB
/
scafe.download.demo.input
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
#!/usr/bin/env perl
# This chunk of stuff was generated by App::FatPacker. To find the original
# file's code, look for the end of this BEGIN block or the string 'FATPACK'
BEGIN {
my %fatpacked;
s/^ //mg for values %fatpacked;
my $class = 'FatPacked::'.(0+\%fatpacked);
no strict 'refs';
*{"${class}::files"} = sub { keys %{$_[0]} };
if ($] < 5.008) {
*{"${class}::INC"} = sub {
if (my $fat = $_[0]{$_[1]}) {
my $pos = 0;
my $last = length $fat;
return (sub {
return 0 if $pos == $last;
my $next = (1 + index $fat, "\n", $pos) || $last;
$_ .= substr $fat, $pos, $next - $pos;
$pos = $next;
return 1;
});
}
};
}
else {
*{"${class}::INC"} = sub {
if (my $fat = $_[0]{$_[1]}) {
open my $fh, '<', \$fat
or die "FatPacker error loading $_[1] (could be a perl installation issue?)";
return $fh;
}
return;
};
}
unshift @INC, bless \%fatpacked, $class;
} # END OF FATPACK CODE
#====================================================================================================================================================#
#<use>
$|++; #---turn on the auto flush for the progress bar
no warnings 'utf8';
use warnings;
use strict;
use Getopt::Long 'HelpMessage';
use Time::HiRes qw( time );
use File::Spec::Functions qw(rel2abs abs2rel);
use Cwd 'abs_path';
#<\use>
#====================================================================================================================================================#
#====================================================================================================================================================#
#<doc>
=head1 SYNOPSIS
5'-O~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~AAA-3'
O~~~AA O~~ O~ O~~~~~~~AO~~~~~~~~A
O~~ O~~ O~~ O~~ O~O~~ O~~ O~~
O~~ O~~ O~ O~~ O~~ O~~
O~~ O~~ O~~ O~~ O~~~~~AA O~~~~~~A
O~~ O~~ O~~~~~A O~~ O~~ O~~
O~~ O~~ O~~ O~~ O~~ O~~ O~~ O~~
O~~~~A O~~~ O~~ O~~O~~ O~~~~~~~AA
┌─ᐅ 5'-O~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-3'
...===┴========================================================================================...
Single Cell Analysis of Five-prime End (SCAFE) Tool Suite
---> download.demo.input <---
<--- download, demo input data for testing --->
Description:
This scripts download demo data and save in ./demo/input dir.
Usage:
download.demo.input
Dependencies:
wget
tar
For demo, cd to SCAFE dir and run,
scafe.download.demo.input
=head1 VERSION
v0.9.0-beta [March 20, 2021]
-Initial pre-release
v1.0.0 [June 6, 2022]
-Updated to v1.0.0 demo data
=cut
#<\doc>
#====================================================================================================================================================#
#====================================================================================================================================================#
#<lastCmdCalled>
#
# notCalledBefore
#
# notCalledBefore
#
#<\lastCmdCalled>
#====================================================================================================================================================#
#====================================================================================================================================================#
#<global>
#<\global>
#====================================================================================================================================================#
#====================================================================================================================================================#
{ #Main sections lexical scope starts
#====================================================================================================================================================#
#====================================================================================================================================================#
# section 0_startTasks
#
#<section ID="startTasks" num="0">
my $demo_data_url = "https://www.dropbox.com/s/8cx0rdrghy3ntf0/input.tar.gz";
&readParameters();#->151
my ($scafe_dir, $script_dir, $demo_dir) = &prepDir();#->125
&download($demo_dir, $demo_data_url);#->102
#<\section>
#====================================================================================================================================================#
#====================================================================================================================================================#
# section 1_run
#
#<section ID="run" num="1">
#<\section>
#====================================================================================================================================================#
#====================================================================================================================================================#
} #Main sections lexical scope ends
#====================================================================================================================================================#
#====================================================================================================================================================#
#List of subroutines by category
#
# general [n=1]:
# readParameters
#
# unassigned [n=2]:
# download, prepDir
#
#====================================================================================================================================================#
sub download {
#....................................................................................................................................................#
# subroutineCategory: unassigned
# dependOnSub: >none
# appearInSub: >none
# primaryAppearInSection: 0_startTasks|69
# secondaryAppearInSection: >none
# input: $demo_data_url, $demo_dir
# output:
# toCall: &download($demo_dir, $demo_data_url);
# calledInLine: 75
#....................................................................................................................................................#
my ($demo_dir, $demo_data_url) = @_;
my $tar_gz_path = "$demo_dir/input.tar.gz";
system ("rm -f $tar_gz_path");
system ("rm -rf $demo_dir/input/");
system ("wget $demo_data_url -P $demo_dir");
system ("tar -xzvf $tar_gz_path -C $demo_dir");
system ("rm $tar_gz_path");
return ();
}
sub prepDir {
#....................................................................................................................................................#
# subroutineCategory: unassigned
# dependOnSub: >none
# appearInSub: >none
# primaryAppearInSection: 0_startTasks|69
# secondaryAppearInSection: >none
# input: none
# output: $demo_dir, $scafe_dir, $script_dir
# toCall: my ($scafe_dir, $script_dir, $demo_dir) = &prepDir();
# calledInLine: 74
#....................................................................................................................................................#
my $scriptAbsPath = abs_path($0);
my @path_split = split /\//, $scriptAbsPath;
my $scafe_dir_index = $#path_split-2;
my $script_dir_index = $#path_split-1;
my $scafe_dir = join "/", @path_split[0..$scafe_dir_index];
my $script_dir = join "/", @path_split[0..$script_dir_index];
my @mkDirAry = ();
my $demo_dir = $scafe_dir."/demo/"; push @mkDirAry, $demo_dir;
foreach my $dir (@mkDirAry) {system ("mkdir -pm 755 $dir");}
return ($scafe_dir, $script_dir, $demo_dir);
}
sub readParameters {
#....................................................................................................................................................#
# subroutineCategory: general
# dependOnSub: >none
# appearInSub: >none
# primaryAppearInSection: 0_startTasks|69
# secondaryAppearInSection: >none
# input: none
# output:
# toCall: &readParameters();
# calledInLine: 73
#....................................................................................................................................................#
GetOptions (
'help' => sub { HelpMessage(0) },
);
return();
}
exit;