Comments (1)
Ok, nevermind, I mostly copy-pasted the new E! transcript track model, have a very little idea of how it works. but it works now. Thanks!
GenoverseUtils.prototype.RNAcentralParseData = function(data) {
var model = this;
var featuresById = this.featuresById;
var ids = [];
data.filter(function (d) { return d.feature_type === 'transcript'; }).forEach(function (feature, i) {
if (!featuresById[feature.id]) {
// prepare a label
var label = feature.description || feature.external_name;
if (label.length > 50) {
label = label.substr(0, 47) + "...";
}
if (feature.strand == 1) {
label = label + " >";
}
else if (feature.strand == -1) {
label = "< " + label;
}
feature.id = feature.ID;
feature.label = label; // used to be feature.external_name
feature.exons = {};
feature.subFeatures = [];
feature.cdsStart = Infinity;
feature.cdsEnd = -Infinity;
feature.chr = feature.seq_region_name;
feature.color = '#8B668B';
model.insertFeature(feature);
ids.push(feature.id);
}
});
data.filter(function (d) { return d.feature_type === 'exon' && featuresById[d.Parent] && !featuresById[d.Parent].exons[d.id]; }).forEach(function (feature) {
feature.id = feature.ID;
feature.chr = feature.seq_region_name;
if (feature.end < featuresById[feature.Parent].cdsStart || feature.start > featuresById[feature.Parent].cdsEnd) {
feature.utr = true;
} else if (feature.start < featuresById[feature.Parent].cdsStart) {
featuresById[feature.Parent].subFeatures.push($.extend({ utr: true }, feature, { end: featuresById[feature.Parent].cdsStart }));
feature.start = featuresById[feature.Parent].cdsStart;
} else if (feature.end > featuresById[feature.Parent].cdsEnd) {
featuresById[feature.Parent].subFeatures.push($.extend({ utr: true }, feature, { start: featuresById[feature.Parent].cdsEnd }));
feature.end = featuresById[feature.Parent].cdsEnd;
}
featuresById[feature.Parent].subFeatures.push(feature);
featuresById[feature.Parent].exons[feature.id] = feature;
// set colors
feature.color = false;
feature.borderColor = '#8B668B';
});
ids.forEach(function (id) {
featuresById[id].subFeatures.sort(function (a, b) { return a.start - b.start; });
});
};
from genoverse.
Related Issues (20)
- jquery-ui clashes with d3 for mouseup event HOT 3
- Can you make a bundle without jquery and other standard dependencies, available via npm? HOT 6
- How to display highlights? What's the difference between highlights and mouse drag action mode highlights? HOT 2
- Convert highlights to histogram HOT 7
- Sequence track dissapears HOT 1
- Track for read coverage 2018
- Track for Coverage 2018 HOT 4
- genoverse leaves some dangling deferreds after browser.destroy() HOT 2
- Is it possible to use pyensembl local database with Genoverse? HOT 1
- How practical HOT 1
- ScatterPlots? HOT 1
- website is broken HOT 1
- How to configure local BED/BAM file as data source? HOT 3
- Does Genoverse browser fit .bb(bigbed) file? HOT 1
- How to load my own genome feature in the Genoverse tracks?
- How to load my own genome feature in the Genoverse tracks?
- How can i load my local genome feature file and perform it in the web? HOT 4
- When performing a location query, the URL makes two requests.
- Vue2 templates HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from genoverse.