-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #127 from neherlab/refine-docs
Refine docs
- Loading branch information
Showing
17 changed files
with
132 additions
and
60 deletions.
There are no files selected for viewing
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
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,43 @@ | ||
--- | ||
sidebar_position: 1 | ||
--- | ||
|
||
# About PyPangraph | ||
|
||
PyPanGraph is a Python package to facilitate exploration and analysis of [PanGraph](https://github.com/neherlab/pangraph) output JSON files. | ||
|
||
PyPangraph can be installed following [these instructions](installation.md). | ||
|
||
Below you'll find some simple usage of PyPangraph. For a more complete guide you can follow the [tutorials](t01-load-graph.md). | ||
|
||
```python | ||
import pypangraph as pp | ||
|
||
# load a graph | ||
graph = pp.Pangraph.load_graph("graph.json") | ||
# pangraph object with 15 paths, 137 blocks and 1042 nodes | ||
|
||
# recover a specific path with its identifier | ||
path = graph.paths["RCS48_p1"] | ||
# path object | name = RCS48_p1, n. nodes = 60, length = 80596 bp | ||
|
||
# extract a block alignment | ||
block = graph.blocks[124231456905500231] | ||
# block 124231456905500231, consensus len = 183 bp, n. nodes = 4 | ||
|
||
aln = block.to_biopython_alignment() | ||
# Alignment with 15 rows and 2932 columns | ||
# TTCTGCAATTGAGTCTTGTATGCCCCCATAACAGCACTAAATAA... | ||
# TTCTGTAATTGAGTCTTGTATGCCCCCATAACAGCACTAAATAA... | ||
# TTCTGTAATTGAGTCTTGTATGCCCCCATAACAGCACTAAATAA... | ||
# TTCTGCAATTGAGTCTTGTATGCCCCCATAACAGCACTAAATAA... | ||
# ... | ||
|
||
# get blocks statistics (length, copy number...) | ||
stats_df = graph.to_blockstats_df() | ||
# block_id count n_strains duplicated core len | ||
# 124231456905500231 15 15 False True 2202 | ||
# 149501466629434994 2 2 False False 210 | ||
# 279570196774736738 2 2 False False 1308 | ||
# ... ... ... ... ... ... | ||
``` |
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
2 changes: 1 addition & 1 deletion
2
docs/docs/pypangraph/tutorial2.md → docs/docs/pypangraph/t02-pangenome.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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
sidebar_position: 2 | ||
sidebar_position: 4 | ||
--- | ||
|
||
# A look at the pangenome | ||
|
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
4 changes: 2 additions & 2 deletions
4
docs/docs/pypangraph/tutorial5.md → docs/docs/pypangraph/t05-dotplot.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
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
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
Oops, something went wrong.