wig

Import WIG Data into R in Long Format

https://github.com/ramiromagno/wig

Science Score: 10.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: ncbi.nlm.nih.gov
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (16.4%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

Import WIG Data into R in Long Format

Basic Info
  • Host: GitHub
  • Owner: ramiromagno
  • License: other
  • Language: R
  • Default Branch: master
  • Size: 53.7 KB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created almost 5 years ago · Last pushed over 3 years ago
Metadata Files
Readme License

README.Rmd

---
output: github_document
---



```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%",
  dev = 'svg'
)
```

# wig


[![CRAN status](https://www.r-pkg.org/badges/version/wig)](https://CRAN.R-project.org/package=wig)


The goal of `{wig}` is to import [WIG](https://m.ensembl.org/info/website/upload/wig.html) data into R in long format.

## Installation

Install `{wig}` from CRAN:

``` r
# Install from CRAN
install.packages("wig")
```

Or the current development version directly from GitHub:

``` r
# install.packages("remotes")
remotes::install_github("ramiromagno/wig")
```

## Usage

To import a WIG file, simply use the function `import_wig()`.

```{r}
library(wig)
wig_file <- system.file("extdata", file = 'hg19-pik3ca.wig', package = "wig", mustWork = TRUE)

(wig_data <- import_wig(wig_file))
```

```{r}
library(ggplot2)
ggplot(data = wig_data, mapping = aes(x = pos, y = val)) +
  geom_line(size = 0.1) +
  xlab('Chr 3 genomic position') +
  ylab('H3K4me3 raw counts')
```

The file `hg19-pik3ca.wig` is an example WIG file that contains H3K4me3 ChIP-Seq analysis of breast variant human mammary epithelial cell from RM035 (HS2615) using Illumina Genome Analyzer IIx. This WIG file has already been trimmed to a region where the gene PIK3CA can be found: chromosome 3, starting position 178,861,000 and ending position 178,894,000 (assembly hg19).

If you are interested, you can find more details about this sample in GEO:
https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSM613874.

## Admonition

The function `import_wig()` is to be used with smallish files, i.e., files whose genomic data comprises regions on the tens or few hundreds of kilobases.

If you really need to do serious work with WIG, bigWIG, or other type of genome annotation files, you are probably better off using packages from the R Bioconductor ecosystem, e.g. [rtracklayer](https://bioconductor.org/packages/release/bioc/html/rtracklayer.html).

## How to extract a region from a WIG file (outside of R)

If you have a WIG file that comprises a long genomic region, but you are only
interested on a small genomic region, here are the steps to extract that region:

1. Download these two command-line tools: `bigWigToWig` and `wigToBigWig` from
https://hgdownload.soe.ucsc.edu/admin/exe/linux.x86_64/. Navigate up one-level
if your Operating System (OS) is not Linux and find the compiled tools for your
OS.
2. Start by converting your WIG file to BigWIG with `wigToBigWig`:

```bash
wigToBigWig .wig.gz chromInfo.txt .bw
```

You are going to need a file with chromosome lengths. E.g., for assembly hg19 you can get `chromInfo.txt.gz` provided by UCSC from: ftp://hgdownload.cse.ucsc.edu/goldenPath/hg19/database/chromInfo.txt.gz.


3. Then, you can use `bigWigToWig` to select a specific region and convert back to WIG, e.g.:

```bash
bigWigToWig -chrom=chr3 -start=178861000 -end=178894000 .bw .wig
```

Owner

  • Name: Ramiro Magno
  • Login: ramiromagno
  • Kind: user
  • Company: Pattern Institute

Data Scientist

GitHub Events

Total
Last Year

Committers

Last synced: about 1 year ago

All Time
  • Total Commits: 16
  • Total Committers: 1
  • Avg Commits per committer: 16.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Ramiro Magno r****o@g****m 16

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 1
  • Total pull requests: 0
  • Average time to close issues: 21 days
  • Average time to close pull requests: N/A
  • Total issue authors: 1
  • Total pull request authors: 0
  • Average comments per issue: 4.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • patrick-barth (1)
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 193 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 1
  • Total maintainers: 1
cran.r-project.org: wig

Import WIG Data into R in Long Format

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 193 Last month
Rankings
Forks count: 28.8%
Dependent packages count: 29.8%
Stargazers count: 35.2%
Dependent repos count: 35.5%
Average: 43.2%
Downloads: 86.8%
Maintainers (1)
Last synced: 10 months ago

Dependencies

DESCRIPTION cran
  • dplyr * imports
  • magrittr * imports
  • stringr * imports
  • tibble * imports
  • spelling * suggests