Skip to content

fix: various issues to comply with CRAN submission #42

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

Merged
merged 3 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Authors@R: c(
person("Michael", "Jahn", , "jahn@mpusp.mpg.de", role = c("aut", "cph"),
comment = c(ORCID = "0000-0002-3913-153X"))
)
Maintainer: Michael Jahn <jahn@mpusp.mpg.de>
Maintainer: Yabing Song <songyb0519@gmail.com>
Description: The goal of `ggcoverage` is to visualize coverage tracks from
genomics, transcriptomics or proteomics data. It contains functions to
load data from BAM, BigWig, BedGraph, txt, or xlsx files, create
Expand Down
2 changes: 1 addition & 1 deletion R/FormatInput.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ GetRegion <- function(df, chr, start, end = NULL) {
#'
#' @param data Track dataframe loaded by \code{\link{LoadTrackFile}}.
#' @param region Region used to create coverage plot, eg: chr14:21,677,306-21,737,601 or chr14:21,677,306.
#' @param gtf.gr Granges object of GTF, created with \code{\link{import.gff}}. Default: NULL.
#' @param gtf.gr Granges object of GTF, created with \code{\link[rtracklayer]{import.gff}}. Default: NULL.
#' @param gene.name The name of gene. Default: HNRNPC.
#' @param gene.name.type Gene name type (filed of \code{gtf.gr}), chosen from gene_name and gene_id.
#' Default: gene_name.
Expand Down
2 changes: 1 addition & 1 deletion R/LoadTrack.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#' @param region Region to extract coverage for, eg: chr14:21,677,306-21,737,601 or chr14:21,677,306.
#' Default: NULL, coverage is extracted from the first annotated chromosome/sequence.
#' @param extend Extend length of \code{region}. Default: 2000.
#' @param gtf.gr Granges object of GTF, created with \code{\link{import.gff}}. Default: NULL.
#' @param gtf.gr Granges object of GTF, created with \code{\link[rtracklayer]{import.gff}}. Default: NULL.
#' @param gene.name The name of gene. Default: HNRNPC.
#' @param gene.name.type Gene name type (filed of \code{gtf.gr}), chosen from gene_name and gene_id.
#' Default: gene_name.
Expand Down
8 changes: 4 additions & 4 deletions R/geom_base.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
#' @param star.size The size of star when \code{mark.type} is star. Default: 1.
#' @param show.aa Logical value, whether to show amino acid. Default: TRUE.
#' @param sens Sense to translate: F for forward sense and R for reverse sense.
#' Parameter of \code{\link{translate}}. Default: F.
#' Parameter of \code{\link[Biostrings]{translate}}. Default: F.
#' @param numcode The ncbi genetic code number for translation.
#' Parameter of \code{\link{translate}}. By default the standard genetic code is used.
#' Parameter of \code{\link[Biostrings]{translate}}. By default the standard genetic code is used.
#' @param NAstring How to translate amino-acids when there are ambiguous bases in codons.
#' Parameter of \code{\link{translate}}. Default: X.
#' Parameter of \code{\link[Biostrings]{translate}}. Default: X.
#' @param ambiguous If TRUE, ambiguous bases are taken into account so that for instance GGN is
#' translated to Gly in the standard genetic code. Parameter of \code{\link{translate}}. Default: FALSE.
#' translated to Gly in the standard genetic code. Parameter of \code{\link[Biostrings]{translate}}. Default: FALSE.
#' @param aa.color Color scheme for amino acids.
#' @param aa.border.color The border color of amino acid. Default: white.
#' @param aa.size The size of amino acid text. Default: 4.
Expand Down
2 changes: 1 addition & 1 deletion R/geom_gene.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' Add Gene Annotation to Coverage Plot.
#'
#' @param gtf.gr Granges object of GTF, created with \code{\link{import.gff}}.
#' @param gtf.gr Granges object of GTF, created with \code{\link[rtracklayer]{import.gff}}.
#' Default: NULL.
#' @param overlap.gene.gap The gap between gene groups. Default: 0.1.
#' @param overlap.style The style of gene groups, choose from loose (each gene
Expand Down
2 changes: 1 addition & 1 deletion R/geom_transcript.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' Add Transcript Annotation to Coverage Plot.
#'
#' @param gtf.gr Granges object of GTF, created with \code{\link{import.gff}}.
#' @param gtf.gr Granges object of GTF, created with \code{\link[rtracklayer]{import.gff}}.
#' Default: NULL.
#' @param gene.name Gene name of all transcripts. Default: HNRNPC.
#' @param overlap.tx.gap The gap between transcript groups. Default: 0.1.
Expand Down
6 changes: 3 additions & 3 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ graphics::mtext(
graphics::par(opar)
```

Default color scheme for amino acid annotation is from [Residual colours: a proposal for aminochromography](https://academic.oup.com/peds/article/10/7/743/1593029?login=false):
Default color scheme for amino acid annotation is from [Residual colours: a proposal for aminochromography](https://pubmed.ncbi.nlm.nih.gov/9342138/):

```{r aa_color_scheme, warning = FALSE, fig.height = 9, fig.width = 10, fig.align = "center"}
aa_color <- c(
Expand Down Expand Up @@ -678,7 +678,7 @@ The Hi-C method maps chromosome contacts in eukaryotic cells.
For this purpose, DNA and protein complexes are cross-linked and DNA fragments then purified.
As a result, even distant chromatin fragments can be found to interact due to the spatial organization of the DNA and histones in the cell. Hi-C data shows these interactions for example as a contact map.

The Hi-C data is taken from [pyGenomeTracks: reproducible plots for multivariate genomic datasets](https://academic.oup.com/bioinformatics/article/37/3/422/5879987?login=false).
The Hi-C data is taken from [pyGenomeTracks: reproducible plots for multivariate genomic datasets](https://pubmed.ncbi.nlm.nih.gov/32745185/).

The Hi-C matrix visualization is implemented by [`HiCBricks`](https://github.com/koustav-pal/HiCBricks).
This package needs to be installed separately (it is only 'Suggested' by `ggcoverage`).
Expand Down Expand Up @@ -788,7 +788,7 @@ basic_coverage +

### Load coverage

The exported coverage from [Proteome Discoverer](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8006021/):
The exported coverage from [Proteome Discoverer](https://doi.org/10.3390/proteomes9010015):

```{r ms_coverage_data}
library(openxlsx)
Expand Down
24 changes: 3 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,6 @@ library(ggbio)
#>
#> geom_bar, geom_rect, geom_segment, ggsave, stat_bin, stat_identity,
#> xlim
```

``` r

basic_coverage +
geom_gene(gtf.gr = gtf_gr) +
Expand Down Expand Up @@ -459,9 +456,6 @@ library("BSgenome.Hsapiens.UCSC.hg19")
#> The following object is masked from 'package:BiocIO':
#>
#> FileForFormat
```

``` r

# create plot
basic_coverage +
Expand Down Expand Up @@ -497,9 +491,6 @@ track_df <- LoadTrackFile(
region = "4:1-160000000"
)
#> No metadata provided, returning coverage as is.
```

``` r

# add chr prefix
track_df$seqnames <- paste0("chr", track_df$seqnames)
Expand Down Expand Up @@ -606,9 +597,6 @@ track_df <- LoadTrackFile(
#> No 'region' specified; extracting coverage for an example range
#> (<=100,000 bases, first annotated sequence)
#> Coverage extracted from sequence/chromosome: chr10
```

``` r

head(track_df)
#> seqnames start end width strand score Type Group
Expand Down Expand Up @@ -669,7 +657,7 @@ graphics::par(opar)

Default color scheme for amino acid annotation is from [Residual
colours: a proposal for
aminochromography](https://academic.oup.com/peds/article/10/7/743/1593029?login=false):
aminochromography](https://doi.org/10.1093/protein/10.7.743):

``` r
aa_color <- c(
Expand Down Expand Up @@ -910,7 +898,7 @@ a contact map.

The Hi-C data is taken from [pyGenomeTracks: reproducible plots for
multivariate genomic
datasets](https://academic.oup.com/bioinformatics/article/37/3/422/5879987?login=false).
datasets](https://doi.org/10.1093/bioinformatics/btaa692).

The Hi-C matrix visualization is implemented by
[`HiCBricks`](https://github.com/koustav-pal/HiCBricks). This package
Expand All @@ -931,9 +919,6 @@ track_df <- LoadTrackFile(
extend = 0
)
#> No metadata provided, returning coverage as is.
```

``` r

track_df$score <- ifelse(track_df$score < 0, 0, track_df$score)

Expand Down Expand Up @@ -1021,9 +1006,6 @@ library(HiCBricks)
#> The following object is masked from 'package:Biostrings':
#>
#> pattern
```

``` r

basic_coverage +
geom_tad(
Expand Down Expand Up @@ -1066,7 +1048,7 @@ quality of the data.
### Load coverage

The exported coverage from [Proteome
Discoverer](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8006021/):
Discoverer](https://doi.org/10.3390/proteomes9010015):

``` r
library(openxlsx)
Expand Down
2 changes: 1 addition & 1 deletion man/FormatTrack.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/LoadTrackFile.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions man/geom_base.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/geom_gene.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/geom_transcript.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions vignettes/ggcoverage.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ graphics::mtext(
graphics::par(opar)
```

Default color scheme for amino acid annotation is from [Residual colours: a proposal for aminochromography](https://academic.oup.com/peds/article/10/7/743/1593029?login=false):
Default color scheme for amino acid annotation is from [Residual colours: a proposal for aminochromography](https://pubmed.ncbi.nlm.nih.gov/9342138/):

```{r aa_color_scheme, warning = FALSE, fig.height = 9, fig.width = 10, fig.align = "center"}
aa_color <- c(
Expand Down Expand Up @@ -705,7 +705,7 @@ The Hi-C method maps chromosome contacts in eukaryotic cells.
For this purpose, DNA and protein complexes are cross-linked and DNA fragments then purified.
As a result, even distant chromatin fragments can be found to interact due to the spatial organization of the DNA and histones in the cell. Hi-C data shows these interactions for example as a contact map.

The Hi-C data is taken from [pyGenomeTracks: reproducible plots for multivariate genomic datasets](https://academic.oup.com/bioinformatics/article/37/3/422/5879987?login=false).
The Hi-C data is taken from [pyGenomeTracks: reproducible plots for multivariate genomic datasets](https://pubmed.ncbi.nlm.nih.gov/32745185/).

The Hi-C matrix visualization is implemented by [`HiCBricks`](https://github.com/koustav-pal/HiCBricks).
This package needs to be installed separately (it is only 'Suggested' by `ggcoverage`).
Expand Down Expand Up @@ -819,7 +819,7 @@ knitr::include_graphics("../man/figures/README-hic_coverage-1.png")

### Load coverage

The exported coverage from [Proteome Discoverer](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8006021/):
The exported coverage from [Proteome Discoverer](https://pmc.ncbi.nlm.nih.gov/articles/PMC8006021/):

```{r ms_coverage_data, eval = FALSE}
library(openxlsx)
Expand Down
Loading