This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() {var map={},url=document.location.href.split("/").slice(0,-1).concat(["dta","ipi_name.table"]).join("/");$.get(url).done(function(t){for(var e,n=[],a=/(\w+).+\n?/g;null!==(e=a.exec(t));)n.push(e[1]);n=n.splice(1);for(var r=[];n.length;){for(var i="",o=n.splice(0,10),l=0,c=o.length;c>l;l++)i+="accession:"+o[l]+" OR ";i=i.slice(0,-4);var s=$.get("http://www.uniprot.org/uniprot/",{query:i,columns:"id,mass",format:"tab"});s.done(function(t){for(var n=/(\w+)\t([\w,]+)\n?/g;null!==(e=n.exec(t));)map[e[1]]=e[2]}),r.push(s)}$(function(){{var t=$("tbody tr"),e=t.eq(0).find("th:last");!$.trim(t.eq(0).children("td").eq(1).text())}e.after(e.clone().text("mass")),t.eq(1).find("th:last").after(e.clone().empty()),$("colgroup:last").after("<colgroup span=1 />"),t=t.slice(2),t.append("<td />"),$.when.apply(this,r).done(function(){t.each(function(){var t=$(this);if($.trim(t.find("td:first").text())){var e=$.trim(t.find("td:eq(1)").text());map.hasOwnProperty(e)&&t.find("td:last").text(map[e])}})})})});})() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ = requirejs('jquery'); | |
var $rows = $('tbody tr').slice(2), | |
group = null; | |
$rows.each(function() { | |
var $this = $(this), | |
id = $this.find('td').eq(0).text().trim(); | |
if (id) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sorted_data = sorted(data, key=lambda x: x['Sample name']) | |
by_sample_name = itertools.groupby(sorted_data, key=lambda x: x.get('Sample name')) | |
grouped = [] | |
for name, g in by_sample_name: | |
d = list(g) | |
grouped.append( | |
'\t'.join([ | |
name, | |
str(len(d)), | |
','.join(set([x['Primary site'] for x in d])), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'''Simplistic isoform filtering.''' | |
from Levenshtein import distance | |
import math | |
for sequence, item in d.items(): | |
row = [] | |
for protein in item: | |
min_distance = math.inf | |
symbol = protein[2] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var els = Array.from(document.getElementsByTagName('tr')); | |
els.shift(); | |
var processed = [] | |
for (let el of els) { | |
if (!el.hasChildNodes()) { | |
continue; | |
} |
OlderNewer