split all fasta sequences in a multi fasta file from half into two sequences
Hi i have a fasta file with many fasta sequences and I want to split all the fasta sequences into two half from middle.. I am new to bioinformatics kindly suggest some tool or perl command
• 2,124 views
•
link
1 answer
Assuming no linebreaks in sequences:
awk '{if(/^>/){H1=$0"_1";H2=$0"_2"}else{print H1"\n"substr($0,1,length($0)/2)"\n"H2"\n"substr($0,length($0)/2+1)}}' seq.fa
• 0 views
•
link
Log in to answer this question.
You should first either use the biostars search utility to look for similar post or you can google like this to get answers from biostars.org.
on google.com : split fasta site:www.biostars.org
So, we recommend you to first look for similar post, try one of the answers mentioned by other users,and then post the issues that you may face adding specific details of the commands use.
We do not encourage providing direct answers. Show us your efforts and we will love to help.
I know how to split a big fasta files into multiple fasta files but my query is to bisect all fasta nucleotide sequences in a fasta file into two halves e.g.
into
sorry if i asked this simple thing but as i told i am new to bioinfo
Hello manishbiotechie,
Please use the formatting bar (especially the

codeoption) to present your post better. I've done it for you this time.You should explain this by adding your code here. May be people can suggest how you can edit / expand your code.
Why do you need to [literally] split the sequence in half? It should be possible to do with awk.