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

Bigwig parsing and rendering support added #42

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
0b0b344
BED parsing and rendering
sourabh2k15 Jul 28, 2017
337952b
Fetching added functionality Graph.Bar and Graph.Line
sourabh2k15 Jul 28, 2017
9516dc4
fixed rendering BEDbug ( pun intended ) caused due to conflict betwee…
sourabh2k15 Jul 28, 2017
2a25369
restored expanded.html to default state, removing test BED track
sourabh2k15 Jul 28, 2017
888fac1
implemented code changes as per review #1
sourabh2k15 Jul 28, 2017
1f248e8
implemented code changes as per review #2
sourabh2k15 Jul 28, 2017
e4f5fd2
Merge remote-tracking branch 'upstream/gh-pages' into gh-pages
sourabh2k15 Aug 2, 2017
c3507bf
removed .pop() from Track/Model/File/BED and added .filter()
sourabh2k15 Aug 2, 2017
e1ebb5d
merged changes from main repo
sourabh2k15 Aug 3, 2017
5ad69df
wiggle parsing and rendering using Graph.Bar
sourabh2k15 Aug 3, 2017
0eff5a6
made changes as per code review #1 ( added support for variableStep w…
sourabh2k15 Aug 4, 2017
95e8344
Merge remote-tracking branch 'upstream/gh-pages' into wig
sourabh2k15 Aug 4, 2017
df694a7
reverted expanded.html to default state
sourabh2k15 Aug 4, 2017
1681509
removed line.split() for fixedStep and set track height=100
sourabh2k15 Aug 4, 2017
649500c
Merge remote-tracking branch 'upstream/gh-pages' into wig
sourabh2k15 Aug 7, 2017
77936dc
implemented code changes as per review #2
sourabh2k15 Aug 7, 2017
bbb4d5f
Merge remote-tracking branch 'upstream/gh-pages' into bigwig
sourabh2k15 Aug 13, 2017
8d4a5d8
added bigwig support
sourabh2k15 Aug 17, 2017
f01372b
added bigwig dependencies to expanded.html
sourabh2k15 Aug 17, 2017
ac462f9
made changes in bigwig PR as per code review #1
sourabh2k15 Aug 17, 2017
35861db
Tidying
simonbrent Aug 21, 2017
bfc0257
Stop BWReader from restricting data returned from WiggleParser to the…
simonbrent Aug 21, 2017
1852edb
Cache data fetched by BWReader, to reduce read operations further
simonbrent Aug 21, 2017
8d63894
fixed BEDParser and enabled support for BIGBED
sourabh2k15 Aug 24, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions expanded.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<script type="text/javascript" src="js/lib/jDataView.js"></script>
<script type="text/javascript" src="js/lib/jParser.js"></script>
<script type="text/javascript" src="js/lib/VCFReader.js"></script>
<script type="text/javascript" src="js/lib/BWReader.js"></script>
<script type="text/javascript" src="js/Genoverse.js"></script>
<script type="text/javascript" src="js/Track.js"></script>
<script type="text/javascript" src="js/Track/Controller.js"></script>
Expand Down Expand Up @@ -59,6 +60,7 @@
<script type="text/javascript" src="js/Track/Model/File/GFF.js"></script>
<script type="text/javascript" src="js/Track/Model/File/VCF.js"></script>
<script type="text/javascript" src="js/Track/Model/File/WIG.js"></script>
<script type="text/javascript" src="js/Track/Model/File/BIGWIG.js"></script>
<script type="text/javascript" src="js/Track/library/Chromosome.js"></script>
<script type="text/javascript" src="js/Track/library/dbSNP.js"></script>
<script type="text/javascript" src="js/Track/library/File.js"></script>
Expand All @@ -67,6 +69,7 @@
<script type="text/javascript" src="js/Track/library/File/GFF.js"></script>
<script type="text/javascript" src="js/Track/library/File/VCF.js"></script>
<script type="text/javascript" src="js/Track/library/File/WIG.js"></script>
<script type="text/javascript" src="js/Track/library/File/BIGWIG.js"></script>
<script type="text/javascript" src="js/Track/library/Gene.js"></script>
<script type="text/javascript" src="js/Track/library/HighlightRegion.js"></script>
<script type="text/javascript" src="js/Track/library/Legend.js"></script>
Expand Down
19 changes: 19 additions & 0 deletions js/Track/Model/File/BIGWIG.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Genoverse.Track.Model.File.BIGWIG = Genoverse.Track.Model.Graph.Bar.extend({

getData : function(chr, start, end){
var model = this;
var deferred = $.Deferred();

if(!this.url) this.data = new dallianceLib.BlobFetchable(this.track.dataFile);
else this.data = new dallianceLib.URLFetchable(this.url);
Copy link
Contributor

@simonbrent simonbrent Aug 17, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace the above two lines with

this.bigwigFile = this.bigwigFile || (this.url ? new dallianceLib.URLFetchable(this.url) : new dallianceLib.BlobFetchable(this.track.dataFile));

so that we don't make a new dallianceLib object every time getData is called

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ohh right I will do that


new BWReader(this.data, this.name, function(bw){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Replace this.data with this.bigwigFile
  • We need to cache the BWReader (like the VCFReader is cached) to avoid making requests for the header of the file every time getData is called

bw.getValues(chr, start, end, function(features){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is possible for bw to be null - need to check for this and immediately resolve the deferred if it is the case

model.receiveData(features, chr, start, end);
deferred.resolveWith(model);
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please replace tabs with spaces

});

return deferred;
}
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add ; to the end of the file

5 changes: 5 additions & 0 deletions js/Track/library/File/BIGWIG.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Genoverse.Track.File.BIGWIG = Genoverse.Track.Graph.Bar.extend({
model : Genoverse.Track.Model.File.BIGWIG,
name : 'bigwig',
height : 100
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Please add ; to the end of the file
  • Also add the line Genoverse.Track.File.BW = Genoverse.Track.File.BIGWIG; to allow drag/drop to work (the file ending is .bw rather than .bigwig)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have seen files with both so adding this line will then allow suppor for both extensions

Loading