User:Lindenb/Notebook/UMR915/2012/04/02: Difference between revisions

From OpenWetWare
< User:Lindenb‎ | Notebook‎ | UMR915‎ | 2012‎ | 04
Jump to navigationJump to search
Line 86: Line 86:


   $ django-admin startproject gene2pubmed
   $ django-admin startproject gene2pubmed


<pre>$ find gene2pubmed/
<pre>$ find gene2pubmed/
Line 93: Line 95:
gene2pubmed/manage.py
gene2pubmed/manage.py
gene2pubmed/settings.py</pre>
gene2pubmed/settings.py</pre>
Edit gene2pubmed/settings.py
and set the default db to sqlite3:
<pre>DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
        'NAME': 'gene2pubmed.sqlite3',                      # Or path to database file if using sqlite3.
        'USER': '',                      # Not used with sqlite3.
        'PASSWORD': '',                  # Not used with sqlite3.
        'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
        'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
    }
}</pre>
set the local time in gene2pubmed/settings.py
<pre>TIME_ZONE = 'Europe/Paris'</pre>
synchronize installation for sessions, messages, etc...
<pre>python manage.py syncdb
$ python manage.py syncdb
Creating tables ...
Creating table auth_permission
Creating table auth_group_permissions
Creating table auth_group
Creating table auth_user_user_permissions
Creating table auth_user_groups
Creating table auth_user
Creating table auth_message
Creating table django_content_type
Creating table django_session
Creating table django_site
You just installed Django's auth system, which means you don't have any superusers defined.
Would you like to create one now? (yes/no): y
Please enter either "yes" or "no": yes
Username (Leave blank to use 'lindenb'):
E-mail address: xxxx@xxxx.xxx
Password:
Password (again):
Superuser created successfully.
Installing custom SQL ...
Installing indexes ...
No fixtures found.</pre>


testing the development server:
testing the development server:

Revision as of 06:22, 2 April 2012

Project name <html><img src="/images/9/94/Report.png" border="0" /></html> Main project page
<html><img src="/images/c/c3/Resultset_previous.png" border="0" /></html>Previous entry<html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</html>Next entry<html><img src="/images/5/5c/Resultset_next.png" border="0" /></html>

Daily

variant_effect_predictor.pl

Fix for proxy

replace

 	unless(getstore($url, $target_file) == 200)

by

      my $status = system("/usr/bin/curl --proxy 'http://proxy:3128' -o '$target_file' -L  '$url'");
     (...)
      my $status2 = system("/usr/bin/curl --proxy 'http://proxy:3128' -o '$target_file' -L --create-dirs '$BIOPERL_URL,'");


some problems with the bioperl install, downloaded the tar.gz and moved the perl modules to the directory 'Bio':

in the directory 'Bio':

Align
AlignIO
Annotation
Assembly
Biblio
bioperl-1.2.3
Cluster
ClusterIO
Coordinate
Das
DB
EnsEMBL
Event
Expression
Factory
Graphics
Index
LiveSeq
Location
Map
MapIO
Matrix
Ontology
OntologyIO
Phenotype
Root
Search
SearchIO
Seq
SeqFeature
SeqIO
Structure
Symbol
Taxonomy
tmp
Tools
Tree
TreeIO
Variation


Run

 perl variant_effect_predictor.pl  --regulatory --sift=b  --polyphen=b  --regulatory --input_file 20120327.rs.vcf.gz  --format vcf -o  20120402.vcf --vcf



DJANGO

install ubuntu:

  sudo apt-get install python-django

start a new project

  $ django-admin startproject gene2pubmed


$ find gene2pubmed/
gene2pubmed/
gene2pubmed/urls.py
gene2pubmed/__init__.py
gene2pubmed/manage.py
gene2pubmed/settings.py

Edit gene2pubmed/settings.py and set the default db to sqlite3:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
        'NAME': 'gene2pubmed.sqlite3',                      # Or path to database file if using sqlite3.
        'USER': '',                      # Not used with sqlite3.
        'PASSWORD': '',                  # Not used with sqlite3.
        'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
        'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
    }
}

set the local time in gene2pubmed/settings.py

TIME_ZONE = 'Europe/Paris'

synchronize installation for sessions, messages, etc...

python manage.py syncdb

$ python manage.py syncdb
Creating tables ...
Creating table auth_permission
Creating table auth_group_permissions
Creating table auth_group
Creating table auth_user_user_permissions
Creating table auth_user_groups
Creating table auth_user
Creating table auth_message
Creating table django_content_type
Creating table django_session
Creating table django_site

You just installed Django's auth system, which means you don't have any superusers defined.
Would you like to create one now? (yes/no): y
Please enter either "yes" or "no": yes
Username (Leave blank to use 'lindenb'): 
E-mail address: xxxx@xxxx.xxx
Password: 
Password (again): 
Superuser created successfully.
Installing custom SQL ...
Installing indexes ...
No fixtures found.


testing the development server:

$ python gene2pubmed/manage.py  runserver
Validating models...

0 errors found
Django version 1.3, using settings 'gene2pubmed.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
[02/Apr/2012 07:57:11] "GET / HTTP/1.1" 200 2061

It worked!

Congratulations on your first Django-powered page.

Of course, you haven't actually done any work yet. Here's what to do next:

  • If you plan to use a database, edit the DATABASES setting in gene2pubmed/settings.py.
  • Start your first app by running python gene2pubmed/manage.py startapp [appname].

You're seeing this message because you have DEBUG = True in your Django settings file and you haven't configured any URLs. Get to work!