Difference between revisions of "Phenylketonuria/Task3/Scripts"
(→SecStrucComparison.jar) |
(→SecStrucComparison.jar) |
||
Line 128: | Line 128: | ||
-i_seq2 <input-file 2>: second structure sequence |
-i_seq2 <input-file 2>: second structure sequence |
||
-o <output-file>: returns a list with the precision for E, H and L of the first sequence as well as the overall precision. |
-o <output-file>: returns a list with the precision for E, H and L of the first sequence as well as the overall precision. |
||
− | The structure sequences must be in the format of the filter_secStruc.pl output. |
+ | The structure sequences must be in the format of the filter_secStruc.pl output. <br> |
You can find the script in <code>/mnt/home/student/waldraffs/Masterpraktikum/Task3/secondary_structure/SecStrucComparison.jar</code> |
You can find the script in <code>/mnt/home/student/waldraffs/Masterpraktikum/Task3/secondary_structure/SecStrucComparison.jar</code> |
||
Revision as of 09:59, 23 May 2013
Secondary Structure
filter_secStruc.pl
This script reads an input file in ReProf format or PsiPred and filters the file for the secondary structur presented with E,H and L/C. Also it can read a DSSP file. If the structure forms a loop or irregular a "-" is inserted.
You can find the script in /mnt/home/student/waldraffs/Masterpraktikum/Task3/secondary_structure/filter_secStruc.pl
Usage: perl filter_secStrucpl -inp <input-file in ReProf format> -out <output-file> -reprof|-psipred|-dssp -reprof: if the input file is result of a ReProf run. -psipred: if the input file is result of a PsiPred run. -dssp: if the input file is result of a DSSP run.
The output is the secondary structure shown with the letters E, H and L. Therefore at PsiPred the letter C is converted to L and at DSSP the letters G and I are replaced by H, B by E and S and T by L.
Code:
<source lang="perl">
- !/usr/bin/perl
my $inp; my $out; my $reprof = 0; my $psipred = 0; my $dssp = 0;
- Reads the command line parameters
for ($i=0; $i<=@ARGV;$i++){ if($ARGV[$i] eq "-inp"){ $inp=$ARGV[$i+1]; } if($ARGV[$i] eq "-out"){ $out=$ARGV[$i+1]; } if($ARGV[$i] eq "-reprof"){ $reprof = 1; } if($ARGV[$i] eq "-psipred"){ $psipred = 1; } if($ARGV[$i] eq "-dssp"){ $dssp = 1; } }
if(!$inp && !$out){ print "Usage: filter_secStruc.pl -inp <input-file(.reprof)> -out <output-file> -reprof|-psipred|-dssp" }
my $secstructure= ""; my $no = 0;
- reads input file and filters for the coloumn with secondary structure
open (FILE,"$inp") || die $!; if($reprof == 1){ while (my $line = <FILE>){
if($no == 1){ @splitLine = split(/\t/,$line); $secstructure=$secstructure.$splitLine[2]; }
if($line =~ /^No/){ $no = 1; } } } if($psipred == 1){ while (my $line = <FILE>){ if($line =~ /^Pred/){ @splitLine = split(/ /,$line); chomp($splitLine[1]); $secstructure = $secstructure.$splitLine[1]; } } $secstructure =~ s/C/L/g; } if($dssp ==1){ $number = 0; while (my $line = <FILE>){ if($no ==1){ $line =~ s/^\s+//g; @splitLine = split(/ /,$line); my $letter = ""; if($splitLine[1] eq "" && $splitLine[2] eq "" && $splitLine[3] eq ""){ $number = 1; } if($splitLine[1] eq "" && $splitLine[2] eq "" && $splitLine[3] ne ""){ $number = 2; } if($splitLine[1] eq "" && $splitLine[2] ne ""){ $number = 3; } if($splitLine[0] < 10){ $letter = $splitLine[9-$number]; } elsif($splitLine[0] >9 && $splitLine[0] < 100){ $letter = $splitLine[9-$number]; } else{ $letter = $splitLine[9-$number]; } if($letter eq ""){ $letter="-"; } $secstructure = $secstructure.$letter;
} if($line =~ /^ #/){ $no = 1; } } $secstructure =~ s/[G,I]/H/g; $secstructure =~ s/B/E/g; $secstructure =~ s/[S,T]/L/g; } close FILE;
- writes output file
open(OUTFILE,">$out") || die $!; print OUTFILE $secstructure; close OUTFILE; </source>
SecStrucComparison.jar
The script takes two sequences as input (presented with E, H, L and -) and calculates the precision between those.
Usage: java -jar SecStrucComparison.jar -i_seq1 <input-file 1>: first structure sequence (used as reference for precision) -i_seq2 <input-file 2>: second structure sequence -o <output-file>: returns a list with the precision for E, H and L of the first sequence as well as the overall precision.
The structure sequences must be in the format of the filter_secStruc.pl output.
You can find the script in /mnt/home/student/waldraffs/Masterpraktikum/Task3/secondary_structure/SecStrucComparison.jar
It must be considered which sequence should be used as first or second, as they can have a different number of E, H or L. Those letters are counted for the first sequence only and used for calculation of the precision. For the total precision there is no difference.