Converting txt file into fasta file
1
0
Entering edit mode
4 weeks ago

Dear All, I have collected 20 sequences for a gene in 20 species in a txt file. I need to convert this file into a fasta file, so that to read it in R function to perform sequence alignment and phylogenetic. I knew that R have a function for "system.file", whihc is for fasta files in a packages not an external one as in my case.

Any help ?

program R • 155 views
0
Entering edit mode

post example lines and expected output.

0
Entering edit mode
4 weeks ago

To generate a FASTA file, just follow the definition of a FASTA file. Basically, an uninterrupted chain of amino acids or nucleotide letters which are preceded by an identifier line that starts with ">"

>MCHU - Calmodulin - Human, rabbit, bovine, rat, and chicken
FPEFLTMMARKMKDTDSEEEIREAFRVFDKDGNGYISAAELRHVMTNLGEKLTDEEVDEMIREA
DIDGDGQVNYEEFVQMMTAK*

>gi|5524211|gb|AAD44166.1| cytochrome b [Elephas maximus maximus]
LCLYTHIGRNIYYGSYLYSETWNTGIMLLLITMATAFMGYVLPWGQMSFWGATVITNLFSAIPYIGTNLV
EWIWGGFSVDKATLNRFFAFHFILPFTMVALAGVHLTFLHETGSNNPLGLTSDSDKIPFHPYYTIKDFLG
GLMPFLHTSKHRSMMLRPLSQALFWTLTMDLLTLTWIGSQPVEYPYTIIGQMASILYFSIILAFLPIAGX
IENY


More details can be found all over the internet, wikipedia is a great starting point.