Skip to content

Commit

Permalink
folding a few code blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
jkanche committed Jan 13, 2024
1 parent f951cd9 commit ddbbbb2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
5 changes: 3 additions & 2 deletions chapters/experiments/summarized_expt.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ These methods enable the merging or combining of multiple `SummarizedExperiment`
```{python}
#| code-fold: true
#| code-summary: "Show the code"
rowData1 = pd.DataFrame(
{
"seqnames": ["chr_5", "chr_3", "chr_2"],
Expand Down Expand Up @@ -362,5 +363,5 @@ print(empty_rse)

## Further reading

- Check out reference [documentation](https://biocpy.github.io/SummarizedExperiment/index.html)
- R/Bioconductor [SummarizedExperiment](https://bioconductor.org/packages/release/bioc/html/SummarizedExperiment.html) package
- Check out reference [documentation](https://biocpy.github.io/SummarizedExperiment/index.html) for more details.
- R/Bioconductor's [SummarizedExperiment](https://bioconductor.org/packages/release/bioc/html/SummarizedExperiment.html) package.
10 changes: 7 additions & 3 deletions chapters/representations/genomicranges.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,9 @@ print(disjoin_gr)
- **setdiff**: Compute `set difference`.

```{python}
#| code-fold: true
#| code-summary: "Show the code"
g_src = GenomicRanges(
seqnames = ["chr1", "chr2", "chr1", "chr3", "chr2"],
ranges = IRanges(start =[101, 102, 103, 104, 109], width=[112, 103, 128, 134, 111]),
Expand Down Expand Up @@ -360,9 +363,8 @@ Not the prettiest plot but it works.
Compute binned average for a set of query **bins**:

```{python}
bins = pd.DataFrame({"seqnames": ["chr1"], "starts": [101], "ends": [109],})
bins_gr = GenomicRanges.from_pandas(bins)
from iranges import IRanges
bins_gr = GenomicRanges(seqnames=["chr1"], ranges=IRanges([101], [109]))
subject = GenomicRanges(
seqnames= ["chr1","chr2","chr2","chr2","chr1","chr1","chr3","chr3","chr3","chr3"],
Expand Down Expand Up @@ -538,6 +540,7 @@ print("rank:", rank)
Use the `combine` generic from [biocutils](https://github.com/BiocPy/generics) to concatenate multiple `GenomicRanges` objects.

```{python}
from biocutils.combine import combine
a = GenomicRanges(
seqnames=["chr1", "chr2", "chr1", "chr3"],
Expand Down Expand Up @@ -583,6 +586,7 @@ Currently, this class is limited in functionality, purely a read-only class with
***Note: This is a work in progress and the functionality is limited.***

```{python}
from genomicranges import GenomicRangesList
a = GenomicRanges(
seqnames=["chr1", "chr2", "chr1", "chr3"],
Expand Down

0 comments on commit ddbbbb2

Please sign in to comment.