igvShiny icon indicating copy to clipboard operation
igvShiny copied to clipboard

"any data frame" flexibilty needed with gwas data

Open paul-shannon opened this issue 2 years ago • 4 comments

@vjcitn - new issue to ease tracking.

emulate these parameters in igvR:

track <- GWASTrack("gwas 5k", tbl.gwas, chrom.col=12, pos.col=13, pval.col=28)

paul-shannon avatar Sep 02 '22 21:09 paul-shannon

@vjcitn and @stankiewicz565 Vince asks:

I am wondering about the relationship between GWASTrack in igvR
and loadGwasTrack in igvShiny.  They seem unconnected.

Also, the doc on loadGwasTrack indicates "chrom" "start" and "end" are needed
in the input table, but the demo has a file that has column names


> head(tbl.gwas)
             SNPS      cptid CHR_ID  CHR_POS EA NEA  EAF    Beta     SE
14517  rs79350681  1:5330646      1  5330646  a   g 0.02 -0.7356 0.1875
14527 rs187641513  1:5331868      1  5331868  a   g 0.02 -0.7424 0.1889
37614  rs72633929 1:13948877      1 13948877  t   g 0.07  0.3723 0.0854
37616  rs17390405 1:13949087      1 13949087  a   g 0.08  0.3191 0.0697
52418  rs12137337 1:18390936      1 18390936  a   g 0.03  0.5345 0.1267
54188  rs56150119 1:18837047      1 18837047  t   g 0.93 -0.2962 0.0721
        P.VALUE Effective_N

It would be great to reuse the igvR GWASTrack ... is that actually supported?

Until some hoped-for eventual unification of igvR and igvShiny, I think the best solution is to emulate, in igvShiny, the GWASTrack class API from igvR. There is an inheritance hierarchy to which igvR's GWASTrack belongs. I am reluctant to port all that over right now.

Here's a question for you: igvR has both GWASTrack and GWASUrlTrack classes. I favor a single polymorphic class which is smart enough to discern what data (direct or at a url) it is being offered. So I propose to create a simple single GWASTrack for igvShiny (and eventually for igvR also). The data argument in the constructor could be a url or a data.frame. The constructor would test and do the right thing.

Regarding the use of/requirement for chrom/pos/pval columns: I follow Jim Robinson on "the GWAS format", though I now understand that this may not be a true standard. I imagine that the table excerpt that you show works because of its use of standard (in some sense) column names. I also once got the impression - I might be wrong- that a common gwas file structure had chromosome in column 12, position in 13, and pvalue in 28.

All that seems opaque and tricky - and easily sidestepped by requiring explicit chrom, pos, and pvalue columns to be supplied in all cases. Not burdensome, I don't think.

So how about a single GWASTrack S4 class constructor, able to handle both data.frames and urls, requiring explicit chrom/pos/pvalue column numbers?

paul-shannon avatar Sep 28 '22 20:09 paul-shannon

Sounds good!

vjcitn avatar Sep 28 '22 20:09 vjcitn

@vjcitn version 1.5.5 has new S4 class, GWASTrack, just merged into the master branch. Accompanied by

  • inst/unitTests/test_GWASTrack.R
  • inst/demos/igvShinyDemo-GWASTrackClass.R The data argument can be either a data.frame or a url.
    chrom/pos/pvalue columns must be specified.

Vince - I'd be glad to test further with a sampling of your GWAS urls.

paul-shannon avatar Sep 29 '22 03:09 paul-shannon

Hi @vjcitn.

Is there anything that can be done in case of this task?

gladkia avatar Jan 13 '24 10:01 gladkia