<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7866762802273936674</id><updated>2024-08-30T12:24:06.312-07:00</updated><category term="python"/><category term="django"/><category term="django easy"/><category term="easy"/><category term="numpy"/><category term="pdb"/><category term="basic"/><category term="biopython"/><category term="entrez"/><category term="file uploading"/><category term="instalacion"/><category term="ncbi"/><category term="periodicalupdater"/><category term="prototype"/><title type='text'>Python para MX</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://pythonmx.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7866762802273936674/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://pythonmx.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03867425341485611030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>10</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7866762802273936674.post-7994282056711718471</id><published>2012-08-25T07:10:00.001-07:00</published><updated>2012-08-25T07:10:48.908-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="numpy"/><category scheme="http://www.blogger.com/atom/ns#" term="pdb"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'>Metro en man: medindo un PDB  </title><summary type="text">Xa escribín antes sobre os PDBs, hoxe toca algo máis metido co&amp;nbsp;formato PDB. Un PDB trae unha lista de átomos con un montón de datos sobre a estructura en xeral e cada átomo en particular. Para esta entrada só nos interesan as liñas de átomos, que son as que comezan con &quot;ATOM&quot;, &quot;HETATM&quot; ou &quot;ANISOU&quot;.








Parseando lixeiramente o archivo


Buscamos estas liñas:



ATOM     10 1HG1 ILE A   1</summary><link rel='replies' type='application/atom+xml' href='http://pythonmx.blogspot.com/feeds/7994282056711718471/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7866762802273936674/7994282056711718471' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7866762802273936674/posts/default/7994282056711718471'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7866762802273936674/posts/default/7994282056711718471'/><link rel='alternate' type='text/html' href='http://pythonmx.blogspot.com/2012/08/metro-en-man-medindo-un-pdb.html' title='Metro en man: medindo un PDB  '/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03867425341485611030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7866762802273936674.post-5505868521597614676</id><published>2012-06-27T01:56:00.000-07:00</published><updated>2012-06-27T02:04:17.496-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="numpy"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'></title><summary type="text">
Regresión polinomial (extremely easy)
Usando a librería numpy&amp;nbsp;podemos axustar unha curva de predicción a datos empíricos en catro liñas. Supoñamos que temos un programa que&amp;nbsp;analiza&amp;nbsp;texto. Funciona moi ben nos textos de proba, pero intuimos que textos de máis de 40 millóns de caracteres pode bloquear ou eternizar o script. ¿Cómo facer unha estima a priori de cánto tardará o script?</summary><link rel='replies' type='application/atom+xml' href='http://pythonmx.blogspot.com/feeds/5505868521597614676/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7866762802273936674/5505868521597614676' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7866762802273936674/posts/default/5505868521597614676'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7866762802273936674/posts/default/5505868521597614676'/><link rel='alternate' type='text/html' href='http://pythonmx.blogspot.com/2012/06/regresion-polinomial-extremely-easy.html' title=''/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03867425341485611030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7866762802273936674.post-8897165883239563249</id><published>2012-01-09T01:23:00.000-08:00</published><updated>2012-01-09T01:26:15.032-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="easy"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'>Exemplo de funcións recursivas</title><summary type="text">Donato publicaba sobre recursividade o mes pasado. Todos os exemplos de funcións de recursividade son sobre sucesións como a de Fibonacci, factorial, etc. e nunca se ven casos máis mundanos de recursividade.
Resulta que me tocou meter unha función de recursividade no noso servidor de modelado de GPCRs, e penso que como exemplo pode ser bastante útil.


O problema
No formulario de entrada </summary><link rel='replies' type='application/atom+xml' href='http://pythonmx.blogspot.com/feeds/8897165883239563249/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7866762802273936674/8897165883239563249' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7866762802273936674/posts/default/8897165883239563249'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7866762802273936674/posts/default/8897165883239563249'/><link rel='alternate' type='text/html' href='http://pythonmx.blogspot.com/2012/01/exemplos-de-funcions-recursivas.html' title='Exemplo de funcións recursivas'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03867425341485611030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7866762802273936674.post-7659546695538666609</id><published>2011-10-24T08:19:00.000-07:00</published><updated>2011-10-24T08:21:55.885-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="django"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'>Diferentes páxinas para dispositivos móviles e fixos</title><summary type="text">









Problema
Temos páxinas que se leen con dificultade en dispositivos móviles, como iPhone e Android. Buscando por ahí adiante atopéi varios enfoques, e o máis extendido é analizar a petición do cliente (HTTP_USER_AGENT sobre todo) para ver si pertence a un dispositivo móvil. Unha vez determinado, aplicar a solución requerida









A base

Partín da base de Django mobile utils, que </summary><link rel='replies' type='application/atom+xml' href='http://pythonmx.blogspot.com/feeds/7659546695538666609/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7866762802273936674/7659546695538666609' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7866762802273936674/posts/default/7659546695538666609'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7866762802273936674/posts/default/7659546695538666609'/><link rel='alternate' type='text/html' href='http://pythonmx.blogspot.com/2011/10/diferentes-paxinas-para-dispositivos.html' title='Diferentes páxinas para dispositivos móviles e fixos'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03867425341485611030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7866762802273936674.post-7391342174275008096</id><published>2011-07-13T09:04:00.000-07:00</published><updated>2011-07-13T09:32:24.992-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="basic"/><category scheme="http://www.blogger.com/atom/ns#" term="biopython"/><category scheme="http://www.blogger.com/atom/ns#" term="pdb"/><title type='text'>Conseguir a secuencia de un PDB</title><summary type="text">ProblemaTemos un archivo .pdb, e queremos extraer a secuencia de aminoácidos de unha soa letra. Atopei algunha solución por internet, pero implica importar a librería Bio.PDB.Polypeptide.PPBuilder, e resultábame un método algo escuro. Así que busquei ata atopar o diccionario que traduza código de tres letras a código de unha letra.Libreríasfrom Bio.SCOP.Raf import to_one_letter_codefrom Bio.PDB </summary><link rel='replies' type='application/atom+xml' href='http://pythonmx.blogspot.com/feeds/7391342174275008096/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7866762802273936674/7391342174275008096' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7866762802273936674/posts/default/7391342174275008096'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7866762802273936674/posts/default/7391342174275008096'/><link rel='alternate' type='text/html' href='http://pythonmx.blogspot.com/2011/07/conseguir-secuencia-de-un-pdb.html' title='Conseguir a secuencia de un PDB'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03867425341485611030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7866762802273936674.post-67806708494566778</id><published>2011-05-09T00:18:00.000-07:00</published><updated>2011-05-09T00:30:51.099-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="easy"/><category scheme="http://www.blogger.com/atom/ns#" term="entrez"/><category scheme="http://www.blogger.com/atom/ns#" term="ncbi"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'>A API do NCBI</title><summary type="text">A veces teremos que consultar de forma masiva o NCBI. O normal é baixarse un xenoma que está en miles de trozos, ou que nun artigo nos digan que subiron as secuencias AE000001-AE001000.Imos facer un pequeniño script para facer este tipo de consultas fácilmente. Primeiro conseguimos os id de referencia. Por exemplo, si queremos baixar as secuencias de Aedes aegypti, miramos no artigo http://</summary><link rel='replies' type='application/atom+xml' href='http://pythonmx.blogspot.com/feeds/67806708494566778/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7866762802273936674/67806708494566778' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7866762802273936674/posts/default/67806708494566778'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7866762802273936674/posts/default/67806708494566778'/><link rel='alternate' type='text/html' href='http://pythonmx.blogspot.com/2011/05/api-do-ncbi.html' title='A API do NCBI'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03867425341485611030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7866762802273936674.post-989362880937893213</id><published>2011-04-29T04:15:00.000-07:00</published><updated>2011-05-30T00:20:34.345-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="django"/><category scheme="http://www.blogger.com/atom/ns#" term="django easy"/><category scheme="http://www.blogger.com/atom/ns#" term="file uploading"/><title type='text'>Generic views con ForeignKey(User)</title><summary type="text">Con generic views podemos facer os accesos máis comúns á base de datos (engadir, borrar, editar, consultas...). A veces haberá que facer pequenos engadidos de código para conseguir axustes. Hoxe vamos ver cómo subir archivos ó servidor sin perder o trazo dos donos deses archivos.models.pyQueremos aceptar un archivo que o usuario sube, e que o usuario lle dea unha descripción ó archivo. Comprobar </summary><link rel='replies' type='application/atom+xml' href='http://pythonmx.blogspot.com/feeds/989362880937893213/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7866762802273936674/989362880937893213' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7866762802273936674/posts/default/989362880937893213'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7866762802273936674/posts/default/989362880937893213'/><link rel='alternate' type='text/html' href='http://pythonmx.blogspot.com/2011/04/generic-views-con-foreignkeyuser.html' title='Generic views con ForeignKey(User)'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03867425341485611030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7866762802273936674.post-7422452116047107405</id><published>2011-04-06T01:02:00.000-07:00</published><updated>2011-11-08T02:05:54.676-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="django easy"/><title type='text'>Django con generic views</title><summary type="text">Nota: generic_views a partir de Django 1.3 compórtanse como clases, tal e como indican no manual (migración)

Imos progresando con Django. Onte descubrín as generic_views, e de cómo levo facendo o &quot;mono&quot; creando funcións en views.py para cargar os modelos da base de datos. generic_views veñen na instalación de Django en django.views.generic, así que abrimos unha consola python/django
python </summary><link rel='replies' type='application/atom+xml' href='http://pythonmx.blogspot.com/feeds/7422452116047107405/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7866762802273936674/7422452116047107405' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7866762802273936674/posts/default/7422452116047107405'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7866762802273936674/posts/default/7422452116047107405'/><link rel='alternate' type='text/html' href='http://pythonmx.blogspot.com/2011/04/django-con-generic-views.html' title='Django con generic views'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03867425341485611030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7866762802273936674.post-6374069385198522875</id><published>2011-03-16T09:53:00.000-07:00</published><updated>2011-03-16T10:22:34.239-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="periodicalupdater"/><category scheme="http://www.blogger.com/atom/ns#" term="prototype"/><title type='text'>Prototype + JSON + HTML</title><summary type="text">Hoxe sí que rompín os cornos cunha nadería. Question is, temos un cálculo longo nun clúster, e queremos ir actualizando a páxina web según vaian saíndo os resultados, vía Ajax (prototype). Ahí vai o script no lado do cliente:function test_job(){    var html_target = $(&#39;status&#39;); /* modificaremos o &amp;lt;div id=&quot;status&quot;&amp;gt;&amp;lt;/div&amp;gt;*/    var html_target2 = $(&#39;results&#39;); /* cando rematemos, </summary><link rel='replies' type='application/atom+xml' href='http://pythonmx.blogspot.com/feeds/6374069385198522875/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7866762802273936674/6374069385198522875' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7866762802273936674/posts/default/6374069385198522875'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7866762802273936674/posts/default/6374069385198522875'/><link rel='alternate' type='text/html' href='http://pythonmx.blogspot.com/2011/03/prototype-json-html.html' title='Prototype + JSON + HTML'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03867425341485611030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7866762802273936674.post-5199782381212106162</id><published>2008-06-20T03:03:00.000-07:00</published><updated>2008-06-20T03:08:06.521-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="instalacion"/><title type='text'>Instalación de python</title><summary type="text">Para instalar python nun Windows NT (NT, 2000, XP, Vista) haberá que baixarse o instalador da páxina oficial: Instaladores. Escollemos o último publicado (hoxe é 2.5.2), chegamos á páxina onde podemos precisar o sistema operativo e procesador. Normalmente o de &quot;x86 processors&quot; sirve, ainda que si sabemos fixo que temos un 64 bits Intel ou AMD podemos tentar esa versión en concreto. Unha vez </summary><link rel='replies' type='application/atom+xml' href='http://pythonmx.blogspot.com/feeds/5199782381212106162/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7866762802273936674/5199782381212106162' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7866762802273936674/posts/default/5199782381212106162'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7866762802273936674/posts/default/5199782381212106162'/><link rel='alternate' type='text/html' href='http://pythonmx.blogspot.com/2008/06/instalacin-de-python.html' title='Instalación de python'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/03867425341485611030</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>