https://github.com/alexpreynolds/soda

Python-based UCSC genome browser snapshot-taker and gallery-maker

https://github.com/alexpreynolds/soda

Science Score: 13.0%

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

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.3%) to scientific vocabulary

Keywords

bed genomics python ucsc visualization
Last synced: 5 months ago · JSON representation

Repository

Python-based UCSC genome browser snapshot-taker and gallery-maker

Basic Info
  • Host: GitHub
  • Owner: alexpreynolds
  • License: mit
  • Language: JavaScript
  • Default Branch: master
  • Homepage:
  • Size: 1.94 MB
Statistics
  • Stars: 12
  • Watchers: 3
  • Forks: 3
  • Open Issues: 7
  • Releases: 0
Topics
bed genomics python ucsc visualization
Created over 9 years ago · Last pushed almost 2 years ago
Metadata Files
Readme License

README.md

soda

Python-based UCSC genome browser snapshot gallery-maker

Description

soda is a Python script that generates a gallery of images made from snapshots from a UCSC genome browser instance, so-called "soda plots". Snapshots can be derived from an external browser instance, by pointing soda to that browser instance's host name.

You provide the script with four required parameters:

  1. A BED-formatted file containing your regions of interest.
  2. The genome build name, such as hg19, hg38, mm10, etc.
  3. The session ID from your genome browser session, which specifies the browser tracks you want to visualize, as well as other visual display parameters that are specific to your session.
  4. Where you want to store the gallery end-product.

If the BED file contains a fourth column (commonly used to store the name of the region), its values are used as labels for each page in the gallery.

Additional options are available; please see the Options section.

Note

The BED file does not need to be in BEDOPS sort-bed order. In fact, it can be useful to order the regions in a BED file by some criteria other than genomic position, such as some numerical value stored in the BED file's score column, e.g.:

bash $ sort -k5,5n input.bed > input_sorted_by_scores.bed

Any ordering is allowed. Gallery snapshots are presented in the same order as rows in the input BED file.

Installation

Set up a virtual environment via virtualenv or conda create and activate it. Then install via pip:

bash $ python3 -m pip install soda-gallery

Or via Bioconda:

bash $ conda config --add channels bioconda $ conda install soda-gallery

Development

Clone it from Github and install locally into a virtual environment:

bash $ git clone https://github.com/alexpreynolds/soda.git $ cd soda $ python3 -m pip install -e .

Usage

As a usage example, you may have a BED file in some home directory called /home/abc/regions.bed. You have a session ID from the UCSC genome browser called 123456_abcdef, with all your tracks selected and display parameters set, using hg38 as the reference genome build. Finally, you want to store the results in a folder called /home/abc/my-soda-plot-results:

bash $ soda -r "/home/abc/regions.bed" -b "hg38" -s "123456_abcdef" -o "/home/abc/my-soda-plot-results"

If you run this locally, you can open the result folder's index.html file with your web browser to load the gallery. For example, from the Terminal application in OS X, you can run:

bash $ open /Users/abc/my-soda-plot-results/index.html

which opens the gallery index in your default web browser.

Options

A full listing of options is available via soda --help.

Required

Four options are required. At minimum:

bash -r, --regionsFn

Use -r or --regionsFn to specify the path to the input BED file containing regions of interest.

bash -b, --browserBuildID

The -b or --browserBuildID option specifies the genome build, e.g., hg19, mm10, etc.

bash -s, --browserSessionID

The -s or --browserSessionID option specify the browser session ID, which references a configuration of tracks and display parameters from a genome browser instance.

bash -o, --outputDir

Use the -o or --outputDir option to specify where the image gallery is saved. If this path already exists, soda will exit with a fatal error message.

Optional

Other options are available depending on how you want to customize the run.

bash -t, --title

Use -t or --title to specify a gallery title.

bash [ -i, --addIntervalAnnotation | -d, --addMidpointAnnotation ]

Use -i or --addIntervalAnnotation to add a rectangle underneath all tracks that demarcates the original genomic range (useful when used with --range). Alternatively, use -d or --addMidpointAnnotation to add a vertical line underneath all tracks, centered on the midpoint of the input genomic range. In both cases, the annotation is labeled with the genomic coordinates of the original interval or the calculated midpoint, respectively. It is not allowed to specify both options together.

bash -w, --annotationRgba -z, --annotationFontPointSize -f, --annotationFontFamily

When used with -i or -d to add an interval or midpoint annotation, these options may be used to override the default rgba() color, typeface point size, and typeface family (where supported by the local installation of ImageMagick), which are parameters used to render the appearance of the annotation components. The default color is rgba(255, 0, 0, 0.333) and the default point size and font family values are 5 and Helvetica-Bold, respectively.

bash -a, --range

Use the -a or --range option to pad the BED input's midpoint symmetrically by the specified number of bases. This works regardless of the sort order of the input.

bash -g, --browserURL

Use the -g or --browserURL option to specify a different genome browser URL other than the UCSC genome browser. If a different host is specified and credentials are required, please use the -u and -p options (see below).

bash -u, --browserUsername -p, --browserPassword

Use these two options to specify a username and password for the browser instance, if you pick a different --browserURL and that browser instance requires basic credentials. If these options are not specified, no credentials are passed along. If authentication is required and it fails, soda may exit with an error.

bash -y, --useKerberosAuthentication

Use this option if access to your custom browser instance requires a Kerberos ticket (obtained via kinit, for example).

bash -v, --verbose

Use -v or --verbose to print debug messages, which may be useful for automation or debugging.

Use the -m option to specify the gallery framework. The default is photoswipe; alternatively, use blueimp to generate a blueimp-backed gallery.

Credits

The general "soda" gallery tool has been authored in various bash- and Perl-flavored incarnations since 2008 by primary authors Richard Sandstrom and Scott Kuehn, with modifications over time by Bob Thurman, Jay Hesselberth, Richard Humbert, Brady Miller and Alex Reynolds.

This Python rewrite and new functionality were authored by Alex Reynolds.

This tool uses the PhotoSwipe, blueimp Gallery and Github octicons projects, which are MIT-licensed.

So what's up with the name?

"Scott Kuehn: he came up with the name. The legend is that when asked what to call the program, he lifted a can of cola, sighed deeply, and said: 'soda plot'." - R. Sandstrom

Owner

  • Name: Alex Reynolds
  • Login: alexpreynolds
  • Kind: user
  • Location: Seattle, WA USA
  • Company: Altius Institute for Biomedical Sciences

Pug caregiver, curler, cyclist, gardener, beginning French scholar

GitHub Events

Total
Last Year

Committers

Last synced: almost 3 years ago

All Time
  • Total Commits: 15
  • Total Committers: 1
  • Avg Commits per committer: 15.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Alex Reynolds a****s@g****m 15

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 6
  • Total pull requests: 9
  • Average time to close issues: 6 months
  • Average time to close pull requests: 9 months
  • Total issue authors: 6
  • Total pull request authors: 1
  • Average comments per issue: 3.33
  • Average comments per pull request: 0.11
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 9
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
  • gopi1616 (1)
  • arnoldliaoILMN (1)
  • Suhoja (1)
  • zhengrongbin (1)
  • gk7279 (1)
  • dominik-handler (1)
Pull Request Authors
  • dependabot[bot] (17)
Top Labels
Issue Labels
bug (1) question (1) enhancement (1)
Pull Request Labels
dependencies (17) javascript (9) python (8)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 12 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 3
  • Total maintainers: 1
pypi.org: soda-gallery

Python-based UCSC genome browser gallery generator

  • Versions: 3
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 12 Last month
Rankings
Dependent packages count: 10.0%
Stargazers count: 16.0%
Forks count: 16.8%
Dependent repos count: 21.7%
Average: 25.5%
Downloads: 62.9%
Maintainers (1)
Last synced: 6 months ago

Dependencies

soda/octicons/package.json npm
  • autoprefixer ^6.3.6 development
  • ava ^0.15.2 development
  • grunt ^0.4.5 development
  • grunt-contrib-clean ^0.7.0 development
  • grunt-cssnano ^2.1.0 development
  • grunt-postcss ^0.7.1 development
  • grunt-sass ^1.2.0 development
  • grunt-svg-sprite ^1.2.19 development
  • grunt-svgmin ^3.2.0 development
  • grunt-webfont ^1.4.0 development
requirements.txt pypi
  • Jinja2 ==3.0.1
  • beautifulsoup4 ==4.9.3
  • certifi ==2021.5.30
  • pdfminer ==20191125
  • pdfrw ==0.4
  • requests ==2.25.1
  • requests_kerberos ==0.12.0
setup.py pypi
  • Jinja2 >=3.0.1
  • beautifulsoup4 >=4.9.3
  • certifi >=2021.5.30
  • pdfminer >=20191125
  • pdfrw >=0.4
  • requests >=2.25.1
  • requests_kerberos >=0.12.0
soda/Gallery-blueimp/package-lock.json npm
  • 337 dependencies
soda/Gallery-blueimp/package.json npm
  • clean-css-cli 5 development
  • eslint 7 development
  • eslint-config-blueimp 2 development
  • eslint-config-prettier 8 development
  • eslint-plugin-jsdoc 36 development
  • eslint-plugin-prettier 4 development
  • jquery 1 development
  • prettier 2 development
  • stylelint 13 development
  • stylelint-config-prettier 8 development
  • stylelint-config-recommended 5 development
  • uglify-js 3 development
soda/Gallery-photoswipe/package.json npm
  • @babel/core ^7.18.0 development
  • @babel/eslint-parser ^7.17.0 development
  • @babel/plugin-syntax-class-properties ^7.12.13 development
  • @babel/plugin-transform-nullish-coalescing-operator ^7.22.11 development
  • @babel/plugin-transform-optional-chaining ^7.22.10 development
  • @rollup/plugin-babel ^6.0.3 development
  • chokidar-cli ^3.0.0 development
  • concurrently ^6.0.2 development
  • copyfiles ^2.4.1 development
  • eslint ^8.16.0 development
  • eslint-config-airbnb-base ^15.0.0 development
  • eslint-plugin-import ^2.26.0 development
  • rollup ^2.46.0 development
  • rollup-plugin-copy ^3.4.0 development
  • rollup-plugin-terser ^7.0.2 development
  • typescript ^4.7.3 development