6 use lib '/homes/www-jpred/new_site/jpred_new/lib';
26 pod2usage(-verbose => 1) if $help;
27 pod2usage(-verbose => 2) if $man;
28 pod2usage(-msg => 'Please give a concise file to read', -verbose => 0) if (!$file);
30 ## Hash of description lines for concise data types
32 jnetpred => 'Final secondary structure prediction by Jnet',
33 JNETHMM => 'Jnet prediction using HMMer profiles',
34 JNETPSSM => 'Jnet prediction using PSSM profiles',
35 JNETJURY => 'Positions where Jnet predictions do not agree',
36 JNETSOL0 => 'Jnet solvent relative accessibility prediction at 0% cut-off',
37 JNETSOL5 => 'Jnet solvent relative accessibility prediction at 5% cut-off',
38 JNETSOL25 => 'Jnet solvent relative accessibility prediction at 25% cut-off',
39 JNETCONF => 'Confidence of Jnet prediction 0 (low) -> 9 (high)',
40 Lupas_14 => 'Coiled-coil prediction windowed over 14 residues',
41 Lupas_21 => 'Coiled-coil prediction windowed over 21 residues',
42 Lupas_28 => 'Coiled-coil prediction windowed over 28 residues',
45 ## If an output file is given open it and select it as the default output
48 open($FH, ">$out") or die "ERROR - unable to open '$out' for writing: $!\nDied";
52 ## Create a Concise::File object and fill it with the contents of the input file
53 my $concise = Concise::File->new(read_file => $file);
55 ## Write the Jalview Annotation file to the default output
56 print "JALVIEW_ANNOTATION\n";
57 print "# Created by concise2jalview using '$file' as input\n\n";
58 for my $data ($concise->get_entries) {
59 my $string = join("|", $data->seq);
60 if ($data->id =~ /prop|align/i) { # skip sequence alignments and PROPH|C|E fields
62 } elsif ($data->id =~ /jnetconf/i) { # treat Jnet confidence as a bar graph as contains real numbers
63 print "BAR_GRAPH\t", $data->id,"\t",$desc{$data->id}, "\t$string\n";
65 } elsif ($data->id =~ /jnet(pred|hmm|align|pssm)/i) { # strip out '-' chars from prediction fields as unrequired by Jalview
68 # By default don't treat fields as graphable data and add a description line
69 print "NO_GRAPH\t",$data->id,"\t",$desc{$data->id}, "\t$string\n";
75 concise2jalview -- covert Jnet concise files to Jalview annotation files
79 concise2jalview --file <concise file> [--help] [--man] > <output file>
83 This script takes a Jnet concise file as input and returns a Jalview annotation file as output. This allows Jalview to better view Jnet/Jpred prediction complete with descriptions of the various predictions.
85 All data types are included in the Jalview file except for 'JNETPROP*' and any sequence alignments.
91 =item B<--file> <concise file>
93 Give the path and name to the Jnet concise file.
101 Displays the full manpage.
107 Chris Cole <christian@cole.name>