len_seq_2_dict

yoda_powers.bio.len_seq_2_dict(fasta_file)[source]

Function that take a file name (fasta), and return a dictionnary with length of sequence

Notes

function need modules:

  • pathlib

  • BioPython

Parameters

fasta_file (str) – a path to fasta file directory

Returns

the fasta dict with sequence length

Return type

dict

Raises
  • ValueError – If fasta_file does not exist.

  • ValueError – If fasta_file` is not a valid file.

Example

>>> filename = "sequence.fasta"
>>> len_seq_2_dict(filename)
{'Seq1': 12, 'Seq2': 13, 'Seq3': 15}