cmdcolin / jbrowse-plugin-gwas

3 stars 1 forks source link

How to use in jbrowse2 #1

Open demis001 opened 3 years ago

demis001 commented 3 years ago

I have installed and added the CDN as follow to the config.json file? How to use it in tracks? Limited docs

Line added to config.json

 "configuration": {
  "plugins": [
    {
      "name": "gwas",
      "url": "https://unpkg.com/jbrowse-plugin-gwas/dist/jbrowse-plugin-gwas.umd.production.min.js"
    }
  ]
  }

I want to add to this track in config.json

 "tracks": [
    {
      "type": "FeatureTrack",
      "trackId": "meta_cis-eQTL.bed",
      "name": "meta_cis_eQTL",
      "assemblyNames": [
        "GRCh38"
      ],
      "adapter": {
        "type": "BedTabixAdapter",
        "bedGzLocation": {
          "uri": "meta_cis-eQTL.bed.gz"
        },
        "index": {
          "location": {
            "uri": "meta_cis-eQTL.bed.gz.tbi"
          },
          "indexType": "TBI"
        }
      }
demis001 commented 3 years ago

Finally displayed the blue dots after looking the config.json file in your repo. How do you further config the to show the lebel and change the score to -log10(p-value).

cmdcolin commented 3 years ago

This module assumes that scores are already transformed in the data file with -log10(pvalue) scores

I will have to think about how to allow arbitrary transforms at runtime, it causes some complication about "where to put in the architecture" to make arbitrary transformations work properly

This module is also not able to show labels currently

Glad you were able to get this to work thus far though:)

demis001 commented 3 years ago

I can add -log10(p-value) before I index the track, but without adding the label and mouse hover opition, the data is not intractive and informative. I don't know if it is possible with jbrowse2 config options to add this info or not. It is my first time to try it. I liked how it looked but not intractive.

without_admin_server

AimerGDiaz commented 2 years ago

Hi,

I'm here with the same issue than demis, however I did use the same data structure to load my own, but I'm getting this error

issues

I'm using also the same format of the file summary_stats.txt.gz you are using in the example, I wonder if the difference is the way I'm doing the indexing :

chrom start rsid ref alt neg_log_pvalue maf score alt_allele_freq

Chr1 637274 SNP324 A C 4.627953260363213 0.277777777777778 . .

Where I'm using a vcf extension, due to running as a text file I got an error

bgzip file.sort.vcf
tabix   file.sort.vcf.gz 

The error running tabix as generic:

[E::get_intv] Failed to parse TBX_GENERIC, was wrong -p [type] used?

What do you think is my issue ?

cmdcolin commented 2 years ago

@AimerGDiaz you may need to use something like

tabix -s 1 -b 2 -e 2 yourfile.txt.gz

This will tell it that start and end column are the same, and the BedTabixAdapter in jb2 should handle that! let me know if that helps

AimerGDiaz commented 2 years ago

Thank you, it's working now