[Bioperl-l] Clustal w - fixed width characters

Josh Lauricha laurichj at bioinfo.ucr.edu
Fri Jun 18 00:35:47 EDT 2004


This is a fun question. Given the b() function call, I am assuming you
are writing a CGI script and thus are generating HTML. You basically
need to ensure that a "monospace" font is used. However, how you do this
varies from browser to browser. I've found the following to work for a
variety of browsers.

First, create a CSS file (or just inline them into the CGI script) that
contains:
    tt { font-family: "FreeMono", "monospace" }

Then just wrap the prints in <tt>foo</tt> tags. OR, use this:
    b { font-family: "FreeMono", "monospace" }

but then all bold elements will be of fixed width.

Like all HTML things, there are a dozen ways to do this, meeting with
more or less sucess from browser to browser. In theory TT by itself
should be fixed width, but it generally isn't. If you want to conserve
non-HTML formatting use pre rather than tt.

On Thu 06/17/04 19:48, Tariq Shafi wrote:
> Hi
> 
> I am using a Clustalw alignment and in doing the alignment I want to format 
> my alignment results in fixed width characters.
> 
> I get an object called $alignment from the Clustalw operation, using 
> Bio::Tools::Run::Alignment::Clustalw;
> 
> Later on, I am using the following code:
> 
> foreach $seq ($alignment->each_seq) {
>    print b($seq->id(), ':');
>    $str = $seq->seq();
>    print $str, br();
>    }
> 
> This gives alignments but they are difficult to visualise as the characters 
> are not of fixed width, so (visually only) it is out of sync. How do I make 
> the characters in each sequence of fixed width?
> 
> Regards
> 
> Tariq
> 
> _________________________________________________________________
> It's fast, it's easy and it's free. Get MSN Messenger today! 
> http://www.msn.co.uk/messenger
> 
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
> 

-- 

------------------------------------------------------
| Josh Lauricha            | Ford, you're turning    |
| laurichj at bioinfo.ucr.edu | into a penguin. Stop    |
| Bioinformatics, UCR      | it                      |
|----------------------------------------------------|
| OpenPG:                                            |
|  4E7D 0FC0 DB6C E91D 4D7B C7F3 9BE9 8740 E4DC 6184 |
|----------------------------------------------------|


More information about the Bioperl-l mailing list