Skip to content

calculate_4mer_freq.py

nielshanson edited this page Aug 17, 2013 · 8 revisions

About

This script calculates the tetra-nucleotide frequency from a number of .fasta files. Displaying all the calculated values as a tab-delimied text file (.tsv).

Common Usage

python calculate_4mer_freq.py -i *fasta -o 4mer_matrix.tsv

where,

  • *fasta is a unix glob pattern selecting one or more .fasta (.fa|.fas|.fasta|.fna|.f) files
  • 4mer_matrix.tsv is the name of the result matrix containing the tetramer counts for each input file

Example

Using some example .fasta files, contained in the /calculate_4mer_freq/example/ directory of this repo. One can create a matrix of tetra nucleotide frequenies using the following command in the /calcualte_4mer_freq/ directory:

python calculate_4mer_freq.py -i example/* -o 4mer_matrix.tsv

Clone this wiki locally