-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added docs features * refactored pairwise aligner * refactored pairwise alignment * added docstrings, refactored alinger integration * added threads to os.cpu_count() * refactored alignment * modified imports * tested alignments and networks * moved test notebooks * removed old example * added network visualization in 2D and 3D * import * added network documentation
- Loading branch information
Showing
27 changed files
with
15,672 additions
and
3,158 deletions.
There are no files selected for viewing
Empty file.
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Setup a Local BLAST Database | ||
|
||
This tutorial will guide you through the process of setting up a local BLAST database. This is useful if you have a large number of sequences that you need to search against, or if you want to search against a custom database. | ||
|
||
1. Hi | ||
2. Hello |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
hide: | ||
- navigation | ||
- footer | ||
--- | ||
|
||
# Quick Start | ||
|
||
<div class="grid cards" markdown> | ||
|
||
- :material-walk: __[Basics]__ – How to work with sequence data | ||
- :octicons-search-16: __[Search Sequences]__ – How to search for individual sequences or search using BLAST | ||
- :fontawesome-solid-align-justify: __[Alignments]__ – How to make different alignments | ||
- :material-dots-grid: __[Networks]__ – How to construct sequence networks | ||
|
||
</div> | ||
[Basics]: basics.md | ||
[Search Sequences]: blast.md | ||
[Alignments]: alignments.md | ||
[Networks]: networks.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
# Creating Sequence Networks | ||
|
||
A `SequenceNetwork` is created using a list of `PairwiseAlignment` objects, and a list of `AbstractSequences`. Additionally, the way the network is constructed is influenced by the `weight` and `threshold` attributes. The `weight` determines which attribute of the `PairwiseAlignment` object is used to calculate the distance between the sequences of the network. The `threshold` determines the minimum value of the `weight` attribute for an edge to be created. Furthermore, a `color` can be determined based on the attributes of an `AbstractSequence` object in which the nodes of the network will be colored. | ||
|
||
## Visualization | ||
|
||
=== "2D" | ||
|
||
```py | ||
from pyeed.core import ProteinInfo, Alignment | ||
from pyeed.aligners import PairwiseAligner | ||
from pyeed.network import SequenceNetwork | ||
|
||
# Accessions from different methionine adenyltransferases | ||
mat_accessions = [ | ||
"MBP1912539.1", | ||
"SEV92896.1", | ||
"MBO8174569.1", | ||
"WP_042680787.1", | ||
"NPA47376.1", | ||
"WP_167889085.1", | ||
"WP_048165429.1", | ||
"ACS90033.1", | ||
] | ||
mats = ProteinInfo.from_ncbi(mat_accessions) | ||
|
||
# Create pairwise alignments between all sequences | ||
alignments = Alignment.from_sequences(mats, aligner=PairwiseAligner) | ||
|
||
# Create a network | ||
network = SequenceNetwork( | ||
sequences=mats, | ||
pairwise_alignments=alignments, | ||
weight="identity", | ||
threshold=0.9, | ||
dimensions=2, | ||
color="taxonomy_id", | ||
) | ||
|
||
# Visualize the network | ||
network.visualize() | ||
``` | ||
|
||
=== "3D" | ||
|
||
```py | ||
from pyeed.core import ProteinInfo, Alignment | ||
from pyeed.aligners import PairwiseAligner | ||
from pyeed.network import SequenceNetwork | ||
|
||
# Accessions from different methionine adenyltransferases | ||
mat_accessions = [ | ||
"MBP1912539.1", | ||
"SEV92896.1", | ||
"MBO8174569.1", | ||
"WP_042680787.1", | ||
"NPA47376.1", | ||
"WP_167889085.1", | ||
"WP_048165429.1", | ||
"ACS90033.1", | ||
] | ||
mats = ProteinInfo.from_ncbi(mat_accessions) | ||
|
||
# Create pairwise alignments between all sequences | ||
alignments = Alignment.from_sequences(mats, aligner=PairwiseAligner) | ||
|
||
# Create a network | ||
network = SequenceNetwork( | ||
sequences=mats, | ||
pairwise_alignments=alignments, | ||
weight="identity", | ||
threshold=0.9, | ||
dimensions=3, | ||
color="taxonomy_id", | ||
) | ||
|
||
# Visualize the network | ||
network.visualize() | ||
``` | ||
|
||
## Network Analysis | ||
|
||
Upon the `SequenceNetwork` is instantiated the `graph` property is created. This property is a `networkx` graph object that can be used to perform network analysis. For example, the `degree()` method can be used to calculate the degree of each node in the network. |
Oops, something went wrong.