Skip to content

Commit

Permalink
fix: attempt to fix various R CMD CHECK errors
Browse files Browse the repository at this point in the history
  • Loading branch information
m-jahn committed Apr 16, 2024
1 parent 85d8ac0 commit a21c2a1
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 38 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ jobs:
config:
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
Expand Down
3 changes: 2 additions & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ knitr::opts_chunk$set(
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%",
dpi = 60
dpi = 60,
crop = NULL
)
```

Expand Down
96 changes: 61 additions & 35 deletions vignettes/ggcoverage.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,12 @@ BiocStyle::markdown()
```

```{r setup, echo=FALSE, warning=FALSE}
library(knitr)
htmltools::tagList(rmarkdown::html_dependency_font_awesome())
# set dpi
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
dpi = 60
dpi = 60,
fig.path = "png/",
crop = NULL
)
```

Expand Down Expand Up @@ -256,18 +254,26 @@ basic_coverage +

### Add ideogram

```{r ideogram_coverage_1, warning=FALSE, fig.height = 10, fig.width = 12, fig.align = "center"}
```{r ideogram_coverage_1, eval = FALSE}
basic_coverage +
geom_gene(gtf.gr = gtf_gr) +
geom_ideogram(genome = "hg19", plot.space = 0)
```

```{r ideogram_coverage_2, warning=FALSE, fig.height = 14, fig.width = 12, fig.align = "center"}
```{r ideogram_coverage_1_plot, echo = FALSE, fig.height = 10, fig.width = 12, fig.align = "center"}
knitr::include_graphics("../man/figures/README-ideogram_coverage_1-1.png")
```

```{r ideogram_coverage_2, eval = FALSE}
basic_coverage +
geom_transcript(gtf.gr = gtf_gr, label.vjust = 1.5) +
geom_ideogram(genome = "hg19", plot.space = 0)
```

```{r ideogram_coverage_2_plot, echo = FALSE, fig.height = 14, fig.width = 12, fig.align = "center"}
knitr::include_graphics("../man/figures/README-ideogram_coverage_2-1.png")
```

## DNA-seq data

### CNV
Expand Down Expand Up @@ -311,14 +317,15 @@ basic_coverage <- ggcoverage(
mark.region = NULL,
range.position = "out"
)
basic_coverage
```

##### Add GC annotations

Add **GC**, **ideogram** and **gene** annotaions.

```{r gc_coverage, warning=FALSE, fig.height = 10, fig.width = 12, fig.align = "center"}
```{r gc_coverage, eval = FALSE}
# load genome data
library("BSgenome.Hsapiens.UCSC.hg19")
Expand All @@ -329,6 +336,11 @@ basic_coverage +
geom_ideogram(genome = "hg19")
```


```{r gc_coverage_plot, echo = FALSE, fig.height = 10, fig.width = 12, fig.align = "center"}
knitr::include_graphics("../man/figures/README-gc_coverage-1.png")
```

#### Example 2

##### Load the data
Expand Down Expand Up @@ -384,7 +396,7 @@ head(cnv_df)

Add **GC**, **ideogram** and **CNV** annotations.

```{r cnv_gc_coverage}
```{r cnv_gc_coverage, eval=FALSE}
# create plot
basic_coverage +
geom_gc(bs.fa.seq = BSgenome.Hsapiens.UCSC.hg19) +
Expand All @@ -398,6 +410,10 @@ basic_coverage +
)
```

```{r cnv_gc_coverage_plot, echo = FALSE, fig.height = 10, fig.width = 12, fig.align = "center"}
knitr::include_graphics("../man/figures/README-cnv_gc_coverage-1.png")
```


### Single-nucleotide level

Expand Down Expand Up @@ -506,13 +522,7 @@ graphics::par(opar)

**Use twill to mark position with SNV**:

```{r, echo = FALSE}
# wait some time to avoid 'Too Many Requests' error
Sys.sleep(60)
```


```{r base_aa_coverage, warning=FALSE, fig.height = 10, fig.width = 12, fig.align = "center"}
```{r base_aa_coverage, eval =FALSE}
# create plot with twill mark
ggcoverage(
data = track_df,
Expand All @@ -527,14 +537,14 @@ ggcoverage(
geom_ideogram(genome = "hg19", plot.space = 0)
```

**Use star to mark position with SNV**:

```{r, echo = FALSE}
# wait some time to avoid 'Too Many Requests' error
Sys.sleep(60)
```{r base_aa_coverage_plot, echo = FALSE, fig.height = 10, fig.width = 12, fig.align = "center"}
knitr::include_graphics("../man/figures/README-base_aa_coverage-1.png")
```

```{r base_aa_coverage_star, warning=FALSE, fig.height = 10, fig.width = 12, fig.align = "center"}
**Use star to mark position with SNV**:

```{r base_aa_coverage_star, eval = FALSE}
# create plot with star mark
ggcoverage(
data = track_df,
Expand All @@ -549,14 +559,14 @@ ggcoverage(
geom_ideogram(genome = "hg19", plot.space = 0)
```

**Highlight position with SNV**:

```{r, echo = FALSE}
# wait some time to avoid 'Too Many Requests' error
Sys.sleep(60)
```{r base_aa_coverage_star_plot, echo = FALSE, fig.height = 10, fig.width = 12, fig.align = "center"}
knitr::include_graphics("../man/figures/README-base_aa_coverage_star-1.png")
```

```{r base_aa_coverage_highlight, warning=FALSE, fig.height = 10, fig.width = 12, fig.align = "center"}
**Highlight position with SNV**:

```{r base_aa_coverage_highlight, eval = FALSE}
# highlight one base
ggcoverage(
data = track_df,
Expand All @@ -571,6 +581,11 @@ ggcoverage(
geom_ideogram(genome = "hg19", plot.space = 0)
```


```{r base_aa_coverage_highlight_plot, echo = FALSE, fig.height = 10, fig.width = 12, fig.align = "center"}
knitr::include_graphics("../man/figures/README-base_aa_coverage_highlight-1.png")
```

## ChIP-seq data

The ChIP-seq data used here are from [DiffBind](https://bioconductor.org/packages/release/bioc/html/DiffBind.html), I select four sample to use as example: Chr18_MCF7_input, Chr18_MCF7_ER_1, Chr18_MCF7_ER_3, Chr18_MCF7_ER_2, and all bam files are converted to bigwig file with [deeptools](https://deeptools.readthedocs.io/en/develop/).
Expand Down Expand Up @@ -638,12 +653,7 @@ basic_coverage

Add **gene**, **ideogram** and **peak** annotations. To create peak annotation, we first **get consensus peaks** with [MSPC](https://github.com/Genometric/MSPC).

```{r, echo = FALSE}
# wait some time to avoid 'Too Many Requests' error
Sys.sleep(60)
```

```{r peak_coverage, warning=FALSE, fig.height = 10, fig.width = 12, fig.align = "center"}
```{r peak_coverage, eval = FALSE}
# get consensus peak file
peak_file <- system.file("extdata",
"ChIP-seq",
Expand All @@ -656,6 +666,10 @@ basic_coverage +
geom_ideogram(genome = "hg19", plot.space = 0)
```

```{r peak_coverage_plot, echo = FALSE, fig.height = 10, fig.width = 12, fig.align = "center"}
knitr::include_graphics("../man/figures/README-peak_coverage-1.png")
```

## Hi-C data

The Hi-C data are from [pyGenomeTracks: reproducible plots for multivariate genomic datasets](https://academic.oup.com/bioinformatics/article/37/3/422/5879987?login=false).
Expand Down Expand Up @@ -739,7 +753,7 @@ basic_coverage

Add **link**, **contact map**annotations:

```{r hic_coverage, warning=FALSE, fig.height = 10, fig.width = 12, fig.align = "center"}
```{r hic_coverage, eval = FALSE}
basic_coverage +
geom_tad(
matrix = hic_mat,
Expand All @@ -755,6 +769,10 @@ basic_coverage +
show.rect = TRUE)
```

```{r hic_coverage_plot, echo = FALSE, fig.height = 10, fig.width = 12, fig.align = "center"}
knitr::include_graphics("../man/figures/README-hic_coverage-1.png")
```

## Mass spectrometry protein coverage

[Mass spectrometry (MS) is an important method for the accurate mass determination and characterization of proteins, and a variety of methods and instrumentations have been developed for its many uses](https://en.wikipedia.org/wiki/Protein_mass_spectrometry). After MS, we can check the coverage of protein to check the quality of the data and find the reason why the segment did not appear and improve the experiment.
Expand Down Expand Up @@ -790,7 +808,7 @@ protein_set

### Protein coverage

```{r basic_coverage_protein, warning=FALSE, fig.height = 6, fig.width = 12, fig.align = "center"}
```{r basic_coverage_protein, eval = FALSE}
protein_coverage <- ggprotein(
coverage.file = coverage_file,
fasta.file = fasta_file,
Expand All @@ -801,11 +819,15 @@ protein_coverage <- ggprotein(
protein_coverage
```

```{r basic_coverage_protein_plot, echo = FALSE, fig.height = 6, fig.width = 12, fig.align = "center"}
knitr::include_graphics("../man/figures/README-basic_coverage_protein-1.png")
```

### Add annotation

We can obtain features of the protein from [UniProt](https://www.uniprot.org/). For example, the above protein coverage plot shows that there is empty region in 1-24, and this empty region in [UniProt](https://www.uniprot.org/uniprotkb/P02769/entry) is annotated as Signal peptide and Propeptide peptide. When the protein is mature and released extracellular, these peptides will be cleaved. This is the reason why there is empty region in 1-24.

```{r basic_coverage_protein_feature, warning=FALSE, fig.height = 6, fig.width = 12, fig.align = "center"}
```{r basic_coverage_protein_feature, eval = FALSE}
# protein feature obtained from UniProt
protein_feature_df <- data.frame(
ProteinID = "sp|P02769|ALBU_BOVIN",
Expand All @@ -820,6 +842,10 @@ protein_coverage +
feature.color = c("#4d81be", "#173b5e", "#6a521d"))
```

```{r basic_coverage_protein_feature_plot, echo = FALSE, fig.height = 6, fig.width = 12, fig.align = "center"}
knitr::include_graphics("../man/figures/README-basic_coverage_protein_feature-1.png")
```

## Code of Conduct

Please note that the `ggcoverage` project is released with a [Contributor Code of Conduct](https://contributor-covenant.org/version/2/0/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.
Expand Down

0 comments on commit a21c2a1

Please sign in to comment.