I have a text file that have sequences (including gaps and excluding headers) making matrix size 738x708. I want to read that file as an alignment. How can that be made possible?
And Yes, the text file is an alignment in itself.
Thanks!
I have a text file that have sequences (including gaps and excluding headers) making matrix size 738x708. I want to read that file as an alignment. How can that be made possible?
And Yes, the text file is an alignment in itself.
Thanks!
One solution is to write a simple script to parse the alignment you have in text format. The complexity of that script of course depends on what you wish to extract from the alignment. Counting numbers of different residues/gaps per column is rather simple, for example. Other analyses could be more complex. Do you want to build an HMM? There are tools for this where you'd have to do little to no editing of your alignment other than paring it to what constitutes a (conserved) domain.
The story behind the text file is that I used original alignment file to generate positional corrrelation after employing cut-off value. The length of the alignment decreased from 1600 to 708. I extracted the data from MATLAB workspace and saved as text file. Now, I want to get consensus out the new version of the alignment. Its very unlikely that I would be able to write script and would highly prefer to know programs or techniques.
Assuming that the text file looks like this
ATGG..
ATGA..
AATT..
The simplest solution would be to turn the matrix into a fasta file by adding ">$id\n" in front of every row, where $id is a unique identifier. Example of a perl one liner.
perl -ne '$id++; print ">$id\n$_"' filename
Most alignment programs/editors (e.g.JalView) can use fasta based alignments
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
I'd say the text file /is/ an alignment. Perhaps you could be more specific?