dict_2_fasta

yoda_powers.bio.dict_2_fasta(dico, fasta_out)[source]

Function that takes a dictionary where key are ID and value Seq, and write a fasta file.

Notes

function need modules:

  • pathlib

  • BioPython

Parameters
  • dico (dict) – python dict with ID in key and Seq on values

  • fasta_out (str) – a directory path to write nexus file

Returns

the output fasta file name

Return type

str

Examples

>>> dico = {"Seq1":"ATGCTGCAGTAG","Seq2":"ATGCCGATCGATG","Seq3":"ATGCTCAGTCAGTAG"}
>>> dict_2_fasta(dico)
>Seq1
ATGCTGCAGTAG
>Seq2
ATGCCGATCGATG
>Seq3
ATGCTCAGTCAGTAG