From 245e9658a98e7bfdbadc5aaf22860fcbacecafe2 Mon Sep 17 00:00:00 2001 From: JeanMainguy Date: Thu, 9 Feb 2023 16:44:54 +0100 Subject: [PATCH 1/3] add requests and fix minimal version for networkx --- setup.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 3260d51..91aec5c 100644 --- a/setup.py +++ b/setup.py @@ -20,10 +20,11 @@ 'pyyaml', 'python-igraph', 'jsonschema', - 'networkx', + 'networkx>=2.8', 'markov_clustering', 'urllib3', 'biopython', + 'requests' ], include_package_data=True, @@ -31,7 +32,7 @@ url='http://github.com/labgem/netsyn', classifiers=[ - 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', 'License :: OSI Approved :: CEA CNRS Inria Logiciel Libre License, version 2.1 (CeCILL-2.1)', 'Topic :: Scientific/Engineering :: Bio-Informatics' ], From 44849cf75e854b9a50b115b588a8243e3b13387f Mon Sep 17 00:00:00 2001 From: JeanMainguy Date: Mon, 13 Feb 2023 17:18:09 +0000 Subject: [PATCH 2/3] update readme with bioconda install --- README.md | 47 ++++++++++++++++------------------------------- 1 file changed, 16 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index f8aff13..60c4c89 100644 --- a/README.md +++ b/README.md @@ -1,60 +1,45 @@ +[![install with bioconda](https://img.shields.io/badge/install%20with-bioconda-brightgreen.svg?style=flat)](http://bioconda.github.io/recipes/netsyn/README.html) +[![installs](https://img.shields.io/conda/dn/bioconda/netsyn.svg?style=flag&label=BioConda%20install)](https://anaconda.org/bioconda/netsyn) + # NetSyn: detect synteny conservation among a list of protein targets NetSyn is a tool to detect conserved genomic contexts (i.e. synteny conservation) among a set of protein (call protein targets). Synteny are computed using a re-implementation of the method described in Boyer *et al.* article ([https://doi.org/10.1093/bioinformatics/bti711](https://doi.org/10.1093/bioinformatics/bti711)). ## Installation -Prerequisites: python 3.8 and MMseqs2. - -Netsyn installation: `python3 setup.py install` - -For the installation of MMseqs2 please refer to https://github.com/soedinglab/MMseqs2/wiki#installation - - Python library list: - - - pyyaml - - igraph +### Installation with BioConda - - jsonschema +Netsyn can be easilly installed with bioconda - - networkx (>= 2.8) +```bash - - markov_clustering +conda create -n netsyn -c bioconda netsyn - - urllib3 - - biopython - - - requests - -You can easely install NetSyn using an virtual environment with pip (command lines example below): - - - virtualenv venv_netsyn +``` - - source venv_netsyn/bin/activate - - pip install pyyaml +### Manual installation - - pip install igraph +You can easely install NetSyn with pip. Netsyn requires python >= 3.8 - - pip install jsonschema +```bash - - pip install networkx +git clone https://github.com/labgem/netsyn - - pip install markov_clustering +pip install netsyn/ - - pip install urllib3 +``` - - git clone https://github.com/labgem/netsyn +Netsyn requires MMseqs2 as a 3rd party software which must be installed and executable. For the installation of MMseqs2 please refer to https://github.com/soedinglab/MMseqs2/wiki#installation - - python3 setup.py install ## Basic Usage NetSyn can be used with 2 different input file formats. One is a file containing a list of UniProt accessions (`-u` option), while the other one is a correspondences file (`-c` option). The two types of file are described in the Input Data part. It is possible to start an analysis with both input file formats. It leads to 3 NetSyn basic usage callings: - - with the UniProt accessions list: + - with the UniProt accessions list: `netsyn -u -o ` - with the correspondences file: From 9b7553b0c6edd2e1100f907440853bf25d2e6e35 Mon Sep 17 00:00:00 2001 From: JeanMainguy Date: Mon, 13 Feb 2023 17:19:21 +0000 Subject: [PATCH 3/3] use networkx to write final graph to graphML #1 --- netsyn/netsyn_dataExport.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/netsyn/netsyn_dataExport.py b/netsyn/netsyn_dataExport.py index a09864a..0f5af8e 100755 --- a/netsyn/netsyn_dataExport.py +++ b/netsyn/netsyn_dataExport.py @@ -9,6 +9,7 @@ import logging import os import igraph as ig +import networkx as nx import re ############# # Functions # @@ -638,7 +639,11 @@ def run(nodesFile, edgesFile, organismsFile, proteinsFile, metadataFile, redunda mergeResultIntoHTML( htmlOut, common.global_dict['htmlTemplate'], common.global_dict['jsTemplate'], netsynResult) - full_graph.write_graphml(graphmlOut) + + # full_graph.write_graphml(graphmlOut) + logger.debug('Writting graphML output...') + full_graph_nx = full_graph.to_networkx() + nx.write_graphml_lxml(full_graph_nx, graphmlOut, named_key_ids=True) # COM: Storage of information to write ClusteringSynthesis files logger.info('Analysis synthesis process...')