Skip to content

Commit

Permalink
Update .github files, README, pkgdown config, ran dev/04_update.R
Browse files Browse the repository at this point in the history
  • Loading branch information
lcolladotor committed May 7, 2023
1 parent af99b6f commit 9136079
Show file tree
Hide file tree
Showing 20 changed files with 411 additions and 212 deletions.
37 changes: 37 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 1,37 @@
---
name: Feature Request
about: Suggest an idea for this package
title: "[Feature Request] A short description of the feature"
labels: ''
assignees: ''
---

Please ask questions about how to use `megadepth` on the Bioconductor
Support Site at <https://support.bioconductor.org> using the appropriate tag(s)
including the one for this package.

**Note**. Update the issue title to summarize the feature request.

## Is the feature request related to a problem?

Please provide a clear and concise description of what the problem
is. Ex. I'm always frustrated when [...]

## Describe the solution

A clear and concise description of what you want to happen.

## Describe any alternatives considered

A clear and concise description of any alternative solutions or
features you've considered.

## Additional context

Add any other context about the feature request here. You may include web links
(e.g., from GitHub) to:

* raw code
* a commit
* code inside a commit
* code from an R package
85 changes: 51 additions & 34 deletions .github/ISSUE_TEMPLATE/issue_template.md
Original file line number Diff line number Diff line change
@@ -1,56 1,73 @@
---
name: Bug report or feature request
about: Describe a bug you've seen or make a case for a new feature
title: "[BUG] Your bug or feature request"
name: Bug Report
about: Describe the bug in detail
title: "[BUG] A short description of the bug"
labels: ''
assignees: ''
---

Please briefly describe your problem and what output you expect. If you have a question, please don't use this form. Instead, ask on <https://support.bioconductor.org/> using the appropriate tag(s) including one for this package.
Please ask questions about how to use `megadepth` on the
[Bioconductor Support Site](https://support.bioconductor.org) using the
appropriate tag(s) including the one for this package.

## Context
**Note**. Update the issue title to concisely describe the bug.

Provide some context for your bug report or feature request. This could be the:
## Describe the bug

* link to raw code, example: https://github.com/lcolladotor/osca_LIIGH_UNAM_2020/blob/master/00-template.Rmd#L24-L28
* link to a commit, example: https://github.com/lcolladotor/osca_LIIGH_UNAM_2020/commit/6aa30b22eda614d932c12997ba611ba582c435d7
* link to a line of code inside a commit, example: https://github.com/lcolladotor/osca_LIIGH_UNAM_2020/commit/6aa30b22eda614d932c12997ba611ba582c435d7#diff-e265269fe4f17929940e81341b92b116R17
* link to code from an R package, example: https://github.com/LieberInstitute/spatialLIBD/blob/master/R/run_app.R#L51-L55
Please provide a clear and concise description of what the bug is.

## Code
### Provide a minimally reproducible example (reprex)

Include the code you ran and comments
Provide a clear and concise description of the bug. It can be easily (but not
necessarily) illustrated with a minimally reproducible example using the
[`reprex` package](https://reprex.tidyverse.org/articles/learn-reprex.html).

```R
## prompt an error
stop('hola')
For tips on creating a reprex, see this
[StackOverflow link](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example).

## check the error trace
traceback()
```
## Expected behavior

## Small reproducible example
A clear and concise description of what you expected to happen.

If you copy the lines of code that lead to your error, you can then run [`reprex::reprex()`](https://reprex.tidyverse.org/reference/reprex.html) which will create a small website with code you can then easily copy-paste here in a way that will be easy to work with later on.
## R Session Information

```R
## prompt an error
stop('hola')
#> Error in eval(expr, envir, enclos): hola
Please report the output of either `sessionInfo()` or
`sessioninfo::session_info()` here.

<details>

## check the error trace
traceback()
#> No traceback available
```R
options(width = 120)
## insert session info here
# sessioninfo::session_info() ## provides GitHub, pandoc, and other details
# sessionInfo() ## base R function in case you don't want to install sessioninfo
```

</details>

## R session information
Indicate whether `BiocManager::valid()` returns `TRUE`.

Remember to include your full R session information.
- [ ] `BiocManager::valid()` is `TRUE`

```R
options(width = 120)
sessioninfo::session_info()
```
**Note**. To avoid potential issues with version mixing and reproducibility, do
not install packages from `GitHub`.

## Additional Context

Provide some additional context for the bug report. You may include web links
(e.g., from GitHub) to:

* raw code
* a commit
* code inside a commit
* code from an R package

## Is the package installed via bioconda?

We find that [bioconda](https://bioconda.github.io/) installations can often be
problematic due to the nature of the setup environment and potential for version
mixing.

The preferred method for installing Bioconductor software through `BiocManager`
and we do not support issues related to `bioconda` installations at this time.

The output of `sessioninfo::session_info()` includes relevant GitHub installation information and other details that are missed by `sessionInfo()`.
71 changes: 50 additions & 21 deletions .github/SUPPORT.md
Original file line number Diff line number Diff line change
@@ -1,35 1,64 @@
# Getting help with `megadepth`

Thanks for using `megadepth`!
Before filing an issue, there are a few places to explore and pieces to put together to make the process as smooth as possible.
Thank you for using `megadepth`!
Before filing an issue, there are few things you should know to make the process
as smooth as possible for both parties.

## Make a reprex

Start by making a minimal **repr**oducible **ex**ample using the [reprex](https://reprex.tidyverse.org/) package.
If you haven't heard of or used reprex before, you're in for a treat!
Seriously, reprex will make all of your R-question-asking endeavors easier (which is a pretty insane ROI for the five to ten minutes it'll take you to learn what it's all about).
For additional reprex pointers, check out the [Get help!](https://www.tidyverse.org/help/) section of the tidyverse site.
Start by making a minimally **repr**oducible **ex**ample, also known as a
'reprex'. You may use the [`reprex`](https://reprex.tidyverse.org/) R package to
create one, though it is not necessary but it does help. It will make all of
your R-question-asking endeavors easier. Learning
[how to use it](https://reprex.tidyverse.org/articles/learn-reprex.html) takes
about 5 to 10 minutes.

## Where to ask?
For more tips on how to make a minimally **repr**oducible **ex**ample, see this
[StackOverflow link](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example).

Armed with your reprex, the next step is to figure out [where to ask](https://www.tidyverse.org/help/#where-to-ask). See also the [Bioconductor help](http://bioconductor.org/help/) website.
## Where to post it?

* If it's a question: start with [community.rstudio.com](https://community.rstudio.com/), and/or StackOverflow. If this a Bioconductor-related question, please ask it at the [Bioconductor Support Website](https://support.bioconductor.org/) using the [appropriate package tag](https://support.bioconductor.org/t/megadepth) (the website will send an automatic email to the package authors). There are more people there to answer questions.
The [Bioconductor help](http://bioconductor.org/help/) web page gives an
overview of places that may help answer your question.

* If it's a bug: you're in the right place, [file an issue](https://github.com/LieberInstitute/megadepth/issues/new).
* Bioconductor software related questions, such as bug reports and feature
requests, should be addressed in the appropriate `Bioconductor/megadepth`
GitHub repository. Follow our bug report and feature request templates on
GitHub. If the package does not have a GitHub repository, see the next bullet
point.

* If you're not sure: let the community help you figure it out!
If your problem _is_ a bug or a feature request, you can easily return here and report it.
* Bioconductor software usage questions should be addressed in the
[Bioconductor Support Website](https://support.bioconductor.org/). Make sure
to use the
[appropriate package tag](https://support.bioconductor.org/tag/megadepth),
otherwise the package authors will not get a notification.

* General R questions can be posed at StackOverflow or at the
[RStudio Community](https://community.rstudio.com/) website especially if they
pertain to the `tidyverse` or the RStudio GUI or related products.

Before opening a new issue, be sure to [search issues and pull requests](https://github.com/LieberInstitute/megadepth/issues) to make sure the bug hasn't been reported and/or already fixed in the development version.
By default, the search will be pre-populated with `is:issue is:open`.
You can [edit the qualifiers](https://help.github.com/articles/searching-issues-and-pull-requests/) (e.g. `is:pr`, `is:closed`) as needed.
For example, you'd simply remove `is:open` to search _all_ issues in the repo, open or closed.
## Issues or Feature Requests

Before opening a new issue or feature request, be sure to
[search issues and pull requests](https://github.com/LieberInstitute/megadepth/issues)
to ensure that one does not already exist or has been implemented in the
development version.

**Note**. You can remove the `is:open` search term in the issues page to search
through open and closed issues. See
[this link to learn more](https://help.github.com/articles/searching-issues-and-pull-requests/)
about modifying the search.

## What happens next?

To be as efficient as possible, development of tidyverse packages tends to be very bursty, so you shouldn't worry if you don't get an immediate response.
Typically we don't look at a repo until a sufficient quantity of issues accumulates, then there’s a burst of intense activity as we focus our efforts.
That makes development more efficient because it avoids expensive context switching between problems, at the cost of taking longer to get back to you.
This process makes a good reprex particularly important because it might be multiple months between your initial report and when we start working on it.
If we can’t reproduce the bug, we can’t fix it!
Our Bioconductor maintainers are limited in resources but they do strive to be
as responsive as possible.

Please do not forget to tag the appropriate maintainer in the issue with their
GitHub username (e.g., @username).

In order to make it easy as possible for Bioconductor core developers to
remediate the issue. Provide an accurate, brief, and reproducible report
as outlined in the issue templates.

Thank you for trusting Bioconductor.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 31,7 @@ biocViews: Software, Coverage, DataImport, Transcriptomics, RNASeq,
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.1.1
RoxygenNote: 7.2.3
Suggests:
covr,
knitr,
Expand Down
11 changes: 6 additions & 5 deletions R/bam_to_bigwig.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 54,12 @@
#' )
#' bw_cov
#' }
bam_to_bigwig <- function(bam_file,
prefix = file.path(tempdir(), basename(bam_file)),
min_unique_qual = FALSE,
double_count = FALSE,
overwrite = FALSE) {
bam_to_bigwig <- function(
bam_file,
prefix = file.path(tempdir(), basename(bam_file)),
min_unique_qual = FALSE,
double_count = FALSE,
overwrite = FALSE) {
if (xfun::is_windows()) {
warning(
"Megadepth currently does not support creating bigWig files on ",
Expand Down
17 changes: 9 additions & 8 deletions R/bam_to_junctions.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 45,15 @@
#'
#' ## Path to the output file generated by bam_to_junctions()
#' example_jxs
bam_to_junctions <- function(bam_file,
prefix = file.path(tempdir(), basename(bam_file)),
all_junctions = TRUE,
junctions = FALSE,
long_reads = FALSE,
filter_in = 65535,
filter_out = 260,
overwrite = FALSE) {
bam_to_junctions <- function(
bam_file,
prefix = file.path(tempdir(), basename(bam_file)),
all_junctions = TRUE,
junctions = FALSE,
long_reads = FALSE,
filter_in = 65535,
filter_out = 260,
overwrite = FALSE) {
expected_ext <- c("all_jxs.tsv", "jxs.tsv")
if (!overwrite) prefix_exists(prefix, expected_ext)

Expand Down
9 changes: 5 additions & 4 deletions R/get_coverage.R
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 72,11 @@
#' )
#' }
get_coverage <-
function(bigwig_file,
op = c("sum", "mean", "max", "min"),
annotation,
prefix = file.path(tempdir(), "bw.mean")) {
function(
bigwig_file,
op = c("sum", "mean", "max", "min"),
annotation,
prefix = file.path(tempdir(), "bw.mean")) {
megadepth_shell2(
bigwig_file,
list(
Expand Down
5 changes: 3 additions & 2 deletions R/install.R
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 140,9 @@ install_megadepth_bin <- function(exec) {
}

# obtain possible locations of the megadepth executable
bin_paths <- function(dir = "Megadepth",
extra_path = getOption("megadepth.dir")) {
bin_paths <- function(
dir = "Megadepth",
extra_path = getOption("megadepth.dir")) {
if (xfun::is_windows()) {
path <- Sys.getenv("APPDATA", "")
path <- if (fs::dir_exists(path)) {
Expand Down
1 change: 0 additions & 1 deletion R/read_junction.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 33,6 @@
#'
#' all_jxs
read_junction_table <- function(tsv_file) {

# define the expected column names and types
if (grepl("all_jxs.tsv", tsv_file)) {
col_names <- c(
Expand Down
19 changes: 12 additions & 7 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 16,25 @@ knitr::opts_chunk$set(
# megadepth

<!-- badges: start -->
[![Lifecycle: maturing](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/#maturing)
[![BioC status](http://www.bioconductor.org/shields/build/release/bioc/megadepth.svg)](https://bioconductor.org/checkResults/release/bioc-LATEST/megadepth)
[![BioC dev status](http://www.bioconductor.org/shields/build/devel/bioc/megadepth.svg)](https://bioconductor.org/checkResults/devel/bioc-LATEST/megadepth)
[![Codecov test coverage](https://codecov.io/gh/LieberInstitute/megadepth/branch/master/graph/badge.svg)](https://codecov.io/gh/LieberInstitute/megadepth?branch=master)
[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)
[![Bioc release status](http://www.bioconductor.org/shields/build/release/bioc/megadepth.svg)](https://bioconductor.org/checkResults/release/bioc-LATEST/megadepth)
[![Bioc devel status](http://www.bioconductor.org/shields/build/devel/bioc/megadepth.svg)](https://bioconductor.org/checkResults/devel/bioc-LATEST/megadepth)
[![Bioc downloads rank](https://bioconductor.org/shields/downloads/release/megadepth.svg)](http://bioconductor.org/packages/stats/bioc/megadepth/)
[![Bioc support](https://bioconductor.org/shields/posts/megadepth.svg)](https://support.bioconductor.org/tag/megadepth)
[![Bioc history](https://bioconductor.org/shields/years-in-bioc/megadepth.svg)](https://bioconductor.org/packages/release/bioc/html/megadepth.html#since)
[![Bioc last commit](https://bioconductor.org/shields/lastcommit/devel/bioc/megadepth.svg)](http://bioconductor.org/checkResults/devel/bioc-LATEST/megadepth/)
[![Bioc dependencies](https://bioconductor.org/shields/dependencies/release/megadepth.svg)](https://bioconductor.org/packages/release/bioc/html/megadepth.html#since)
[![Codecov test coverage](https://codecov.io/gh/LieberInstitute/megadepth/branch/devel/graph/badge.svg)](https://codecov.io/gh/LieberInstitute/megadepth?branch=devel)
[![R build status](https://github.com/LieberInstitute/megadepth/workflows/R-CMD-check-bioc/badge.svg)](https://github.com/LieberInstitute/megadepth/actions)
[![Support site activity, last 6 months: tagged questions/avg. answers per question/avg. comments per question/accepted answers, or 0 if no tagged posts.](http://www.bioconductor.org/shields/posts/megadepth.svg)](https://support.bioconductor.org/t/megadepth/)
[![GitHub issues](https://img.shields.io/github/issues/LieberInstitute/megadepth)](https://github.com/LieberInstitute/megadepth/issues)
[![GitHub pulls](https://img.shields.io/github/issues-pr/LieberInstitute/megadepth)](https://github.com/LieberInstitute/megadepth/pulls)
<!-- badges: end -->

The goal of `megadepth` is to provide an R interface to the command line tool [Megadepth](https://github.com/ChristopherWilks/megadepth) for BigWig and BAM related utilities created by [Christopher Wilks](https://twitter.com/chrisnwilks). This R package enables **fast** processing of BigWig files on downstream packages such as [dasper](https://bioconductor.org/packages/dasper) and [recount3](https://bioconductor.org/packages/recount3). The [Megadepth](https://github.com/ChristopherWilks/megadepth) software also provides utilities for processing BAM files and extracting coverage information from them.

Here is an illustration on how fast `megadepth` is compared to other tools for processing local and remote BigWig files.

<a href="https://github.com/LieberInstitute/megadepth/tree/master/analysis"><img src="https://raw.githubusercontent.com/LieberInstitute/megadepth/master/analysis/md_rt_pybw_runtime.png" width="800px" ></a>
<a href="https://github.com/LieberInstitute/megadepth/tree/devel/analysis"><img src="https://raw.githubusercontent.com/LieberInstitute/megadepth/devel/analysis/md_rt_pybw_runtime.png" width="800px" ></a>

Throughout the documentation we use a capital `M` to refer to the software by Christopher Wilks and a lower case `m` to refer to this R/Bioconductor package.

Expand Down Expand Up @@ -81,7 86,7 @@ bw_cov

To make it easier to use, `megadepth` includes functions that simplify the number of arguments, read in the output files, and converts them into R/Bioconductor friendly objects, such as `get_coverage()` illustrated above.

We hope that you'll find `megadepth` and [Megadepth](https://github.com/ChristopherWilks/megadepth) useful for your work. If you are interested in checking how **fast** `megadepth` is, check out the [**speed analysis**](https://github.com/LieberInstitute/megadepth/tree/master/analysis) comparison against other tools. Note that the size of the files used and the number of genomic regions queried will affect the speed comparisons.
We hope that you'll find `megadepth` and [Megadepth](https://github.com/ChristopherWilks/megadepth) useful for your work. If you are interested in checking how **fast** `megadepth` is, check out the [**speed analysis**](https://github.com/LieberInstitute/megadepth/tree/devel/analysis) comparison against other tools. Note that the size of the files used and the number of genomic regions queried will affect the speed comparisons.

```{r "interface_options"}
## R-like interface
Expand Down
Loading

0 comments on commit 9136079

Please sign in to comment.