annotate flexbar.pl @ 12:4cbf6c6d2f2b

Fixed issue where adapter removal can not be performed and further minor issues.
author jtilman
date Thu, 17 Jan 2013 18:09:44 +0100
parents 52c5e53aff28
children 346a2b0979ea
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
a8399cb4972b Uploaded Flexbar perl tool wrapper file flexbar.pl
jtilman
parents:
diff changeset
8
11
52c5e53aff28 Revised perl wrapper.
jtilman
parents: 10
diff changeset
9 my ($outFile, $id, $folder, $format) = @ARGV[($#ARGV - 3) .. $#ARGV];
52c5e53aff28 Revised perl wrapper.
jtilman
parents: 10
diff changeset
10
52c5e53aff28 Revised perl wrapper.
jtilman
parents: 10
diff changeset
11 my $call = join " ", @ARGV[0..($#ARGV - 4)];
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 system $call .' --target reads > '. $outFile and exit 1;
1
a8399cb4972b Uploaded Flexbar perl tool wrapper file flexbar.pl
jtilman
parents:
diff changeset
14
a8399cb4972b Uploaded Flexbar perl tool wrapper file flexbar.pl
jtilman
parents:
diff changeset
15
10
f0bdf862ba39 Simplified perl wrapper.
jtilman
parents: 1
diff changeset
16 foreach(<reads*>){
1
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 my $fileType;
f0bdf862ba39 Simplified perl wrapper.
jtilman
parents: 1
diff changeset
19
f0bdf862ba39 Simplified perl wrapper.
jtilman
parents: 1
diff changeset
20 $fileType = $1 if /\.(\w+)$/;
12
4cbf6c6d2f2b Fixed issue where adapter removal can not be performed and further minor issues.
jtilman
parents: 11
diff changeset
21 $fileType = $format if /\.\w*fast\w$/;
10
f0bdf862ba39 Simplified perl wrapper.
jtilman
parents: 1
diff changeset
22 $fileType = 'tabular' if $fileType eq 'lengthdist';
f0bdf862ba39 Simplified perl wrapper.
jtilman
parents: 1
diff changeset
23
11
52c5e53aff28 Revised perl wrapper.
jtilman
parents: 10
diff changeset
24 my $file = $_;
52c5e53aff28 Revised perl wrapper.
jtilman
parents: 10
diff changeset
25
10
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
11
52c5e53aff28 Revised perl wrapper.
jtilman
parents: 10
diff changeset
30 rename $file, $name;
10
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