Add new track type: GwasTrack #493
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi again,
I went back and re-visited the implementation of my proposed "GWAS track". This is a minimal implementation. I'll be very happy to build it up further, but I wanted to check that I was doing things right first.
Description
The track takes data from an IGV
.gwasfile (see format here), and draws a scatterplot where the x-axis is the genomic position and the y-axis is the negative log of the p-value (so the smaller the exponent, the higher it will appear).This is the same as a localized Manhattan plot. It is useful when trying to visualize GWAS variants in relation to nearby genes, open chromatin, etc., and it's common to illustrate loci of interest in this way with tools like LocusZoom. The UCSC browser also has a built-in track with hits from the GWAS Catalog specifically to do lookups like this.
Example image:

Implementation details
I tried to keep things small and match the style of the other tracks.
I've added a GwasTrack.py script, a corresponding test script, and test and example files.
The one thing I'm unsure about is the reading to the data from the file. I wanted to avoid additional dependencies, so created a
ReadGwasclass. It is inspired on the 'readBed.py' file in the repo. Please let me know if I should use another approach instead, like keeping the file reading logic toGwasTrack.pyor using a dependency like Pandas to keep the file-reading neat.Thanks!