Problems In Viewing Alignment File...
1
0
Entering edit mode
12.7 years ago
Nikita ▴ 10

Hello all,

What i want to do is view my alignment file on web. However when i do so using PHP the entire alignment file is read but the text aligns itself to left and leaves the alignment hard to interpret. this is my PHP code

$file = fopen("res.aln", "r") or exit("Select sequences to align!");
while(!feof($file))
{
    echo fgets($file). "<br />";
}
fclose($file);

Is there a way to read alignment files without incorporating any viewer. Also is it possible to directly open the alignment file like we do by double-clicking it???

alignment • 2.3k views
ADD COMMENT
2
Entering edit mode

what kind of alignment file? why don't you use this: http://biostar.stackexchange.com/questions/6134/blast-output-into-jsp-html. or simply:

alingment stuff

ADD REPLY
1
Entering edit mode

that shouldn't matter. keep in mind that it surely is a plain text file, so in terms of web serving it's like dealing with any other text. just echo a "

" tag before the while and a "
" just after it and it should do. I would though think carefully about how exactly I would want the users to interact with that file, as serving it as described may not be optimal.

ADD REPLY
0
Entering edit mode

Yes, sounds like you just need pre tags...

ADD REPLY
0
Entering edit mode

@michael Dondrup: Its a multiple sequence alignment file..

ADD REPLY
0
Entering edit mode

@Michael Dondrup, Jorge Amigo : thankss for it!! it worked!!

ADD REPLY
0
Entering edit mode
12.7 years ago

the .aln extension is typically from an alignment file, a result from a program like Clustal for instance. assuming that what you want is to display it as it is I see 2 simple options:

  1. you may directly put a link to the file. since it is a plain text file the user should see it perfectly displayed on the email browser.
  2. if you need to read it and display its results on a formatted web page of yours I would definitely go for Michael's suggestion of enclosing its contents into "pre" tags.
ADD COMMENT

Login before adding your answer.

Traffic: 2394 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