joiningdata / lollipops

Lollipop-style mutation diagrams for annotating genetic variations.
GNU General Public License v3.0
186 stars 70 forks source link

Local JSON file not recognized #49

Closed leiendeckerlu closed 4 years ago

leiendeckerlu commented 4 years ago

Hi there,

I have some trouble getting lollipops run with a local JSON file.

This is my file:

{
    "length" : "150",
    "regions" : [
      {
        "type" : "pfama",
        "text" : "E6",
        "colour" : "#2dcfff",
        "display": true,
        "startStyle" : "straight",
        "endStyle" : "straight",
        "start" : "1",
        "end" : "150"
      }
    ]
  }

and the command I'm trying is

./lollipops -f="/Library/Fonts/Arial Unicode.ttf" -l="E6.json"

however, the only output I get is the default help screen of lollipops: (so no error message or anything)

Usage: ./lollipops [options] {-Q UNIPROT_DB IDENTIFER | -U UNIPROT_ID | GENE_SYMBOL} [PROTEIN CHANGES ...]

Protein ID input: GENE_SYMBOL is the official human HGNC gene symbol. This will use the UniprotKB API to lookup the UNIPROT_ID.

You can provide a UniProt ID directly with -U (e.g. "-U P04637" for TP53)

For more advanced usage, query UniprotKB's database mappings directly using a supported identifier with -Q DBNAME. Available DBNAMEs can be found here: http://www.uniprot.org/help/programmatic_access#id_mapping_examples

 RefSeq ID        e.g. -Q P_REFSEQ_AC NP_001265252.1
 Entrez GeneID    e.g. -Q P_ENTREZGENEID 4336
 Ensembl ID       e.g. -Q ENSEMBL_ID ENSG00000168314

Protein changes: Currently only point mutations are supported, and may be specified as:

<AMINO><CODON><AMINO><#COLOR><@COUNT>

Only CODON is required, and AMINO tags are not parsed.

Synonymous mutations are denoted if the first AMINO tag matches the second AMINO tag, or if the second tag is not present. Otherwise the non-synonymous mutation color is used. The COLOR tag will override using the #RRGGBB style provided. The COUNT tag can be used to scale the lollipop marker size so that the area is exponentially proportional to the count indicated. Examples:

R273C            -- non-synonymous mutation at codon 273
T125@5           -- synonymous mutation at codon 125 with "5x" marker sizing
R248Q#00ff00     -- green lollipop at codon 248
R248Q#00ff00@131 -- green lollipop at codon 248 with "131x" marker sizing

(N.B. color must come before count in tags)

Diagram generation options: -legend draw a legend for colored regions -syn-color="#0000ff" color to use for synonymous mutation markers -mut-color="#ff0000" color to use for non-synonymous mutation markers -hide-axis do not draw the amino position x-axis -show-disordered draw disordered regions on the backbone -show-motifs draw simple motif regions -labels draw label text above lollipop markers -no-patterns use solid fill instead of patterns (SVG only) -domain-labels=fit hot to apply domain labels (default="truncated") "fit" = only if fits in space available "off" = do not draw text in the domains

Output options: -o=filename.png set output filename (.png or .svg supported) -w=700 set diagram pixel width (default = automatic fit) -dpi=300 set DPI (PNG output only)

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

I also tried to follow the advice given here https://github.com/joiningdata/lollipops/issues/36 and here https://github.com/joiningdata/lollipops/issues/31 but no success so far.

Am I missing something?

Thanks, Lukas

pbnjay commented 4 years ago

Hi Lukas!

Sorry, the local file option is a bit rough / not well documented. It's still expecting a protein reference ID, although it will replace that data with yours. So you need one of the three options here:

{-Q UNIPROT_DB IDENTIFER | -U UNIPROT_ID | GENE_SYMBOL}

You may want to use -o=output.svg to be sure where your output is going too.

leiendeckerlu commented 4 years ago

Hey!

super nice, that fixed it - I did it like this now:

./lollipops -l="./E6.json" -legend -f="/Library/Fonts/Arial Unicode.ttf" -o="json.svg" RB1

It's still a bit confusing that the tool outputs the RB1 associated stuff:

--> SNIP
HGNC Symbol:  RB1
Uniprot returned 155 hits for your gene symbol 'RB1':
Entry   Entry name  Status  Gene names  Organism
P06400  RB_HUMAN    reviewed    RB1 Homo sapiens (Human)
Q8TDY2  RBCC1_HUMAN reviewed    RB1CC1 KIAA0203 RBICC   Homo sapiens (Human)
P42701  I12R1_HUMAN reviewed    IL12RB1 IL12R IL12RB    Homo sapiens (Human)
Q8IUH3  RBM45_HUMAN reviewed    RBM45 DRB1 DRBP1    Homo sapiens (Human)
Q01094  E2F1_HUMAN  reviewed    E2F1 RBBP3  Homo sapiens (Human)
O75832  PSD10_HUMAN reviewed    PSMD10  Homo sapiens (Human)
Q9NY61  AATF_HUMAN  reviewed    AATF CHE1 DED HSPC277   Homo sapiens (Human)
Q14209  E2F2_HUMAN  reviewed    E2F2    Homo sapiens (Human)
Q9UBU8  MO4L1_HUMAN reviewed    MORF4L1 MRG15 FWP006 HSPC008 HSPC061 PP368  Homo sapiens (Human)
--> SNAP

Thanks for your help & very nice tool! Lukas