annotate mauve_contig_mover.pl @ 0:b8bc1922226a draft default tip

"planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
author nml
date Thu, 21 Nov 2019 12:37:56 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
1 #!/usr/bin/env perl
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
2
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
3 use strict;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
4 use warnings;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
5 use Data::Dumper;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
6 use Getopt::Long;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
7 use Pod::Usage;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
8 use File::Copy;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
9 use File::Basename;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
10
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
11
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
12 my ($output, $reference_gbk, $reference_dat, $draft_fasta, $draft_dat, $alignment_file, $fasta_file, $html_file, $help, $best_alignment,
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
13 @files, @sorted_files, $num_of_alignments, $mauve_cmd, $out, $best_alignment_file, $best_fasta_file);
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
14
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
15 Getopt::Long::Configure('bundling');
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
16 GetOptions(
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
17 'r|reference=s' => \$reference_dat,
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
18 'd|draft=s' => \$draft_dat,
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
19 'o|output=s' => \$output,
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
20 'a|alignment=s' => \$alignment_file,
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
21 'f|fasta=s' => \$fasta_file,
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
22 'l|html=s' => \$html_file,
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
23 'h|help' => \$help
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
24 );
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
25 pod2usage(1) if $help;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
26
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
27 #Format the fasta file. Some fastas were not working, so we're going to format all incoming fastas
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
28 my $draft_temp = "temporary.fasta";
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
29
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
30 open my $in, '<', $draft_dat or die "Could not open draft file: $?";
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
31 open my $out, '>', $draft_temp or die "Could not open file for writing: $?";
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
32
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
33 my $first_header = <$in>;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
34 chomp $first_header;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
35 print $out "$first_header\n";
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
36 while (my $line = <$in>)
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
37 {
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
38 chomp $line;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
39
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
40 if ($line =~ />/)
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
41 {
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
42 print $out "\n$line\n";
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
43 }
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
44 else
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
45 {
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
46 print $out $line;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
47 }
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
48 }
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
49
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
50
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
51
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
52 #progressiveMauve checks the file extension of inputs, and did not like .dat files passed in.
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
53
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
54 #First get the file format for the extention.
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
55 my $format = get_format($reference_dat);
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
56 die "Input reference file isn't a properly formatted fasta or genbank file!\n" if $format eq "na";
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
57
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
58 #So here we create symbolic links to the .dat files using the proper file extensions.
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
59 $reference_gbk = "reference.".$format;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
60 $draft_fasta = "draft.fasta";
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
61
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
62 system("ln -s $reference_dat $reference_gbk");
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
63 system("ln -s $draft_temp $draft_fasta");
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
64
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
65 #First, run mauve with the given inputs
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
66 $mauve_cmd = "java -Djava.awt.headless=true -Xmx500m -cp \$path2jar org.gel.mauve.contigs.ContigOrderer -output ".$output." -ref ".$reference_gbk." -draft ".$draft_fasta;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
67
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
68 $out = system("$mauve_cmd");
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
69
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
70
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
71 #Get all of the alignmentX folders and pick the latest one
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
72 opendir(DIR, $output) or die "Can't opendir $output";
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
73 @files = readdir(DIR);
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
74 @sorted_files = sort @files;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
75 $best_alignment = $sorted_files[@sorted_files -1];
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
76 $num_of_alignments = $best_alignment;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
77 $num_of_alignments =~ s/[^\d.]//g;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
78
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
79
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
80 #Now let's give galaxy the right outputs. Is there a better way to do this?
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
81 #First extract the names from the paths
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
82 my ($a_name, $a_path, $a_suffix) = fileparse($best_alignment);
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
83 my ($d_name, $d_path, $d_suffix) = fileparse($draft_fasta, ".fasta");
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
84
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
85
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
86 #Now we want some files (alignment and the final fasta file) to show up
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
87 #in the history. So we copy these files to send them to galaxy.
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
88 $best_alignment_file = $output."/".$best_alignment."/".$a_name;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
89 $best_fasta_file = $output."/".$best_alignment."/".$d_name.".fasta";
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
90
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
91 #Now copy them to the galaxy locations
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
92 copy($best_alignment_file, $alignment_file) or die "$best_alignment_file Copying alignment failed: $!";
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
93 copy($best_fasta_file, $fasta_file) or die "Copying fasta file failed: $!";
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
94
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
95
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
96 #Let us write the html file!
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
97 open my $html_out, ">", $html_file;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
98 printf $html_out "<!DOCTYPE html>
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
99 <html>
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
100 <style type=\"text/css\">
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
101
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
102 body {
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
103 font-family: sans-serif;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
104 color: #000;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
105 }
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
106
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
107 table {
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
108 margin-left: 3em;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
109 text-align: center;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
110 }
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
111 th {
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
112 text-align:center;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
113 background-color: #000080;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
114 color: #FFF;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
115 padding: 0.4em;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
116 }
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
117 td {
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
118 font-family: monospace;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
119 text-align: left;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
120 background-color: #EEE;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
121 color: #000;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
122 padding: 0.4em;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
123 }
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
124 h2 {
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
125 color: #800000;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
126 padding-bottom: 0;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
127 margin-bottom: 0;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
128 clear: left;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
129 }
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
130 </style></head>
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
131
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
132 <body>
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
133
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
134
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
135 <h2 id=\"M0\">Mauve Output Summary</h2><br>
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
136 <ul><li>Number of alignments performed: $num_of_alignments (last alignment is usually the best)</li><li>The fasta and alignment files from the last alignment are shown in the history</li><li>To download the complete Mauve output, download the contents of this file</li><li>The contig orders of each alignment are shown below: </li></ul><br>";
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
137
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
138
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
139 my %summary;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
140 my $contig_count;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
141
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
142 #generate data html
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
143 foreach my $folder (@sorted_files)
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
144 {
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
145 my $start = "Ordered Contigs";
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
146 my $stop = "Contigs with conflicting ordering information";
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
147 my $header = "type label contig strand left_end right_end";
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
148 my $in_section = 0;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
149 $contig_count = 0;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
150 my @alignment_info;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
151 next if ($folder =~ m/^\./);
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
152 my $file_path = $output."/".$folder."/".$d_name."_contigs.tab";
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
153 open my $curr_file, "<", $file_path;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
154
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
155 #Go through the lines
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
156 while(<$curr_file>)
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
157 {
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
158 #find correct section. Note flip flop operators didn't work here for me
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
159 if(/$start/) {$in_section=1;}
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
160 elsif(/$stop/) {$in_section=0;}
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
161
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
162 next if(/$start/ || /$stop/ || /$header/);
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
163
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
164 #Store the line content
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
165 if ($in_section and /\S/)
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
166 {
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
167 $contig_count++;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
168 my @tmp = split('\t', $_);
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
169 my @columns = ($tmp[1], $tmp[3]);
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
170 push(@alignment_info, [@columns]);
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
171 }
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
172 }
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
173 close $curr_file;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
174 $summary{$folder} = [@alignment_info];
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
175 }
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
176
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
177
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
178 #print out the headers
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
179
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
180 printf $html_out "<table border=\"1\"><tbody><tr><th>Alignment</th>\n";
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
181
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
182 for my $a (sort keys %summary)
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
183 {
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
184 my $tmp = $a;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
185 $tmp =~ s/[^\d.]//g;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
186 printf $html_out "<th colspan=\"2\">$tmp</th>\n";
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
187 }
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
188
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
189 printf $html_out "</tr>";
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
190
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
191 #print out the data
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
192 for my $i (0 .. $contig_count-1)
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
193 {
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
194 printf $html_out "<tr><td></td>\n";
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
195 for my $alignment (sort keys %summary)
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
196 {
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
197 printf $html_out "<td>". $summary{$alignment}[$i][0]."</td>\n<td>".$summary{$alignment}[$i][1]. "</td>\n";
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
198 }
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
199 printf $html_out "</tr>\n";
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
200 }
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
201
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
202 printf $html_out "</tbody></table></body></html>";
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
203
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
204 #close all the things
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
205 closedir(DIR);
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
206 close $html_out;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
207
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
208 exit($out);
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
209
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
210
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
211 sub get_format
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
212 {
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
213 my $file = shift;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
214 my $format;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
215
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
216 open my $in, '<', $file or die "Could not open file for reading. $!";
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
217
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
218 my $line = <$in>;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
219
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
220 if ($line =~ /LOCUS/)
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
221 {
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
222 $format = "gbk";
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
223 }
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
224 elsif ($line =~ /^>/)
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
225 {
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
226 $format = "fasta";
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
227 }
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
228 else
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
229 {
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
230 $format = "na";
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
231 }
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
232 close $in;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
233
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
234 return $format;
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
235 }
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
236
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
237 __END__
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
238
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
239 =head1 NAME
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
240
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
241 mauve_contig_mover.pl - A wrapper for galaxy to run Mauve Contig Mover
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
242
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
243 =head1 SYNOPSIS
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
244
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
245 mauve_contig_mover.pl -r <reference> -d <draft> -o <output> -a <alignment file output> -f <fasta file output> -l <html file output> -h <help>
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
246
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
247 =head1 OPTIONS
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
248
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
249 =over 8
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
250
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
251 =item B<-r> B<--reference>
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
252
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
253 The input reference strain in either a fasta or genbank format
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
254
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
255 =item B<-d> B<--draft>
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
256
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
257 The input draft genome in fasta format
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
258
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
259 =item B<-o> B<--output>
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
260
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
261 The output folder created by Mauve
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
262
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
263 =item B<-a> B<--alignment>
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
264
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
265 The best output alignment produced by Mauve
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
266
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
267 =item B<-f> B<--fasta>
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
268
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
269 The best output fasta file produced by Mauve
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
270
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
271 =item B<-l> B<--html>
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
272
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
273 The html file containing all of the output files produced by Mauve
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
274
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
275 =item B<-h> B<--help>
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
276
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
277 Print a help message and exits
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
278
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
279 =back
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
280
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
281 =head1 DESCRIPTION
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
282
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
283 B<mauve_contig_mover> is a galaxy wrapper for Mauve Contig Mover. This script runs the command line version of the Mauve Contig Mover
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
284
b8bc1922226a "planemo upload for repository https://github.com/phac-nml/mauve_contig_mover commit 2d8300acc533f8b9ec95ff24ad2f529e92e8da69"
nml
parents:
diff changeset
285 =cut