concat_fasta_files

yoda_powers.bio.concat_fasta_files(path_directory)[source]

Return a fasta dictionnary of concatenation fasta file’s find in directory (“fasta”, “fa”, “fas”)

Warning

Sequence on fasta must have the same name

Notes

function need modules:

  • pathlib

  • BioPython

Parameters

path_directory (str) – a path to fasta file directory

Returns

python dict with the concatenation of fasta filename in path_directory ( file with extention “fa”, “fasta”, “fas” )

Return type

dict

Raises
  • ValueError – If path_directory does not exist.

  • ValueError – If path_directory is not a valid directory.

Examples

>>> dico_concat = concat_fasta_files('path/to/directory/')
>>> print(dico_concat)
    {"Seq1":"ATGCTGCAGTAG","Seq2":"ATGCCGATCGATG","Seq3":"ATGCTCAGTCAGTAG"}