This is a test version of Biostars. For the public version, visit https://www.biostars.org.
extract sequences from a fasta file and save into different files

Hey I have a fasta file which contains more than 80 sequences. I want to take each sequences in different files and the file name should be header of corresponding sequence.

perl sequence awk fasta

That's simple but the header should not contain illegal characters for a filename i.e. \ / : * ? " < > |

a simple loop will do that if one takes care of these chars.

yup header like this only GCF_000196095n.fasta_2 ..

3 answers

$ pip install pyfaidx
$ faidx --split-files in.fasta

http://emboss.sourceforge.net/apps/release/6.6/emboss/apps/seqretsplit.html

seqretsplit <input_fasta>
curl https://raw.githubusercontent.com/gouthamatla/fasta_File_Manipulation/master/SplitFastaFile.py | python - <in.fasta>

thank u sir... its working

Log in to answer this question.