Skip to content

Converting IntroToAnnotationDbi.Rnw to Rmarkdown #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: devel
Choose a base branch
from

Conversation

BerylKanali
Copy link

@jwokaty
Here is a draft pull request.
The issue is, I need help to figure out what library or a way I can use to automatically section the exercise and solution bit (line 186- 280) like it was done in the Rnw file using the Theorem package:

%% Question, Exercise, Solution
\usepackage{theorem}
\theoremstyle{break}
\newtheorem{Ext}{Exercise}
\newtheorem{Question}{Question}

\newenvironment{Exercise}{
  \renewcommand{\labelenumi}{\alph{enumi}.}\begin{Ext}%
}{\end{Ext}}
\newenvironment{Solution}{%
  \noindent\textbf{Solution:}\renewcommand{\labelenumi}{\alph{enumi}.}%
}{\bigskip}

If not, I can do it manually.
PDF file
HTML file so far

Note: Replaced the dataTypes pdf image file to png for better output.

@jwokaty
Copy link
Contributor

jwokaty commented Feb 17, 2023

AFAIK there's no automatic way to convert these and I don't think there is an equivalent in R Markdown. It is possible to mock this up in HTML just using R Markdown to make it look similar to the PDF manually then remove the section, like the one above, since it would no longer be used.

@LiNk-NY
Copy link
Contributor

LiNk-NY commented Feb 17, 2023

You can create a <details> html tag in the vignette to hide or show the solution, e.g.,

<details> Solution <summary> Here is the solution </summary>
## R code chunk of the solution
</details>

There is also the learnr package for shiny documents but the infrastructure is more involved and it requires a shiny dependency.

@BerylKanali BerylKanali marked this pull request as ready for review March 2, 2023 12:01
@BerylKanali
Copy link
Author

@jwokaty
Added some commits here and switched it from draft to ready for review.
Updated HTML

@sonali8434
Copy link

sonali8434 commented Jun 19, 2023

Hello @BerylKanali, I am going to review your PR. We will be using this checklist to review it.

  • the .Rmd file knits to HTML
  • R CMD build runs without errors or timeouts
  • the tarball from R CMD build contains the HTML (check with the
    following by substituting the package name and vignette name tar ztf package_name.tar.gz | grep 'doc/vignette_name')
  • the .Rnw file has been removed
  • In the DESCRIPTION file
    • BiocStyle and knitr are listed in Suggests
    • the line VignetteBuilder: knitr exists
    • any added lines use the same spacing and indents as the existing document
  • If agreed with the Maintainer
    • the contributor is in the author list in the DESCRIPTION file*.
    • the contributor is in the author list in the vignette's YAML*.
  • If this pull request involves converting from separate Author and Maintainer
    lines to the Authors@R vector, please ensure that
    • the Authors@R vector includes the maintainer as specified with role='cre'.
    • the Maintainer line is completely removed.
  • HTML document is representative of the PDF in content and
    in general the presentation
  • Where the contributor was not able to preserve the content and presentation
    of the PDF is noted as a comment in the pull request
  • the R Markdown file is representative of the Sweave document and follows
    best practices, such as replacing links to Bioconductor packages with calls
    to BiocStyle's Biocpkg()
  • Only files necessary for the conversion are included in the pull request.
  • Long lines have been broken up and reformatted, you can achieve this by
    selecting the text in your script and then clicking on Code > Reflow Comment
    in R Studio.
  • Code blocks are surrounded by a blank line, and there are no blank lines
    before the start or after the end of the code within the code block.
  • Refer to the contribution guide for acceptable formats

Copy link

@sonali8434 sonali8434 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @BerylKanali Thanks for your PR, during the review process I noticed that there are many instances where we need a space between two words please correct the instances like these and let me know I will continue the review process.

@BerylKanali
Copy link
Author

Hi @sonali8434 I made the changes, here is the updated HTML file.

Copy link

@sonali8434 sonali8434 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @BerylKanali Thank you for the changes I have completed the review Please do these modifications after that this PR will be ready for the final review.

I noticed that you have not italicized the objects in many instances please correct that rest everything looks good.

BerylKanali and others added 3 commits July 20, 2023 09:28
Merge branch 'AnnotationDbi-Rmd' of https://github.com/BerylKanali/AnnotationDbi into AnnotationDbi-Rmd
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
@BerylKanali
Copy link
Author

BerylKanali commented Jul 20, 2023

@sonali8434 Thank you for your review, I have made the changes. Here is the updated HTML file.

@sonali8434
Copy link

Hello, @BerylKanali Thank you so much for the quick edits; just two small changes then it will be ready for @jwokaty.

@sonali8434
Copy link

sonali8434 commented Jul 20, 2023

Hello @jwokaty, The review of this file is complete. You can do a final review after these two changes are addressed.
I have checked R CMD build and HTML in the tarball

Thank you!!

Copy link
Contributor

@jwokaty jwokaty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BerylKanali There are a few more changes. Mostly changes to remove Biocpkg() from things aren't packages. The easiest way to always check is to click on the link of the generated html. There were also 2 package names in the original that weren't correct, preventing the link from being generated properly. We'll be able to merge after these corrections.

The exercise-solution sections look good. Thanks for your work on this!


- Organism level: e.g. `r Biocpkg("org.Mm.eg.db")`.
- Platform level: e.g. `r Biocpkg("hgu133plus2.db")`,
`r Biocpkg("hgu133plus2.probes")`, `r Biocpkg("hgu133plus2.cdf")`
Copy link
Contributor

@jwokaty jwokaty Jul 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe these were renamed or misspelled in the original document? Biocpkg can't make links for these, but I did find packages hgu133plus2probe and hgu133plus2cdf. Could you update line 37 with these?


# ChipDb objects and the select method

An extremely common kind of `r Biocpkg("Annotation")` package is the so called
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the writer is speaking generally about Annotation packages but not a specific package named Annotation. Remove

`r Biockpg("")`

(e.g. Entrez Gene id) and contains mappings between this identifier and other
kinds of identifiers (e.g. GenBank or Uniprot accession number, RefSeq id,
etc.). The name of an org package is always of the form org.\<Ab>\.\<id>\.db
(e.g.`r Biocpkg("org.Sc.sgd.db")`where \<Ab>\ is a 2-letter abbreviation of the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a closing parenthesis and space between the last backtick and where so that we have

(e.g.`r Biocpkg("org.Sc.sgd.db")`) where

Comment on lines +182 to +183
`r Biocpkg("sgd")` for gene identifiers assigned by the Saccharomyces Genome
Database, or `r Biocpkg("eg")` for Entrez Gene ids).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sgd and eg are not packages. Remove

`r Biocpkg("")`

kinds of identifiers (e.g. GenBank or Uniprot accession number, RefSeq id,
etc.). The name of an org package is always of the form org.\<Ab>\.\<id>\.db
(e.g.`r Biocpkg("org.Sc.sgd.db")`where \<Ab>\ is a 2-letter abbreviation of the
organism (e.g.`r Biocpkg("Sc")` for *Saccharomyces cerevisiae*) and \<id>\ is an
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sc is not a package. Remove

`r Biocpkg("")`


# Using select with TxDb packages

A `r Biocpkg("TxDb")` package (a 'TxDb' package) connects a set of genomic
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TxDb is not a package, but a type of package. Remove

`r Biocpkg("")`

- name: "Marc Carlson"
- name: "Beryl Kanali"
affiliation: "Converted vignette from Sweave to Rmarkdown"
date: "Last modified: November 2022; Compiled: `r format(Sys.time(), '%B %d , %Y')`"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove Last modified: November 2022; Compiled: . I don't know where the November 2022 date comes from.


# Using select with GO.db

When you load the ` r Biocpkg("GO.db")` package, a *GODb* object is also loaded.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the space after the first backtick (otherwise it doesn't render the link properly).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: PR Changes Requested
Development

Successfully merging this pull request may close these issues.

4 participants