Is There A Method Or Script To Read Distance Matrix Output Using Python
1
0
Entering edit mode
12.3 years ago
Burke ▴ 290

Hello,

I am looking for a biopython method or regular python script to read in distance matrix output from EMBOSS program distmat (http://emboss.sourceforge.net/apps/release/6.4/emboss/apps/distmat.html) . I have searched but found nothing.

Thanks!

python biopython distance • 4.1k views
ADD COMMENT
1
Entering edit mode
12.3 years ago
Michael 54k

From looking at the sample output of distmat it looks like a - hopefully - tab separated format, so it is maybe not required to use biopython. I guess what you could do is

  • skip the few header lines
  • use string split using "t" on each line and read this into a vector or array data structure. Names seem to be the last column in each line.

From the example output though it could also be a format which uses variable number of space spaces to align the ouput columns, this would make things slightly more difficult but not impossible. In this case, you had to split by "s+" (multiple spaces) and fill up each row vector with #n undefined values, according to the #n the line number (starting at 0).

As you might have noticed, I don't know python, but I'm sure it has something like a split and arrays (as people still claim it is nearly as powerful as perl xD). If that doesn't seem to help, ignore this answer or ask me for a perl script.

ADD COMMENT
0
Entering edit mode

Thanks Michael. I had similar thoughts just throughout I would check if there is an existing way...

ADD REPLY

Login before adding your answer.

Traffic: 3873 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6