Toggle allowing Jpred to make predictions even when there are no PSI-BLAST hits.
+=item -no-final
+
+Untoggle final step of Jpred prediction
+
=item -verbose
Verbose mode. Print more information while running jpred.
my $predNoHits = 0; # define whether to make predictions when no PSI-BLAST hits are found
my $db_path = ".";
my $db_entry = "unknown";
+my $nofinal;
my ( $help, $man, $DEBUG, $VERBOSE );
"dbpath=s" => \$db_path,
"ncpu=s" => \$ncpu,
"pred-nohits" => \$predNoHits,
+ "no-final" => \$nofinal,
"help" => \$help,
"man" => \$man,
"debug" => \$DEBUG,
## database used for ported Jpred
ported_db => {
- database => $db_path . "/databases/uniref90.filt",
- unfiltered => $db_path . "/databases/uniref90",
+ database => $db_path . "/uniref90.filt",
+ unfiltered => $db_path . "/uniref90",
},
## cluster-specific path for Jpred
cluster => {
## these other DBs are experimental ones used during development.
## check they exist before using them.
swall => {
+
# generic entry for use with validate_jnet.pl
# real db location defined by validate_jnet.pl
database => $db_path . "/swall/swall.filt",
},
uniprot => {
+
# Path to PSIBLAST db
database => $db_path . "/3/swall.filt",
unfiltered => $db_path . "/3/swall",
}
print ">>100% complete\n";
+
+unless ( defined $nofinal ) {
+ my $aligfile = $output.".align";
+ my $jnetfile = $output.".jnet";
+ my $jnetfastafile = $output.".jnet.fasta";
+ my $resufile = $output.".res";
+ concise2fasta($jnetfile, $jnetfastafile);
+ open( my $IN1, "<", $aligfile ) or die "ERROR! unable to open '$aligfile': ${!}\nDied";
+ open( my $IN2, "<", $jnetfastafile ) or die "ERROR! unable to open '$jnetfastafile': ${!}\nDied";
+ open( my $OUT, ">", $resufile ) or die "ERROR! unable to open '$resufile': ${!}\nDied";
+ while (<$IN2>) {print $OUT $_;}
+ while (<$IN1>) {print $OUT $_;}
+ close($IN1);
+ close($IN2);
+ close($OUT);
+}
+
print "Jpred Finished\n";
exit;
# Functions
#####################################################################################################
+#####################################################################################################
+sub fasta2concise {
+ my $infile = shift;
+ my $outfile = shift;
+
+ open( my $IN, "<", $infile ) or die "ERROR! unable to open '$infile': ${!}\nDied";
+ open( my $OUT, ">", $outfile ) or die "ERROR! unable to open '$outfile': ${!}\nDied";
+
+ my ( $seq, @seqs, @title );
+ while (<$IN>) {
+ if (s/^>//) {
+ if ($seq) {
+ $seq =~ s/\n|\s//g;
+ $seq =~ s/(.)/$1,/g;
+ push @seqs, $seq;
+ $seq = "";
+ }
+ chomp;
+ push @title, $_;
+ } else {
+ chomp;
+ $seq .= $_;
+ }
+ }
+ $seq =~ s/\n|\s//g;
+ $seq =~ s/(.)/$1,/g;
+ push @seqs, $seq;
+
+ if ( @title != @seqs ) { die("non matching number of titles and sequences!\n"); }
+
+ foreach ( 0 .. $#title ) {
+ print "align" . ( $_ + 1 ) . ";$title[$_]:$seqs[$_]\n";
+ }
+ close($IN);
+ close($OUT);
+}
+
+#####################################################################################################
+sub concise2fasta {
+ my $infile = shift;
+ my $outfile = shift;
+
+ my ( @seqs, %seq, @pred, %pred );
+
+ my @var = (
+ "Lupas_21", "Lupas_14", "Lupas_28", "JNETPSSM", "MULTCOIL", "MULTCOIL_TRIMER", "MULTCOIL_DIMER", "JNETFREQ",
+ "JNETALIGN", "JNETHMM", "JNETSOL5", "JNETSOL25", "JNETSOL0", "jnetpred", "jpred"
+ );
+
+ open( my $IN, "<", $infile ) or die "ERROR! unable to open '$infile': ${!}\nDied";
+ open( my $OUT, ">", $outfile ) or die "ERROR! unable to open '$outfile': ${!}\nDied";
+
+ while (<$IN>) {
+ if (/^\n/) { next; }
+ my ( $id, $seq ) = split( ":", $_ );
+ if ( !$id || !$seq ) { next; } # Check we have proper values
+ $seq =~ s/,//g;
+ chomp($seq);
+ if ( $id =~ /;/ ) { # Then it's an alignment
+ @_ = split( ";", $id );
+ push @seqs, $_[1];
+ $seq{ $_[1] } = $seq;
+ }
+ foreach (@var) {
+ if ( $_ eq $id ) {
+ push @pred, $_;
+ $pred{$_} = $seq;
+ }
+ }
+ }
+ close($IN);
+
+ foreach (@seqs) {
+ $seq{$_} =~ s/(.{72})/$1\n/g;
+ print $OUT ">$_\n$seq{$_}\n";
+ }
+
+ foreach (@pred) {
+ $pred{$_} =~ s/[TCYWXZSI\?_]/-/g;
+ $pred{$_} =~ s/B/E/g;
+ $pred{$_} =~ s/G/H/g;
+
+ if (/SOL/) { $pred{$_} =~ s/E/B/g; }
+ $pred{$_} =~ s/(.{72})/$1\n/g;
+ print $OUT ">$_\n$pred{$_}\n";
+ }
+ close($OUT);
+}
+
=begin :private
=head2 $PSISEQ = remove_seq_masks($PSISEQ)