Package: pyengnet
pyEnGNet: optimized reconstruction of gene co-expression networks using multi-GPUDeployment & Documentation & StatsAbstract herepyengnetis featured for:Unified APIs, detailed documentation, and interactive examplesavailable to the community.Complete coveragefor reconstruction of massive gene co-expression networks.Optimized modelsto generate results in the shortest possible time.Optimization of a High-Performance Computing (HPC) and Big Data ecosystem, usingcudaandmultiprocess.API Demo:importosfrompyengnet.FileimportFilefrompyengnet.EngnetimportEngnetif__name__=="__main__":# Load datasetdataset=File.load(path=os.getcwd()+"/datasets/Spellman.csv",separator=",",nmi_th=0.6,spearman_th=0.7,kendall_th=0.7,readded_th=0.7,hub_th=3)# Run pyEnGNet on CPUsgraphFiltered,infoGraphFiltered,graphComplete,infoGraphComplete=Engnet.process(dataset,saveComplete=True)# Run pyEnGNet on GPU devices# graphFiltered, infoGraphFiltered, graphComplete, infoGraphComplete = Engnet.process(dataset, saveComplete = True, numGpus = 2, computeCapability = 61)# Save gene co-expression networks and additional informationFile.saveFile(path='/home/principalpc/Escritorio/graphComplete.csv',graph=infoGraphComplete)# Full networkFile.saveFile(path='/home/principalpc/Escritorio/graphFiltered.csv',graph=infoGraphFiltered)# Filtered network# Print gene co-expression networksFile.showGraph(graph=graphComplete,title='Complete graph')# Full networkFile.showGraph(graph=graphFiltered,title="Filtered graph")# Filtered networkCiting pyEnGNet:pyEnGNet paperis published in(under review).
If you use pyEnGNet in a scientific publication, we would appreciate citations to the following paper:Under reviewor:Under reviewKey Links and Resources:View the latest codes on GithubView the documentation & APIView all examplesInstallationIt is recommended to usepipfor installation. Please make surethe latest versionis installed, as pyengnet is updated frequently:pipinstallpyengnet# normal installpipinstall--upgradepyengnet# or update if neededpipinstall--prepyengnet# or include pre-release version for new featuresAlternatively, you could clone and run setup.py file:gitclonehttps://github.com/aureliolfdez/pyEnGNet.gitpipinstall.Required Dependencies:Python>=3.10numpy>=1.24.0tqdm>=4.64.0multiprocess>=0.70.14pandas>=1.5.3matplotlib>=3.6.3networkx>=3.0scipy>=1.10.0API ReferenceI/O Managementpyengnet.File: Class used to manage file I/O operations and data visualization.pyengnet.File.load(): Load dataset from a txt or csv file.pyengnet.File.saveFile(): Save network to file (can be used to store full and/or pruned networks)pyengnet.File.showGraph(): Display a specific networkEnsemblepyengnet.Engnet: Class in charge of controlling the execution of the EnGNet algorithm.pyengnet.Engnet.process(): Function that runs the EngNet algorithm. Depending on the parameters of this function, the algorithm will be executed in parallel with CPU processors or GPU devices.pyengnet.Kendall: Kendall measurement is coded in a parallel ecosystem with CPUs.pyengnet.NMI: NMI measurement is coded in a parallel ecosystem with CPUs.pyengnet.Spearman: Spearman measurement is coded in a parallel ecosystem with CPUs.pyengnet.src.correlations: Execution of Kendall, NMI, and Spearman measures under a parallel multi-GPU ecosystem (CUDA). In addition, it detects those pairs of genes that exceed the threshold for major voting.Examples by TasksAll implemented modesare associated with examples, check“pyEnGNet examples”for more information.Run on CPU“tests/test_integration/test_cpu.py”demonstrates the basic API for the generation of co-expression gene networks using CPUs.Load gene co-expression dataset from input filefrompyengnet.FileimportFiledataset=File.load(path=os.getcwd()+"/datasets/Spellman.csv",separator=",",nmi_th=0.6,spearman_th=0.7,kendall_th=0.7,readded_th=0.7,hub_th=3)Run pyEnGNet based on CPUs.frompyengnet.EngnetimportEngnetgraphFiltered,infoGraphFiltered,graphComplete,infoGraphComplete=Engnet.process(dataset,saveComplete=True)Save gene co-expression networks output (optional)frompyengnet.FileimportFileFile.saveFile(path='/home/user/Desktop/graphComplete.csv',graph=infoGraphComplete)File.saveFile(path='/home/user/Desktop/graphFiltered.csv',graph=infoGraphFiltered)Print gene co-expression networks output  (optional)frompyengnet.FileimportFileFile.showGraph(graph=graphComplete,title='Complete graph')File.showGraph(graph=graphFiltered,title="Filtered graph")Run on GPU devices“tests/test_integration/test_gpu.py”demonstrates the basic API for the generation of co-expression gene networks using GPU devices.Load gene co-expression dataset from input filefrompyengnet.FileimportFiledataset=File.load(path=os.getcwd()+"/datasets/Spellman.csv",separator=",",nmi_th=0.6,spearman_th=0.7,kendall_th=0.7,readded_th=0.7,hub_th=3)Run pyEnGNet based on CPUs.frompyengnet.EngnetimportEngnetgraphFiltered,infoGraphFiltered,graphComplete,infoGraphComplete=Engnet.process(dataset,saveComplete=True,numGpus=2,computeCapability=61)Save gene co-expression networks output (optional)frompyengnet.FileimportFileFile.saveFile(path='/home/user/Desktop/graphComplete.csv',graph=infoGraphComplete)File.saveFile(path='/home/user/Desktop/graphFiltered.csv',graph=infoGraphFiltered)Print gene co-expression networks output  (optional)frompyengnet.FileimportFileFile.showGraph(graph=graphComplete,title='Complete graph')File.showGraph(graph=graphFiltered,title="Filtered graph")