I have Multiple sequence alignment (clustal) file and I want to read this file and arrange nucleotide sequences in such a way that it looks more clear and precise in order.
I am doing this from biopython using AlignIO object. My codes goes like this:
alignment = AlignIO.read("opuntia.aln", "clustal") print "Number of rows: %i" % len(align) for record in alignment: print "%s - %s" % record.id, record.seq)
I have been more fascinated by the output of http://www.ebi.ac.uk/Tools/clustalw2/ project because it looks clear.
My Output -- , it looks messy and long scrolling. What i want to do is print only 50 sequences (nucleotide) in each line and continue till the end of alignment file.
I wish to have output like this from http://www.ebi.ac.uk/Tools/clustalw2/.
Any suggestions, algorithm and sample code is appreciated
Here is the link to the input file-- http://pastebin.com/EaeKsyvg
Thanks in advance
By '50 sequences', do you mean 50 nucleotides? @Thaman: I have seen a few of your questions and they are all great, in the sens that they have the potential to be very useful to others. However, it would be much better if you took the time to formulate them more clearly, giving both more details about the context and what you desire, and also making it more English. That way, you will get much better replies and won't have to ask the same question twice because the first version was confusing, as happened recently. Thanks for your contribution! Cheers.
Sequence ID and 50 sequences? That's not clear.
I mean like this...........
@Eric, thanks for your kind suggestion, i have edited my query and make it more precise. I am just trying to make alignment output similar to http://www.ebi.ac.uk/Tools/clustalw2/ project. According to my output its long nucleotide record, but i want to split it into 50 nucleotide each in individual line. Thanks for listening
Could you please put the input data on the web. That way we can write a code and test it withouth having to generate the input data manually. Just paste it into http://pastebin.com/ and link it.
Could you please put the input data (alignment) on the web. That way we can write a code and test it without having to generate the input data manually. Just paste it into pastebin.com and link it
How can i link it to Istan Albert?
just edit the post and add the link into the main post
Ok now finally alignment file is here.
okei i provided the input file link in the main post.
The input file is the file you want to transform, the one that has long lines. The file that you provide seems like the result of the transformation.
I tried with readlines() and seems working, seems likes i couldn't make my problem clear to you.