File: multi.pl

package info (click to toggle)
melting 4.3c-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 3,708 kB
  • sloc: ansic: 2,013; perl: 546; xml: 125; makefile: 12
file content (77 lines) | stat: -rwxr-xr-x 3,273 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/usr/bin/perl -w
#*******************************************************************************
#                                 multi.pl                                     *
#                 Copyright (C) Nicolas Le Novre and Marine Dumousseau 2009                         *
# Run the program melting on several nucleic acid sequences entered from stdin *
# (it can be a file redirected with 'multi.pl < file.seq')                     *
#*******************************************************************************/
#
#      This program is free software; you can redistribute it and/or modify
#      it under the terms of the GNU General Public License as published by
#      the Free Software Foundation; either version 2 of the License, or
#      (at your option) any later version.
#
#      This program is distributed in the hope that it will be useful,
#      but WITHOUT ANY WARRANTY; without even the implied warranty of
#      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#      GNU General Public License for more details.
#
#      You should have received a copy of the GNU General Public License
#      along with this program; if not, write to the Free Software
#      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
#      Nicolas Le Novre and Marine Dumousseau
#      EMBL-EBI, Wellcome-Trust Genome Campus
#      Hinxton Cambridge, CB10 1SD, UK
#      lenov@ebi.ac.uk

       ###################################################################
       # Usage is: ./multi.pl config_file < inputfile > outputfile       #
       # Where inputfile contains one sequence per line. No space before #
       # sequence and at least one space before extra information        # 
       # Write the parameters of melting in an input file. See manual.   #
       ###################################################################

use strict;

my @linecontent; # contains the elements of a line generated by the function split

my $infile;      # contains the parameters of the run except the sequence
my @sequences;   # contains all the sequences from which to predict the Tm
my $seq;         # one sequence

my @rawresults;  # contains the raw output of MELTING
my ($tm,$H,$S);  

if (not defined $ARGV[0]){
    print "Except the sequences, all parameters have to be contained in a \n",
    "configuration file, and the script run as:\n",
    "  prompt> ./multi.pl config_file < inputfile > outputfile\n";
    exit;
}
# Read the sequences to analise
while (<STDIN>){
    if ( $_ !~ /^(\s*\#.*|\s+)$/){ # do not take into account comment and blank lines
	chomp;
	@linecontent = split(" ");          # Note that each line could contain
	push(@sequences,$linecontent[0]); # other elements used in derived programs
    }
}

print "sequences                        DeltaH   DeltaS  Tm (deg C) \n";
foreach $seq (@sequences){
    @rawresults = `melting -I$ARGV[0] -S$seq -q`;
    foreach (@rawresults){
	@linecontent = split(" ");   
	if ($linecontent[0] =~ /melting/i ){ $tm = $linecontent[2];    
	} elsif ($linecontent[0] =~ /enthalpy/i ){ $H = $linecontent[1];    
	} elsif ($linecontent[0] =~ /entropy/i ){ $S = $linecontent[1];    
	}
    }
    printf "%-30s  %6.0f  %5.1f  %4.1f\n",$seq, $H, $S, $tm;
}