Skip to content

Commit

Permalink
update pfam links (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
typhainepl authored Oct 21, 2022
1 parent 14d6463 commit fa1c5e3
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 20 deletions.
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
# lollipops

**Please cite this work as**
* Jay JJ, Brouwer C (2016) Lollipops in the Clinic: Information Dense Mutation Plots for Precision Medicine. PLoS ONE 11(8): e0160519. doi: [10.1371/journal.pone.0160519](http://dx.doi.org/10.1371/journal.pone.0160519).

- Jay JJ, Brouwer C (2016) Lollipops in the Clinic: Information Dense Mutation Plots for Precision Medicine. PLoS ONE 11(8): e0160519. doi: [10.1371/journal.pone.0160519](http://dx.doi.org/10.1371/journal.pone.0160519).

A simple 'lollipop' mutation diagram generator that tries to make things
simple and easy by automating as much as possible. It uses the
[UniProt REST API](http://www.uniprot.org/uploadlists/) and/or
[Pfam API](http://pfam.xfam.org/help#tabview=tab9) to automate translation
[Pfam API](http://pfam-legacy.xfam.org/help#tabview=tab9) to automate translation
of Gene Symbols and lookup domain/motif features for display. If
variant changes are provided, it will also annotate them to the diagram
using the "lollipops" markers that give the tool it's name.

## Example

Basic usage is just the gene symbol (ex: ``TP53``) and a list of
mutations (ex: ``R273C R175H T125 R248Q``)
Basic usage is just the gene symbol (ex: `TP53`) and a list of
mutations (ex: `R273C R175H T125 R248Q`)

./lollipops TP53 R273C R175H T125 R248Q

Expand All @@ -24,17 +25,17 @@ More advanced usage allows for per-mutation color (e.g. sample type) and
size specification (e.g. denoting number of samples), along with text
labels, a legend for abbreviated domains, and more:

./lollipops -legend -labels TP53 R248Q#7f3333@131 R273C R175H T125@5
./lollipops -legend -labels TP53 R248Q#7f3333@131 R273C R175H T125@5

![TP53 Lollipop diagram with 5 customized mutations](tp53_more.png?raw=true)

## Usage

Usage: ``lollipops [options] {-U UNIPROT_ID | GENE_SYMBOL} [PROTEIN CHANGES ...]``
Usage: `lollipops [options] {-U UNIPROT_ID | GENE_SYMBOL} [PROTEIN CHANGES ...]`

Where **GENE_SYMBOL** is the official human HGNC gene symbol. This will use the
official API to lookup the **UNIPROT_ID**. To skip the lookup or use other species,
specify the UniProt ID with -U (e.g. ``-U P04637`` for TP53)
specify the UniProt ID with -U (e.g. `-U P04637` for TP53)

#### Protein changes

Expand Down Expand Up @@ -84,7 +85,7 @@ the area is exponentially proportional to the count indicated. Examples:
-uniprot use UniprotKB as an alternative to Pfam for
fetching domain/motif information
-l=filename.json use local file instead of Pfam API for graphic data
see: http://pfam.xfam.org/help#tabview=tab9
see: http://pfam-legacy.xfam.org/help#tabview=tab9
```

## Installation
Expand All @@ -93,7 +94,7 @@ Head over to the [Releases](https://github.com/joiningdata/lollipops/releases) t
download the latest version for your system in a simple command-line executable.

If you already have Go installed and want the bleeding edge, just
``go get -u github.com/joiningdata/lollipops`` to download the latest version.
`go get -u github.com/joiningdata/lollipops` to download the latest version.

## Embedding

Expand Down
6 changes: 3 additions & 3 deletions data/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
)

// MotifNames has human-readable names
// - mostly from http://pfam.xfam.org/help#tabview=tab9
// - mostly from http://pfam-legacy.xfam.org/help#tabview=tab9
var MotifNames = map[string]string{
"disorder": "Disordered region",
"low_complexity": "Low complexity region",
Expand Down Expand Up @@ -66,13 +66,13 @@ func GetLocalGraphicData(filename string) (*GraphicResponse, error) {
f.Close()
for i, x := range pf.Motifs {
if x.Link != "" && !strings.Contains(x.Link, "://") {
x.Link = "http://pfam.xfam.org" + x.Link
x.Link = "http://pfam-legacy.xfam.org" + x.Link
pf.Motifs[i] = x
}
}
for i, x := range pf.Regions {
if x.Link != "" && !strings.Contains(x.Link, "://") {
x.Link = "http://pfam.xfam.org" + x.Link
x.Link = "http://pfam-legacy.xfam.org" + x.Link
pf.Regions[i] = x
}
}
Expand Down
6 changes: 3 additions & 3 deletions data/pfam.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"os"
)

const PfamGraphicURL = "https://pfam.xfam.org/protein/%s/graphic"
const PfamGraphicURL = "https://pfam-legacy.xfam.org/protein/%s/graphic"

func GetPfamGraphicData(accession string) (*GraphicResponse, error) {
queryURL := fmt.Sprintf(PfamGraphicURL, accession)
Expand Down Expand Up @@ -56,13 +56,13 @@ func GetPfamGraphicData(accession string) (*GraphicResponse, error) {
r := data[0]
for i, x := range r.Motifs {
if x.Link != "" {
x.Link = "https://pfam.xfam.org" + x.Link
x.Link = "https://pfam-legacy.xfam.org" + x.Link
r.Motifs[i] = x
}
}
for i, x := range r.Regions {
if x.Link != "" {
x.Link = "https://pfam.xfam.org" + x.Link
x.Link = "https://pfam-legacy.xfam.org" + x.Link
r.Regions[i] = x
}
}
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ Alternative input sources:
-uniprot use UniprotKB as an alternative to Pfam for
fetching domain/motif information
-l=filename.json use local file instead of Pfam API for graphic data
see: http://pfam.xfam.org/help#tabview=tab9
see: http://pfam-legacy.xfam.org/help#tabview=tab9
`)
}
Expand Down
6 changes: 3 additions & 3 deletions tp53.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion workflow/lollipops.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ inputs:
prefix: "-uniprot"
localDomainFile:
doc: "get domain info from a file"
## see: http://pfam.xfam.org/help#tabview=tab9
## see: http://pfam-legacy.xfam.org/help#tabview=tab9
type: File?
inputBinding:
prefix: "-l="
Expand Down

0 comments on commit fa1c5e3

Please sign in to comment.