Skip to content
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
69 changes: 0 additions & 69 deletions .github/workflows/test-coverage.yaml

This file was deleted.

92 changes: 92 additions & 0 deletions .github/workflows/update-readme.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: update-readme

on:
pull_request:
branches: [main, master]

jobs:
bot-job:
runs-on: ubuntu-latest

permissions:
contents: write
pull-requests: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Pandoc
uses: r-lib/actions/setup-pandoc@v2

- name: Setup R
uses: r-lib/actions/setup-r@v2
with:
r-version: 'release'
use-public-rspm: true

- name: Install R dependencies
uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rmarkdown
needs: check

- name: List installed packages
run: |
Rscript -e "print(installed.packages()[,c('Package','Version')])"

- name: Install package
run: |
R CMD INSTALL .

- name: Render README
run: |
R -e "rmarkdown::render('README.Rmd', output_format = 'github_document')"
git add README.md

- name: Check staged changes
run: |
if git diff --cached --quiet --exit-code; then
echo "changed=false" >> $GITHUB_ENV
else
echo "changed=true" >> $GITHUB_ENV
fi

- name: Commit and push changes
if: env.changed == 'true'
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git commit -m "Update README"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Comment on PR when changed
if: env.changed == 'true'
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: "Updated repo README file."
})

- name: Comment on PR when unchanged
if: env.changed == 'false'
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: "Repo README file is up to date. Nothing to commit."
})
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Imports:
tibble,
tidyr
Suggests:
covr,
testthat
Remotes:
stitam/breakpoint
Expand Down
27 changes: 26 additions & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,34 @@ knitr::opts_chunk$set(

<!-- badges: start -->

```{r coverage, echo=FALSE}
cov <- covr::package_coverage()
pct <- covr::percent_coverage(cov)
pct_label <- sprintf("%.1f%%", pct)

# Choose badge color based on coverage
col <- if (pct >= 90) {
"brightgreen"
} else if (pct >= 75) {
"yellow"
} else if (pct >= 50) {
"orange"
} else {
"red"
}

badge_url <- sprintf(
"https://img.shields.io/badge/coverage-%s-%s",
URLencode(pct_label),
col
)
```

[![status](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![R build status](https://github.com/sbthandras/tailor/workflows/R-CMD-check/badge.svg)](https://github.com/sbthandras/tailor/actions)
[![Coverage](https://codecov.io/github/sbthandras/tailor/graph/badge.svg?branch=main)](https://app.codecov.io/gh/sbthandras/tailor/branch/main)
```{r coverage-badge, echo=FALSE, results='asis'}
cat(sprintf("[![Coverage](%s)](#test-coverage)\n\n", badge_url))
```
[![DOI](https://img.shields.io/badge/DOI-10.64898%2F2026.02.20.706991-blue)](https://doi.org/10.64898/2026.02.20.706991)

<!-- badges: end -->
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[![status](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![R build
status](https://github.com/sbthandras/tailor/workflows/R-CMD-check/badge.svg)](https://github.com/sbthandras/tailor/actions)
[![Coverage](https://codecov.io/github/sbthandras/tailor/graph/badge.svg?branch=main)](https://app.codecov.io/gh/sbthandras/tailor/branch/main)
[![Coverage](https://img.shields.io/badge/coverage-12.1%25-red)](#test-coverage)
[![DOI](https://img.shields.io/badge/DOI-10.64898%2F2026.02.20.706991-blue)](https://doi.org/10.64898/2026.02.20.706991)

<!-- badges: end -->
Expand Down Expand Up @@ -83,7 +83,7 @@ but both ranges were classified as conserved, so they were merged
plot(ps)
```

<img src="man/figures/README-unnamed-chunk-3-1.png" width="60%" />
<img src="man/figures/README-unnamed-chunk-3-1.png" alt="" width="60%" />

Depending on the method used for detecting breakpoints, the length of
the identified adapter may differ. By default, `find_breakpoints()` uses
Expand Down Expand Up @@ -117,7 +117,7 @@ clusters <- cluster_adapters(amat)
plot(amat, clusters = clusters)
```

<img src="man/figures/README-unnamed-chunk-5-1.png" width="60%" />
<img src="man/figures/README-unnamed-chunk-5-1.png" alt="" width="60%" />

## Citation

Expand Down
Binary file added man/figures/README-unnamed-chunk-4-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added man/figures/README-unnamed-chunk-6-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.