Hello everyone I'm looking for a function in python or Biopython that can calculate the `tetranucleotide frequency` of a given regions of scaffold. 

The idea is that I have several **regions** and I want to identify possible `changes in nucleotide composition` that correspond to the an `endogenization` regions within my genome, for that I need to calculate theTNFs across regions for these contigs. I then need to calculate the Pearson correlation of these frequencies compared to the TNF of a set of the largest contigs in these genome assemblies (these contigs being probably really from the genome and were not endogenized).

Does someone know a such package in python? 

Thanks you 
[**CheckM**][1] can do what you need - see [**here**][2]:

    checkm tetra seqs.fna tetra.tsv

You can use the frequencies to separate the sequences in a 2D plot using various dimensionality reductions methods such as PCA, tSNE (shown below) or UMAP.

![enter image description here][3]


  [1]: https://github.com/Ecogenomics/CheckM
  [2]: https://github.com/Ecogenomics/CheckM/wiki/Utility-Commands
  [3]: https://i.ibb.co/xG0Zfmt/t-SNE-cluster-plot.png