From 603c962a67e95dc90c586424df53aae3469d4ef3 Mon Sep 17 00:00:00 2001 From: Tharos Date: Wed, 29 Nov 2023 10:44:13 +0100 Subject: [PATCH] readme and docstrings --- README.md | 31 +++++++++++++++++++++---------- pgGraphs/gfaparser.py | 2 +- pgGraphs/networkx.py | 1 + test_pggraphs.py | 3 +++ 4 files changed, 26 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index a8dfdc3..1419703 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,28 @@ [![](https://img.shields.io/badge/Python-3.10-blue.svg)]() -[![](https://img.shields.io/badge/Documentation-unfinished-orange.svg)]() -[![](https://img.shields.io/badge/build-passing-green.svg)]() +[![](https://img.shields.io/badge/Python-3.11-blue.svg)]() +[![](https://img.shields.io/badge/Python-3.12-blue.svg)]() +[![](https://img.shields.io/badge/documentation-unfinished-orange.svg)]() -# GFAgraphs +# GFAGraphs - A Python GFA library -This package aims to be an abstraction layer for GFA file format. +This Python library aims to be an abstraction layer for GFA file format. +Two implementations are proposed: ++ a legacy one, which will remain until deprecated, in `gfagraphs/` ++ a new, cleaner and faster implementation, in `pgGraphs/` -Its a simple, convinient but lack-luster library to extract informations from GFA files, be it as the graph or line level. +> [!WARNING]\ +> Moving forward, features will only be added to `pgGraphs`, while `gfagraphs` will remain as it, until full migration is done in [pancat](https://github.com/Tharos-ux/pancat) tool. -Main features are : -+ **Record** (line-level) and **Graph** (file-level) abstractions -+ Full decoding of **GFA tags** (standard+optional) -+ **pip**-installable (`pip install gfagraphs`) -+ **networkx** integration +## Package pgGraphs +![](https://media.discordapp.net/attachments/874430800802754623/1179353568105467964/library.png) + +The package is organized in 4 modules: ++ `pgGraphs.abstractions` contains abstractions over GFA formats ++ `pgGraphs.gfaparser` contains an abstract class for parsing and saving GFA file format ++ `pgGraphs.graph` contains the main `Graph` class that represents a GFA graph in memory, and edit functions ++ `pgGraphs.networkx` conains an abstract class for visualization and modelization of GFA in a NetworkX object + +> [!NOTE]\ +> Want to contribute? Feel free to open a PR on an issue about a missing, buggy or incomplete feature! diff --git a/pgGraphs/gfaparser.py b/pgGraphs/gfaparser.py index 178222c..fa753fe 100644 --- a/pgGraphs/gfaparser.py +++ b/pgGraphs/gfaparser.py @@ -1,4 +1,4 @@ -"" +"Abstract class for parsing and saving GFA file format" from re import match, sub from typing import Callable from json import loads, dumps diff --git a/pgGraphs/networkx.py b/pgGraphs/networkx.py index a5a0361..74c5dca 100644 --- a/pgGraphs/networkx.py +++ b/pgGraphs/networkx.py @@ -1,3 +1,4 @@ +"Abstract class for visualization and modelization of GFA in a NetworkX object" from networkx import MultiDiGraph, DiGraph from pgGraphs.graph import Graph from tharospytools.matplotlib_tools import get_palette diff --git a/test_pggraphs.py b/test_pggraphs.py index 87fe8e1..659607d 100644 --- a/test_pggraphs.py +++ b/test_pggraphs.py @@ -2,4 +2,7 @@ def test_init_empty_graph() -> None: + """ + Tests the initialization of an empty graph + """ graph: Graph = Graph()