a python package to generate and analyse protein similarity networks
Project description
networker
Description
networker
is a python package for building and analysing protein similarity networks.
Installation
networker
can be installed with:
pip install networker
It has the following dependencies that will be installed automatically:
- numpy
- pandas
- pyvis
It also uses DIAMOND, which must be installed seperatly.
Usage
networker
will take an input file and produce an interactive network. It can take either a fasta amino acid file (.faa) or a tab seperated values file (.tsv) as input.
Usage Case 1: Create a protein network from a fasta file
The simplest method for using networker
is to provide a .faa file. This can be done as follows:
networker --faa file.faa
This will produce a diamond database (file.dmnd) and run a BLAST search to produce file.tsv. It will then use these results to produce a similarity network (file.html). Given that no threshold was provided, it will also automatically calculate an appropriate identity threshold. See the next case for examples of using a custom threshold.
Usage Case 2: Creat a protein network from tab seperated values using a custom threshold
If a .tsv containing blastp results already exists, this can be used as input. It is important that the .tsv is in the correct format. It is creates specifcially from DIAMOND using the flag --outfmt 6 qseqid sseqid pident
. This reprisents a three column table consisting of: the query sequence id, the subject query id and the percentage identity.
If you do not want networker
to calculate a threshold, you can provide a custom threshold using the flag -th
or --threshold
. The threshold is contained as a float.
networker --tsv file.tsv --threshold 75.25
Usage Case 3: Print histogram and a list of nodes
To produce a histogram showing the cummulative number of edges versus identity threshold add the flag -hi
or --histogram
. This can aid in deciding suitable thresholds for your dataset. To print a list of nodes from the network add the flag -nl
or --node_list
.
Therefore:
networker --faa file.faa -hi -nl
will produce file.tsv, file.dmnd and file.html as above, but also the node list (file.txt) and the histogram (histogram_file.html).
Usage Case 4: Generate sub-networks form a list of nodes
You can also use networker
to produce individual networks and node lists for each subwork in a given network by providing a list of node names using the -n
or node
flag.
networker --tsv file.tsv -n node1 node2 node3 -nl
This will produce a network based on file.tsv (file.html), individual networks for each subnetwork containing the specified nodes (node1.hmtl, node2.hmtl and node3.hmtl) and, node lists for the individual nodes and the whole network (file.txt, node1.txt, node2.txt and node3.txt).
Usage Case 5: Custom Colouring of Nodes
Coming in version 0.3.0; work in progress.
Example Data
Example data and output can be found in the example_data folder. The file example.faa was used to generate the DIAMOND database and, subsequentally, the network ('example.html') and the node list ('example.txt').
To Do
- Enable custom coloring of nodes.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file networker-0.2.2-py3-none-any.whl
.
File metadata
- Download URL: networker-0.2.2-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa7732a6b082b53c2753a395af2e4e977d2fd855ea5e5996505a160337d31299 |
|
MD5 | bedd30b4bfd0d4af73a4696d50206546 |
|
BLAKE2b-256 | 8e4b7c08608a96a764ef269b2db897ff679a5d26d1d048ad694758abdd416cdf |