Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset pydanticv2 changes #44

Merged
merged 13 commits into from
Feb 23, 2024
Empty file removed docs/examples/networks.md
Empty file.
Empty file removed docs/examples/setup_local_blast.md
Empty file.
5 changes: 0 additions & 5 deletions docs/installation/docker.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
icon: simple/python
---

# Installation via `pip`

PyEED can be installed from Github via pip.
Expand All @@ -13,3 +9,7 @@ Alternatively, you can install the latest stable release from PyPI.
```bash
```



# Installation with Docker

6 changes: 6 additions & 0 deletions docs/installation/setup_local_blast.md
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
11 changes: 9 additions & 2 deletions docs/examples/alignments.md → docs/quick_start/alignments.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,20 @@ alignment = Alignment.from_sequences(list_of_sequences)
tem109 = ProteinInfo.from_ncbi("AAT46413.1")

# Create and run alignment
alignment = PairwiseAlignment([tem1, tem109], aligner=PairwiseAligner)
alignment = PairwiseAlignment([tem1, tem109], aligner=PairwiseAligner, mode="local")
```

=== "Global Alignment"
``` py
from pyeed.core import ProteinInfo, PairwiseAlignment
from pyeed.aligners import NeedlemanWunsch
from pyeed.aligners import PairwiseAligner

# Get two ProteinInfo objects
tem1 = ProteinInfo.from_ncbi("QGC48744.1")
tem109 = ProteinInfo.from_ncbi("AAT46413.1")

# Create and run alignment
alignment = PairwiseAlignment([tem1, tem109], aligner=PairwiseAligner, mode="global")
```


Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 20 additions & 0 deletions docs/quick_start/index.md
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
83 changes: 83 additions & 0 deletions docs/quick_start/networks.md
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.
Loading
Loading