#!/usr/bin/env perl package Bio::Tradis::Bin::MergePlots; $Bio::Tradis::Bin::MergePlots::VERSION = '1.4.5'; use FindBin qw($Bin); # ABSTRACT: # PODNAME: tradis_merge_plots package TraDISMergePlots::Main; $TraDISMergePlots::Main::VERSION = '1.4.5'; use Moose; use Getopt::Long; use File::Basename; my ( $study, $help ); GetOptions( 'h|help' => \$help, ); ( defined($ARGV[0]) && !$help ) or die <) { 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"; } } } __END__ =pod =encoding UTF-8 =head1 NAME tradis_merge_plots - =head1 VERSION version 1.4.5 =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 NAME tradis_merge_plots =head1 CONTACT path-help@sanger.ac.uk =head1 METHODS =head1 AUTHOR Carla Cummins =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2013 by Wellcome Trust Sanger Institute. This is free software, licensed under: The GNU General Public License, Version 3, June 2007 =cut