annotate flexbar.pl @ 10:f0bdf862ba39

Simplified perl wrapper.
author jtilman
date Mon, 31 Dec 2012 18:40:01 +0100
parents a8399cb4972b
children 52c5e53aff28
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
a8399cb4972b Uploaded Flexbar perl tool wrapper file flexbar.pl
jtilman
parents:
diff changeset
1 #!/usr/bin/env perl
a8399cb4972b Uploaded Flexbar perl tool wrapper file flexbar.pl
jtilman
parents:
diff changeset
2
a8399cb4972b Uploaded Flexbar perl tool wrapper file flexbar.pl
jtilman
parents:
diff changeset
3 # Author: Johannes T. Roehr
a8399cb4972b Uploaded Flexbar perl tool wrapper file flexbar.pl
jtilman
parents:
diff changeset
4
a8399cb4972b Uploaded Flexbar perl tool wrapper file flexbar.pl
jtilman
parents:
diff changeset
5 use warnings;
a8399cb4972b Uploaded Flexbar perl tool wrapper file flexbar.pl
jtilman
parents:
diff changeset
6 use strict;
a8399cb4972b Uploaded Flexbar perl tool wrapper file flexbar.pl
jtilman
parents:
diff changeset
7
10
f0bdf862ba39 Simplified perl wrapper.
jtilman
parents: 1
diff changeset
8 my $format = pop @ARGV;
f0bdf862ba39 Simplified perl wrapper.
jtilman
parents: 1
diff changeset
9 my $folder = pop @ARGV;
f0bdf862ba39 Simplified perl wrapper.
jtilman
parents: 1
diff changeset
10 my $id = pop @ARGV;
f0bdf862ba39 Simplified perl wrapper.
jtilman
parents: 1
diff changeset
11 my $outFile = pop @ARGV;
1
a8399cb4972b Uploaded Flexbar perl tool wrapper file flexbar.pl
jtilman
parents:
diff changeset
12
10
f0bdf862ba39 Simplified perl wrapper.
jtilman
parents: 1
diff changeset
13 my $call = join " ", @ARGV;
1
a8399cb4972b Uploaded Flexbar perl tool wrapper file flexbar.pl
jtilman
parents:
diff changeset
14
10
f0bdf862ba39 Simplified perl wrapper.
jtilman
parents: 1
diff changeset
15 system $call .' --target reads > '. $outFile and exit 1;
1
a8399cb4972b Uploaded Flexbar perl tool wrapper file flexbar.pl
jtilman
parents:
diff changeset
16
a8399cb4972b Uploaded Flexbar perl tool wrapper file flexbar.pl
jtilman
parents:
diff changeset
17
10
f0bdf862ba39 Simplified perl wrapper.
jtilman
parents: 1
diff changeset
18 foreach(<reads*>){
1
a8399cb4972b Uploaded Flexbar perl tool wrapper file flexbar.pl
jtilman
parents:
diff changeset
19
10
f0bdf862ba39 Simplified perl wrapper.
jtilman
parents: 1
diff changeset
20 my $fileType;
f0bdf862ba39 Simplified perl wrapper.
jtilman
parents: 1
diff changeset
21
f0bdf862ba39 Simplified perl wrapper.
jtilman
parents: 1
diff changeset
22 $fileType = $1 if /\.(\w+)$/;
f0bdf862ba39 Simplified perl wrapper.
jtilman
parents: 1
diff changeset
23 $fileType = $format if /\.\w+fast\w$/;
f0bdf862ba39 Simplified perl wrapper.
jtilman
parents: 1
diff changeset
24 $fileType = 'tabular' if $fileType eq 'lengthdist';
f0bdf862ba39 Simplified perl wrapper.
jtilman
parents: 1
diff changeset
25
f0bdf862ba39 Simplified perl wrapper.
jtilman
parents: 1
diff changeset
26 s/_//g;
f0bdf862ba39 Simplified perl wrapper.
jtilman
parents: 1
diff changeset
27
f0bdf862ba39 Simplified perl wrapper.
jtilman
parents: 1
diff changeset
28 my $name = "primary_". $id ."_". $_ ."_visible_". $fileType;
f0bdf862ba39 Simplified perl wrapper.
jtilman
parents: 1
diff changeset
29
f0bdf862ba39 Simplified perl wrapper.
jtilman
parents: 1
diff changeset
30 rename $_, $name;
f0bdf862ba39 Simplified perl wrapper.
jtilman
parents: 1
diff changeset
31 rename $name, $folder;
1
a8399cb4972b Uploaded Flexbar perl tool wrapper file flexbar.pl
jtilman
parents:
diff changeset
32 }
a8399cb4972b Uploaded Flexbar perl tool wrapper file flexbar.pl
jtilman
parents:
diff changeset
33