Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"any data frame" flexibilty needed with gwas data #32

Open
paul-shannon opened this issue Sep 2, 2022 · 4 comments
Open

"any data frame" flexibilty needed with gwas data #32

paul-shannon opened this issue Sep 2, 2022 · 4 comments

Comments

@paul-shannon
Copy link
Collaborator

@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
Copy link
Collaborator Author

@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?

@vjcitn
Copy link
Contributor

vjcitn commented Sep 28, 2022

Sounds good!

@paul-shannon
Copy link
Collaborator Author

@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.

@gladkia
Copy link
Owner

gladkia commented Jan 13, 2024

Hi @vjcitn.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants