From 116be0af3dd8a72de58e69d6956b707cd015ab48 Mon Sep 17 00:00:00 2001 From: Kevin Rue-Albrecht Date: Wed, 15 May 2024 12:37:49 +0100 Subject: [PATCH 1/4] fix typo --- episodes/07-genomic-ranges.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/episodes/07-genomic-ranges.Rmd b/episodes/07-genomic-ranges.Rmd index 445f6d48..da630908 100644 --- a/episodes/07-genomic-ranges.Rmd +++ b/episodes/07-genomic-ranges.Rmd @@ -411,7 +411,7 @@ demo_granges2 <- GRanges( demo_granges2 ``` -Finally, the examples above also demonstrate that `GRanges` objects include a +Finally, the example above also demonstrate that `GRanges` objects include a component called `seqinfo`, which is occasionally used to store information about each sequence that may be represented in the `seqnames` component. In the latest example above, we have not provide any information about any From 48e8d443ae65dd7557b41597bd953c2f9cd984c2 Mon Sep 17 00:00:00 2001 From: Kevin Rue-Albrecht Date: Wed, 15 May 2024 12:38:30 +0100 Subject: [PATCH 2/4] rephrase --- episodes/07-genomic-ranges.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/episodes/07-genomic-ranges.Rmd b/episodes/07-genomic-ranges.Rmd index da630908..7f8590c5 100644 --- a/episodes/07-genomic-ranges.Rmd +++ b/episodes/07-genomic-ranges.Rmd @@ -412,7 +412,7 @@ demo_granges2 ``` Finally, the example above also demonstrate that `GRanges` objects include a -component called `seqinfo`, which is occasionally used to store information +component called `seqinfo`, which can be used to store information about each sequence that may be represented in the `seqnames` component. In the latest example above, we have not provide any information about any sequence. From 1fb55b8929a06b91b0d6359a5a1d1535316a8a50 Mon Sep 17 00:00:00 2001 From: Kevin Rue-Albrecht Date: Wed, 15 May 2024 12:46:23 +0100 Subject: [PATCH 3/4] mention getter functions --- episodes/07-genomic-ranges.Rmd | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/episodes/07-genomic-ranges.Rmd b/episodes/07-genomic-ranges.Rmd index 7f8590c5..23d51dd4 100644 --- a/episodes/07-genomic-ranges.Rmd +++ b/episodes/07-genomic-ranges.Rmd @@ -442,6 +442,25 @@ seqinfo(demo_granges2) <- Seqinfo( demo_granges2 ``` +The start and end positions of the individual ranges as well as the width of +every interval can be extracted as numeric vector using the functions `start()`, +`end()` and `width()`, respectively. + +```{r} +start(demo_granges2) +end(demo_granges2) +width(demo_granges2) +``` + +The sequence names and strand information can be extracted using the functions +`seqnames()` and `strand()`, respectively. + +```{r} +seqnames(demo_granges2) +strand(demo_granges2) +``` + + ### Metadata on GRanges Similarly to `IRanges`, metadata can be passed directly to the `GRanges` From 1243c0f34cc4ba1a72ac68c5bf1049e416787385 Mon Sep 17 00:00:00 2001 From: Kevin Rue-Albrecht Date: Wed, 15 May 2024 13:40:44 +0100 Subject: [PATCH 4/4] update challenge --- episodes/07-genomic-ranges.Rmd | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/episodes/07-genomic-ranges.Rmd b/episodes/07-genomic-ranges.Rmd index 23d51dd4..eb9b6dca 100644 --- a/episodes/07-genomic-ranges.Rmd +++ b/episodes/07-genomic-ranges.Rmd @@ -460,7 +460,6 @@ seqnames(demo_granges2) strand(demo_granges2) ``` - ### Metadata on GRanges Similarly to `IRanges`, metadata can be passed directly to the `GRanges` @@ -602,10 +601,13 @@ lengths(actb_exons_by_transcript) Importantly, the function `lengths()` (with a final `s`) demonstrated above is different from the function `length()` (without `s`). -The former is meant to be used on list objects, while the latter is meant -to be used on vectors. +The former is meant to be used on list objects, returning a vector giving the +length of each element in the list; while the latter returns a single numeric +scalar giving the length of the list itself (i.e., the number of elements +in the list). -What does `length(actb_exons_by_transcript)` return, and why? +What does `length(actb_exons_by_transcript)` return, and what does this +number represent biologically? ::::::::::::::: solution