From b4562322998e07327e86cce09e8534754148ecdc Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 20 Dec 2024 19:23:26 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/genomicranges/GenomicRangesList.py | 82 +++++++++++++++++++++++--- 1 file changed, 73 insertions(+), 9 deletions(-) diff --git a/src/genomicranges/GenomicRangesList.py b/src/genomicranges/GenomicRangesList.py index 8e7f453..831ba80 100644 --- a/src/genomicranges/GenomicRangesList.py +++ b/src/genomicranges/GenomicRangesList.py @@ -97,20 +97,84 @@ class GenomicRangesList: .. code-block:: python a = GenomicRanges( - seqnames=["chr1", "chr2", "chr1", "chr3"], - ranges=IRanges([1, 3, 2, 4], [10, 30, 50, 60]), - strand=["-", "+", "*", "+"], - mcols=BiocFrame({"score": [1, 2, 3, 4]}), + seqnames=[ + "chr1", + "chr2", + "chr1", + "chr3", + ], + ranges=IRanges( + [ + 1, + 3, + 2, + 4, + ], + [ + 10, + 30, + 50, + 60, + ], + ), + strand=[ + "-", + "+", + "*", + "+", + ], + mcols=BiocFrame( + { + "score": [ + 1, + 2, + 3, + 4, + ] + } + ), ) b = GenomicRanges( - seqnames=["chr2", "chr4", "chr5"], - ranges=IRanges([3, 6, 4], [30, 50, 60]), - strand=["-", "+", "*"], - mcols=BiocFrame({"score": [2, 3, 4]}), + seqnames=[ + "chr2", + "chr4", + "chr5", + ], + ranges=IRanges( + [3, 6, 4], + [ + 30, + 50, + 60, + ], + ), + strand=[ + "-", + "+", + "*", + ], + mcols=BiocFrame( + { + "score": [ + 2, + 3, + 4, + ] + } + ), ) - grl = GenomicRangesList(ranges=[gr1, gr2], names=["gene1", "gene2"]) + grl = GenomicRangesList( + ranges=[ + gr1, + gr2, + ], + names=[ + "gene1", + "gene2", + ], + ) Additionally, you may also provide metadata about the genomic elements in the dictionary using mcols attribute.