Difference between revisions of "Phenylketonuria/Task3/Scripts"

From Bioinformatikpedia
Line 1: Line 1:
This script reads an input file in ReProf format and filters the file for the secondary structur presented with H,L and E.
+
This script reads an input file in ReProf format and filters the file for the secondary structur presented with H,L and E.<br>
You can find the script in "/mnt/home/student/waldraffs/Masterpraktikum/Task3/filter_secStruc.pl
+
You can find the script in <code>/mnt/home/student/waldraffs/Masterpraktikum/Task3/filter_secStruc.pl</code>
   
 
Usage: perl filter_secStrucpl -inp <input-file in ReProf format> -out <output-file>
 
Usage: perl filter_secStrucpl -inp <input-file in ReProf format> -out <output-file>

Revision as of 16:52, 11 May 2013

This script reads an input file in ReProf format and filters the file for the secondary structur presented with H,L and E.
You can find the script in /mnt/home/student/waldraffs/Masterpraktikum/Task3/filter_secStruc.pl

Usage: perl filter_secStrucpl -inp <input-file in ReProf format> -out <output-file>

The output is the secondary structure shown with the letters E, H and L.

Code:

<source lang="perl">

  1. !/usr/bin/perl

my $inp; my $out;

  1. Reads the command line parameters

for ($i=0; $i<=3;$i++){ if($ARGV[$i] eq "-inp"){ $inp=$ARGV[$i+1]; }elsif($ARGV[$i] eq "-out"){ $out=$ARGV[$i+1]; } }

if(!$inp && !$out){ print "Usage: filter_secStruc.pl -inp <input-file(.reprof)> -out <output-file>" }

my $secstructure= ""; my $no = 0;

  1. reads input file and filters for the coloumn with secondary structure

open (FILE,"$inp") || die $!; while (my $line = <FILE>){

if($no == 1){ @splitLine = split(/\t/,$line); $secstructure="$secstructure$splitLine[2]"; }

if($line =~ /^No/){ $no = 1; } } close FILE;

  1. writes output file

open(OUTFILE,">$out") || die $!; print OUTFILE $secstructure; close OUTFILE;

</source>