ParticleChromo3D - A Particle Swarm Optimization Algorithm for Chromosome 3D Structure Prediction from Hi-C Data
OluwadareLab, University of Colorado, Colorado Springs
Developers:
David Vadnais
Department of Computer Science
University of Colorado, Colorado Springs
Email: dvadnais@uccs.edu
Michael Middleton
Department of Computer Science
University of Colorado, Colorado Springs
Email: mmiddlet@uccs.edu
Contact:
Oluwatosin Oluwadare, PhD
Department of Computer Science
University of Colorado, Colorado Springs
Email: ooluwada@uccs.edu
This code has continued development in the follow on ParticleChromo3D+. As part of that process we released a containerized web gui with restful endpoints that can be accessed here. Additionally, we released a PyPi project which we will describe below.
ParticleChromo3D from PyPi
NOTE: This usage is underconstruction.
We released a pypi package.
Simply run : pip install ParticleChromo3D
Then :
from ParticleChromo3D import Ps
import numpy as np
fout = Ps.strip_file("exampleIfs/chr22_matrix.txt")
# this will all get moved into a self contained function soon
theseAlphas = np.array([0.1, 2.0, 0.1]) * 100
theAlphas = ( np.array(range(int(theseAlphas[0]), int(theseAlphas[1]), int(theseAlphas[2]))) / 100)
outputOfSwarm = Ps.Full_List(fout, "this_pdb", theseAlphas)[0]
bestSpearm = outputOfSwarm[1]
bestCost = outputOfSwarm[2]
bestAlpha = theAlphas[outputOfSwarm[4]]
bestPearsonRHO = outputOfSwarm[0]
print(f"Convert factor:: {bestAlpha}")
print(f"SSE at best spearman : {bestCost}")
print(f"Best Spearman correlation Dist vs. Reconstructed Dist : {bestSpearm}")
print(f"Best Pearson correlation Dist vs. Reconstructed Dist: {bestPearsonRHO}")
Ps.Write_Log(
"this_run.log", fout, bestAlpha, bestCost, bestSpearm, bestPearsonRHO
)Additional usage documentation can be found in ParticleChromo3D+. Click here to view
- src: Python Source Code and utility's used.
- input-and-models: Synthetic and Real Hi-C datasets used.
- Results: Output Structions generated for all the experiments performed.
In our study, we used the synthetic dataset from Adhikari, et al. The contact maps, the original models and their reconstructed models used in this study were downloaded from here
The GM12878 cell Hi-C dataset, GEO Accession number GSE63525, was downloaded from GSDB with GSDB ID: OO7429SF
Square Matrix Input format: The square matrix is a space seperated N by N intra-chromosomal contact matrix derived from Hi-C data, where N is the number of equal-sized regions of a chromosome.
Install env with anaconda from spec-file:
conda create --name ParticleChromo3D --file ParticleChromo3d_env.txt
Or install dependencies individually
Dependencies:
Biopython - 1.7.8
scipy - 1.5.2
numpy - 1.19.2
usage: python3 Ps.py infile [-h] [-ss SWARMSIZE] [-itt ITTCOUNT] [-t THRESHOLD] [-rr RANDRANGE] [-lf LOSSFUNCTION]
-
positional arguments:
infile: Input file in the format of a matrix of contacts -
optional arguments:
-h, --help show this help message and exit
-ss SWARMSIZE, --swarmSize SWARMSIZE
Number of particles in system [Default 15]
-itt ITTCOUNT, --ittCount ITTCOUNT
Maximum number of iterations before stop [Default 30000]
-t THRESHOLD, --threshold THRESHOLD
Error threshold before stoping [Default 0.000001]
-rr RANDRANGE, --randRange RANDRANGE
Range of x,y,z starting coords. Random value bewtween -randRange,randRange [Default 1]
-o OUTFILE, --outfile OUTFILE
Filename of the output pdb model [Default ./chr.pdb]
-lf LOSSFUNCTION, --lossFunction LOSSFUNCTION
0 = SSE, 1 = MSE, 2 = RMSE, 3 = Huber [Default 2]
A pdb file and log file.
Vadnais, D., Middleton, M. & Oluwadare, O. ParticleChromo3D: a Particle Swarm Optimization algorithm for chromosome 3D structure prediction from Hi-C data. BioData Mining 15, 19 (2022). https://doi.org/10.1186/s13040-022-00305-x
Vadnais, David, and Oluwatosin Oluwadare. "ParticleChromo3D+: A Web Server for ParticleChromo3D Algorithm for 3D Chromosome Structure Reconstruction." Current Issues in Molecular Biology 45.3 (2023): 2549-2560.