Interactive demo | genome1/40-dbptm

Intro

Searches for all post translational modifications for the specified gene.
Run
Server offline
Idle

Parameters

Result

(none yet)

Sample api request

Source code

def endpoint(gene:str="FTO") -> serve.html():
    """Searches for all post translational modifications for the specified gene."""
    a = base | ls() | apply(cat() | ~head(2) | table() | grep(gene, col=0) | groupBy(0, True) | apply(head(1000), 1) | head(30)) | deref() | filt(len) | joinSt() | groupBy(0, True) | head(7) | apply(joinSt(2) | toInt(1), 1) | deref()
    b = a | apply(cut(1, 2), 1) | deref(); labels, coords = b | cut(1) | insertIdColumn() | ungroup() | ~apply(lambda x,y: [x,*y]) | groupBy(2, True) | transpose() | deref()
    coords | apply(permute(1, 0) | transpose() | ~aS(plt.scatter, marker=".")) | deref(); plt.legend(labels, framealpha=0.5); plt.grid(True); plt.xlabel("Position in protein sequence")
    b | cut(0) | insertIdColumn() | ~apply(lambda y,name: plt.text(0, y+0.1, name)) | deref(); plt.ylim(-1, len(a)*1.5)
    details = a | apply(apply(head(30), 3), 1) | transpose() | iden() + ~pretty() | transpose() | apply(join("\n") | aS(fmt.pre), 1) | apply(fmt.h, 0, level=3) | joinSt() | join("\n")
    im = plt.gcf() | toImg(); return [im | toHtml(), details] | viz.Carousel() | toHtml()