Skip to content

Instantly share code, notes, and snippets.

@mercutio22
Created August 8, 2012 20:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mercutio22/3298349 to your computer and use it in GitHub Desktop.
Save mercutio22/3298349 to your computer and use it in GitHub Desktop.
exemplo de template
{% extends "base_search_bar.html" %}
{% block title %} Gene | {{ gene.symbol }} {% endblock title %}
{% block extra-head %}
{{ block.super }}
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}django_tables2/themes/paleblue/css/screen.css" />
{% endblock extra-head %}
{% block content %}
<h1>{{ gene.description }}</h1>
<div id="content-info">
<div class="info summary">
<h2>Summary</h2>
<dl>
<dt>Official symbol:</dt>
<dd><a target="_blank" href="http://www.ncbi.nlm.nih.gov/gene/{{ gene.entrez_id }}">{{ gene.symbol }}</a></dd>
<dt>Full name:</dt>
<dd>{{ gene.description }} </dd>
{% if gene.genesynonyms_set.all %}
<dt>Other aliases:</dt>
<dd>
{% for acronym in gene.genesynonyms_set.all %}
{{ acronym.symbol }}
{% endfor %}
</dd>
{% endif %}
<dt>Gene type:</dt>
<dd>{{ gene.type }}</dd>
{% if gene.ensembl_id %}
<dt>Ensembl:</dt>
<dd><a target="_blank" href="http://www.ensembl.org/id/{{ gene.ensembl_id }}">{{ gene.ensembl_id }}</a></dd>
{% endif %}
{% if gene.hgnc_id %}
<dt>HGNC:</dt>
<dd><a target="_blank" href="http://www.genenames.org/data/hgnc_data.php?hgnc_id={{ gene.hgnc_id }}">{{gene.hgnc_id }}</a></dd>
{% endif %}
<dt>Entrez gene:</dt>
<dd><a target="_blank" href="http://www.ncbi.nlm.nih.gov/gene/{{ gene.entrez_id }}">{{ gene.entrez_id }}</a></dd>
{% if gene.summary %}
<dt>Summary:</dt>
<dd>{{ gene.summary }}</dd>
{% endif %}
</dl>
</div>
<div class="info genomic_context">
<h2>Genomic context</h2>
<dl>
<dt>Chromosome:</dt>
<dd>{{ region.chromosome }}</dd>
<dt>Strand:</dt>
<dd>{{ region.strand }}</dd>
<dt>Start:</dt>
<dd>{{ region.tx_start }}</dd>
<dt>End:</dt>
<dd>{{ region.tx_end }}</dd>
</dl>
<div id="diagram">
<figure id="gene-sketch">
<img src="{% filter force_escape %}{{ STATIC_URL }}/genes/{{ gene.symbol }}.PNG{% endfilter %}" alt="Gene diagram" />
<figcaption id="sketch-caption">schematic diagram of {{ gene.symbol }}</figcaption>
</figure>
</div>
{% if gene.mirnainformation_set.all|length %}
<h3 class="has-micro">Intragenic microRNAs</h3>
<table width="100%">
<thead>
<tr>
<th>miRNA</th>
<!-- <th>coordinates</th> -->
<th>region</th>
<th>intron/exon number</th>
<th>distance from 5' exon</th>
<th>direction</th>
</tr>
</thead>
<tbody>
{% for mirna in gene.mirnainformation_set.all %}
<tr>
<td><a href="{% url miRNA_info slug=mirna.symbol %}">{{ mirna }}</a></td>
{#<td>{{ mirna.start }}..{{ mirna.end }}</td> #}
{% if mirna.exonic == 0 %}
<td>intronic</td>
{% else %}
<td>exonic</td>
{% endif %}
<td>{{ mirna.intron_exon_number }}</td>
<td>{{ mirna.distance_exon_upstream }}</td>
{% if mirna.direction == "++" or mirna.direction == "--" %}
<td>sense</td>
{% else %}
<td>antisense</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p class="no-micro">There are no microRNAs mapped within <span>{{ gene.symbol }}</span> in our database</p>
{% endif %}
</div> <!-- end of genomic context -->
<div class="info mirna-binding-sites">
<h2>microRNA binding sites </h2>
{% if region.targetinteractionsummary_set.exists %}
{% load render_table from django_tables2 %}
{% render_table TargetsTable %}
{% else %}
<p> There are no {{ gene.symbol }} microRNA binding sites described in our database.</p>
{% endif %}
</div> <!-- end of mirna-binding-sites -->
<div class="info alternative-polya">
<h2>Alternative polyadenilation</h2>
blalbal
</div> <!-- end of alternative poly-a -->
<div class="info prot-interaction">
<h2>Protein-protein interactions</h2>
{% if gene.primary_interactions.exists %}
{% load render_table from django_tables2 %}
{% render_table piTable %}
{% else %}
<p class="no-prot">There are no protein interactions for <span>{{ gene.symbol }}</span> in our database.</p>
{% endif %}
</div> <!-- end of protein interactions -->
</div> <!-- end of content info -->
<div id="sidebar">
<h4 class="first">External links</h4>
<ul>
<li class="first"><a target="_blank" href="http://www.ncbi.nlm.nih.gov/gene/{{ gene.entrez_id }}">NCBI Entrez</a></li>
<li><a
target="_blank"
href="http://genome.ucsc.edu/cgi-bin/hgTracks?hgHubConnect.destUrl=..%2Fcgi-bin%2FhgTracks&clade=mammal&org=Human&db=hg19&position={{ region.chromosome }}%3A{{ region.tx_start }}-{{ region.tx_end }}&hgt.suggest=&hgt.suggestTrack=knownGene&Submit=submit&hgsid=279582653"
>
UCSC Genome Browser</a></li>
<li><a target="_blank" href="http://www.ensembl.org/id/{{ gene.ensembl_id }}">Ensembl</a></li>
<li class="last"><a target="_blank" href="http://www.genome.jp/dbget-bin/www_bget?hsa:{{ gene.entrez_id }}">KEGG</a></li>
</ul>
<h4>MicroRNA related</h4>
<ul>
<li class="first"><a target="_blank" href="http://www.targetscan.org">TargetScan</a></li>
<li><a target="_blank" href="http://www.ebi.ac.uk/enright-srv/microcosm/cgi-bin/targets/v5/hit_list.pl?genome_id=2964&mirna_id=&external_name={{ gene.symbol }}&gene_id=&go_class=function&go_term=&logic=phrase&terms=">MicroCosm</a></li>
<li><a href="">Mirbase</a></li>
<li class="last"><a href="">Mirbase</a></li>
</ul>
</div>
{% endblock %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment