/usr/bin/tradis_merge_plots is in bio-tradis 1.3.3+dfsg-3.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
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 | #!/usr/bin/env perl
package Bio::Tradis::Bin::MergePlots;
# ABSTRACT:
# PODNAME: tradis_merge_plots
=head1 NAME
tradis_merge_plots
=head1 SYNOPSIS
tradis_merge_plots - Given a study name or ID, group by sample and tag, and generate tab files for input to R.
=head1 DESCRIPTION
Given a study name or ID, group by sample and tag, and generate tab files for input to R.
=head1 CONTACT
path-help@sanger.ac.uk
=head1 METHODS
=cut
package TraDISMergePlots::Main;
use Moose;
use Getopt::Long;
use File::Basename;
my ( $study, $help );
GetOptions(
'h|help' => \$help,
);
( defined($ARGV[0]) && !$help ) or die <<USAGE;
Usage: tradis_merge_plots [options]
Given a study name or ID, group by sample and tag, and generate tab files for input to R.
# run over sequencescape study 1234
tradis_merge_plots 1234
# Provide a name instead of a study ID
tradis_merge_plots "My Study"
# This help message
tradis_merge_plots -h
USAGE
$study = $ARGV[0];
open(my $coverage_plots_fh, '-|', 'tradisfind -t study -i "'.$study.'" -d');
my %coverage_plots;
while(<$coverage_plots_fh>)
{
my $line = $_;
chomp($line);
my @full_details = split("\t", $line);
my @file_path_details = split('/', $full_details[0]);
my @lane_details = split('#',$file_path_details[14]);
$full_details[1] =~ s!\.gff!.embl!i;
# library name, path to annotation, tag number => path
if(! defined($coverage_plots{$file_path_details[13]}{$full_details[1]}{$lane_details[1]}) )
{
my @plots;
push(@plots, $full_details[0]);
$coverage_plots{$file_path_details[13]}{$full_details[1]}{$lane_details[1]} = \@plots;
}
else
{
push(@{$coverage_plots{$file_path_details[13]}{$full_details[1]}{$lane_details[1]}},$full_details[0]);
}
}
for my $library_name (keys %coverage_plots)
{
for my $path_to_annotation (keys %{$coverage_plots{$library_name}})
{
my $annotation_name = fileparse( $path_to_annotation );
for my $tag (keys %{$coverage_plots{$library_name}{$path_to_annotation}})
{
my $joined_plots = join(' ', @{$coverage_plots{$library_name}{$path_to_annotation}{$tag}});
my $outputfilename = join("_",($library_name, $tag,$annotation_name));
my $cmd = join(" ", ("tradis_gene_insert_sites", '-o', $outputfilename.'.csv', $path_to_annotation, $joined_plots ));
`bsub -M1000 -R 'select[mem>1000] rusage[mem=1000]' '$cmd'`;
print "Output from bsub will be in: ".$outputfilename.'.csv'."\n";
}
}
}
|