fasta_2_dict¶
-
yoda_powers.bio.
fasta_2_dict
(fasta_file)[source]¶ Function that take a file name (fasta), and return a dictionnary of sequence
Notes
function need modules:
pathlib
BioPython
- Parameters
fasta_file (str) – a path to fasta file directory
- Returns
the fasta dict with sequence extract
- Return type
dict
- Raises
ValueError – If fasta_file does not exist.
ValueError – If fasta_file is not a valid file.
Example
>>> filename = "sequence.fasta" >>> fasta_2_dict(filename) {'Seq1': SeqRecord(seq=Seq('ATGCTGCAGTAG', SingleLetterAlphabet()), id='Seq1', name='Seq1', description='Seq1', dbxrefs=[]), 'Seq2': SeqRecord(seq=Seq('ATGCCGATCGATG', SingleLetterAlphabet()), id='Seq2', name='Seq2', description='Seq2', dbxrefs=[]), 'Seq3': SeqRecord(seq=Seq('ATGCTCAGTCAGTAG', SingleLetterAlphabet()), id='Seq3', name='Seq3', description='Seq3', dbxrefs=[])}