No project description provided
Project description
SAMBA (Smoothed imAge MicroBiome distAnce)
This code is attached to the paper "". SAMBA is a novel microbial metric. SAMBA utilizes the iMic method to transform microbial data into images, incorporating phylogenetic structure and abundance similarity. This image-based representation enhances data visualization and analysis. Moreover, SAMBA employs a fast Fourier transform (FFT) with adjustable thresholding to smooth the images, reducing noise and accentuating meaningful information. Various distance metrics, such as SAM and MSE, can be applied to the processed images.
How to apply SAMBA
SAMBA's code is available at this GitHub as well as pypi.
SAMBA's GitHub
There is an example in example_use.py. You should follow the following steps:
-
Load the raw ASVs table in the following format: the first column names "ID", each row represent a sample and each column represents an ASV. The last row contains the taxonomy information, names "taxonomy".
df = pd.read_csv("example_data/for_preprocess.csv")
-
Apply the MIPMLP with the defaultive parameters (see MIPMLP for more explanations).
processed = MIPMLP.preprocess(df)
-
micro2matrix (translate microbiome into matrix according to iMic, and save the images in a prepared folder
folder = "example_data/2D_images" micro2matrix(processed, folder, save=True)
-
Calculate the distance matrix according to SAMBA One can choose the FFT cutoff (in range [0,1]), and the final metric (one of "sam","mse","d1","d2","d3").
DM = build_SAMBA_distance_matrix(folder,cutoff=CUTOFF,metric=METRIC)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for samba_metric-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97cf2b2f62d2f31011296251fb15090204ab7230f81f92720055816132bb0ef0 |
|
MD5 | 4fc2e45d9af921af5db790eedd88beef |
|
BLAKE2b-256 | ff4ce6a73a88fd8ea837aedb9740c9ea2d75a51b567e4d1754d51da5b9105ad0 |