This is a test version of Biostars. For the public version, visit https://www.biostars.org.
convert .txt file to fasta format

Hi, I have downloaded .txt files from supplementary data of GEO database . I want to convert these txt format files to fasta format. Can someone let me know how do i do this?

This is how the file looks

    AAAAAAAAAAAAAAATTGTCGAAT    2

    AAAAAAAAAAAAAAGAATCGACCGTTCGACT 1

    AAAAAAAAAAAAAATACAAAGGCT    1

    AAAAAAAAAAAAACCGGGACCTCT    1

    AAAAAAAAAAAAACTTTCGAATCTTAGCGAC 1

    AAAAAAAAAAAAAGAATCGACCGTTCGACTATT   1
sequence rna-seq

Imagine you'd read this question. Would you be able to know how this file looks and therefore could put together code for the conversion? Please invest some effort. Show example data and highlight it properly with the code option 10101. By the way, I noted that you deleted two of your previous questions that received comments from other members. If you are going to delete this one again after it receivs helpful comments or answers your account might get suspended.

firstly I did not receive any helpful comments hence i deleted those. secondly, those issues were resolved before anyone commented hence I deleted them. I would appreciate if you could be kind. Thanks!

1 answer

Assuming tab-separated file:

cut -f1 file.txt | awk '{print ">Sequence_"$1"\n"$1}'

Thanks for your help!! highly appreciative!!

Log in to answer this question.