02-17-2009
Perl- matrix problem
A C G T -
A 5 -4 -4 -4 -5
C -4 5 -4 -4 -5
G -4 -4 5 -4 -5
T -4 -4 -4 5 -5
- -5 -5 -5 -5 0
So lets say I have a matrix which looks something like (above). Its basically a scoring matrix. the numbers are separated by columns are separated by tab and the lines are separated by well a line "\n". So I am trying to write a perl code that reads the file and stores the matrix in anything a list, an array or hash tables... I realize i need to use references but i could be wrong. I was wondering if someone could help me out... I wrote a global alignment program and now i was writing this code so say if i am looking up AA i get 5 if i was looking up TG i get -4
Thanks
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi everybody,
I have a matrix called @matrix dinamically built in PERL, so I don't know its exact sizes. It is a 2-dimensional matrix, so its elements are for example:
$matrix
$matrix
$matrix
$matrix
$matrix
etc...
I know i can get the number of the rows of the matrix with the... (2 Replies)
Discussion started by: foo.bar
2 Replies
2. Shell Programming and Scripting
Hello guys,
I have in PERL an associative 2-dimensional array, called matrix. The array (actually the matrix) is made up like this
matrix = x;
matrix = y;
matrix = w;
matrix = z;
...
but the names a, b, c, d are set just at runtime.
The question is: how can i get all the keys of... (2 Replies)
Discussion started by: foo.bar
2 Replies
3. Shell Programming and Scripting
hi there
I'm very new in programing and i've started with awk.
I'm processing 200 data files and I need to do some precessing on them.
The files have 3 columns with N-lines
for each line a have on the first and second value is the same for all the files and only the third is variable. like... (2 Replies)
Discussion started by: philstar
2 Replies
4. Shell Programming and Scripting
I have columnar data in arrays perl, Example -
@a = (1,2,3);
@array1 = (A,B,C);
@array2 = (D,E,F);
@array3 = (I,R,T);
I want the data to be formatted and printed as
1 A D I
2 B E F
3 C F T
and so on... (8 Replies)
Discussion started by: dinjo_jo
8 Replies
5. Shell Programming and Scripting
Greetings, salutations.
I have a 3 column csv file with ~13 million rows and I would like to generate a correlation matrix. Interestingly, you all previously provided a solution to the inverse of this problem. Thread title: "awk? adjacency matrix to adjacency list / correlation matrix to list"... (6 Replies)
Discussion started by: R3353
6 Replies
6. Programming
Hi All,
I have a question. I need to add 3 matrices of size 2000 x 2000. (i.e) 2000 rows and 2000 columns using Perl::PDL module. I used the following perl script
#!/usr/bin/perl -w
use strict;
use warnings;
use PDL;
use PDL::Matrix;
if ( @ARGV != 3 ) {
die 'Two matrix files are... (1 Reply)
Discussion started by: Fredrick
1 Replies
7. Shell Programming and Scripting
Dear all,
I'm new in perl scripting and I'm trying to creating a matrix from a 3 column file sorting data in a particular manner. In the final matrix I need to have the first column "IDs" on the header of the columns and the second column values on the header of each row. And the value fo the... (2 Replies)
Discussion started by: gabrysfe
2 Replies
8. Shell Programming and Scripting
Hello all,
I have a tricky question! (at least for me it is!). I'll try to explain it carefully here. Hope you can help me solving the whole or even parts of it! Here it is:
I have a big input 0\1 table as a very simplified one is shown below:
(The last row and column are the sum and... (0 Replies)
Discussion started by: @man
0 Replies
9. Shell Programming and Scripting
Hey Masters,
Here is my input:
fragmentID chromosome start end HEL25E TRIP1
r5GATC2L00037 chr2L 5301 6026 0.03 0.036
r5GATC2L00038 chr2L 6023 6882 -0.025 -0.041
r5GATC2L00040 chr2R 6921 7695 -0.031 0.005
r5GATC2L00042 chr2R 7715 8554 -0.006 -0.024
r5GATC2L00043 chr3L 8551 8798 0.042 0... (4 Replies)
Discussion started by: @man
4 Replies
LEARN ABOUT CENTOS
zlacrm.f
zlacrm.f(3) LAPACK zlacrm.f(3)
NAME
zlacrm.f -
SYNOPSIS
Functions/Subroutines
subroutine zlacrm (M, N, A, LDA, B, LDB, C, LDC, RWORK)
ZLACRM multiplies a complex matrix by a square real matrix.
Function/Subroutine Documentation
subroutine zlacrm (integerM, integerN, complex*16, dimension( lda, * )A, integerLDA, double precision, dimension( ldb, * )B, integerLDB,
complex*16, dimension( ldc, * )C, integerLDC, double precision, dimension( * )RWORK)
ZLACRM multiplies a complex matrix by a square real matrix.
Purpose:
ZLACRM performs a very simple matrix-matrix multiplication:
C := A * B,
where A is M by N and complex; B is N by N and real;
C is M by N and complex.
Parameters:
M
M is INTEGER
The number of rows of the matrix A and of the matrix C.
M >= 0.
N
N is INTEGER
The number of columns and rows of the matrix B and
the number of columns of the matrix C.
N >= 0.
A
A is COMPLEX*16 array, dimension (LDA, N)
A contains the M by N matrix A.
LDA
LDA is INTEGER
The leading dimension of the array A. LDA >=max(1,M).
B
B is DOUBLE PRECISION array, dimension (LDB, N)
B contains the N by N matrix B.
LDB
LDB is INTEGER
The leading dimension of the array B. LDB >=max(1,N).
C
C is COMPLEX*16 array, dimension (LDC, N)
C contains the M by N matrix C.
LDC
LDC is INTEGER
The leading dimension of the array C. LDC >=max(1,N).
RWORK
RWORK is DOUBLE PRECISION array, dimension (2*M*N)
Author:
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date:
September 2012
Definition at line 115 of file zlacrm.f.
Author
Generated automatically by Doxygen for LAPACK from the source code.
Version 3.4.2 Tue Sep 25 2012 zlacrm.f(3)