Commit 79fba212 authored by Mathieu Courcelles's avatar Mathieu Courcelles

-Improved Dataset admin

-Added Export to Xi CSV
parent 8b4af0cf
......@@ -7,6 +7,7 @@ This is the Admin module for the CLMSpipeline.
# Import standard librariesdjang
from collections import OrderedDict
# Import Django related libraries
#from django import forms
......@@ -14,17 +15,158 @@ from django.contrib import admin
#from django.contrib.admin.sites import site
from django.contrib import messages
from django.db.models import get_app, get_models
from django.db.models.signals import post_save, pre_save
from django.dispatch import receiver
#from django.utils.text import wrap
# Import project libraries
import CLMSpipeline.CLMSpipeline_app.models as CLMSpipelineModels
from CLMSpipeline.CLMSpipeline_app.parser.XiParser import XiParser
import export
#from adminWidgets import *
class CLPeptideAdmin(admin.ModelAdmin):
actions = ['make_Xi_csv']
exportFields = OrderedDict( [('run_name', 'run_name'),
('scan_number', 'scan_number'),
('precursor_mz','precursor_mz'),
('precursor_charge','precursor_charge'),
('precursor_intensity','precursor_intensity'),
('rank','rank'),
('match_score','match_score'),
('spectrum_intensity_coverage','spectrum_intensity_coverage'),
('total_fragment_matches','total_fragment_matches'),
('delta','delta'),
('error','error'),
('peptide1','peptide1'),
('display_protein1','display_protein1'),
('peptide_position1','peptide_position1'),
('pep1_link_pos','pep1_link_pos'),
('peptide2','peptide2'),
('display_protein2','display_protein2'),
('peptide_position2','peptide_position2'),
('pep2_link_pos','pep2_link_pos'),
('autovalidated','autovalidated'),
('validated','validated'),
('rejected','rejected'),
('notes','notes'),
])
list_display = ('pk', 'getDataset', 'run_name', 'scan_number',
'precursor_mz_2d', 'precursor_charge',
'match_score_2d', 'error_2d', 'spectrum_intensity_coverage_2d',
'total_fragment_matches',
'display_protein1', 'peptide1', 'peptide_position1', 'pep1_link_pos',
'display_protein2', 'peptide2', 'peptide_position2', 'pep2_link_pos',
'link_type', 'autovalidated', 'not_decoy')
list_filter = ('dataset', 'link_type', 'autovalidated', 'not_decoy', 'rejected' )
search_fields = ('display_protein1', 'peptide1',
'display_protein2', 'peptide2')
def make_Xi_csv(self, request, queryset):
return export.make_Xi_csv(self, request, queryset,
self.exportFields, 'CLPeptide')
make_Xi_csv.short_description = 'Export as Xi CSV'
def getDataset(self, obj):
return ''.join([dataset.formated_url() for dataset in obj.dataset.all()])
getDataset.allow_tags = True
getDataset.short_description = 'Dataset'
# Method to format field to 2 digits
def error_2d(self, obj):
return "%.2f" % obj.error
error_2d.short_description = 'error (ppm)'
error_2d.admin_order_field = 'error'
def match_score_2d(self, obj):
return "%.2f" % obj.match_score
match_score_2d.short_description = 'score'
match_score_2d.admin_order_field = 'match_score'
def precursor_mz_2d(self, obj):
return "%.2f" % obj.precursor_mz
precursor_mz_2d.short_description = 'm/z'
precursor_mz_2d.admin_order_field = 'precursor_mz'
def spectrum_intensity_coverage_2d(self, obj):
return "%.2f" % obj.spectrum_intensity_coverage
spectrum_intensity_coverage_2d.short_description = 'Int. cov.'
spectrum_intensity_coverage_2d.admin_order_field = 'spectrum_intensity_coverage'
class DatasetAdmin(admin.ModelAdmin):
actions = ['make_Xi_csv']
exportFields = OrderedDict( [('Display ID', 'displayId'),
('Name', 'name'),
('URI','uri'),
('Description','description'),
('Status','status'),
('Abstract','abstract'),
('Created by','created_by'),
('DB Entry creation date','creation_date'),
('DB Entry modification date','modification_date'),
])
date_hierarchy = 'creation_date'
list_display = ('name', 'prefix', 'file', 'instrument_name', 'fasta_db',
'search_algorithm', 'description', 'parsing_status',
'creation_date', 'get_CLPeptides_URL')
list_filter = ('instrument_name', 'fasta_db', 'search_algorithm')
readonly_fields = ('parsing_log', 'parsing_status')
search_fields = ('name', 'prefix', 'file', 'description')
@staticmethod
@receiver(post_save, sender=CLMSpipelineModels.Dataset)
def process_file(sender, instance, created, **kwargs):
if instance.parsing_status == False and instance.parsing_log == '':
instance.parsing_log = XiParser.parseXiResults(instance)
def get_readonly_fields(self, request, obj=None):
readonly_fields = list(self.readonly_fields)
if obj != None and obj.parsing_status:
readonly_fields.extend(['file'])
return readonly_fields
def get_CLPeptides_URL(self, obj):
return '<a href="/admin/CLMSpipeline_app/clpeptide/?dataset__id__exact=%s">See</a>' % (obj.pk)
get_CLPeptides_URL.allow_tags = True
get_CLPeptides_URL.short_description = 'CLPeptides'
## Register admin panels
admin.site.register(CLMSpipelineModels.Dataset)
admin.site.register(CLMSpipelineModels.Dataset, DatasetAdmin)
admin.site.register(CLMSpipelineModels.FastaDB)
admin.site.register(CLMSpipelineModels.Instrument)
admin.site.register(CLMSpipelineModels.CLPeptide)
admin.site.register(CLMSpipelineModels.CLPeptide, CLPeptideAdmin)
admin.site.register(CLMSpipelineModels.searchAlgorithm)
# # Copyright 2013 Mathieu Courcelles
# # Mike Tyers's lab / IRIC / Universite de Montreal
"""
This module contains methods to export dataset to various
format.
"""
import csv
from django.http import HttpResponse
def make_Xi_csv(self, request, queryset, fields, tableName):
"""
Export selected objects as CSV file
"""
response = HttpResponse(mimetype='text/csv')
response['Content-Disposition'] = 'attachment; filename=' + tableName + '.csv'
response.write('Filter: { ' + request.get_full_path() + ' }\n\n')
writer = csv.writer(response, quoting=csv.QUOTE_ALL)
writer.writerow(fields.keys())
for obj in queryset:
columns = []
for name,value in fields.items():
try:
#columns.append( obj.__getattribute__(value))
## can't get something like container.location
columns.append( eval('obj.%s'%value) )
except:
columns.append("") ## capture 'None' fields
columns = [ c.encode('utf-8') if type(c) is unicode else c \
for c in columns]
writer.writerow( columns )
return response
\ No newline at end of file
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'CLPeptide.decoy'
db.add_column(u'CLMSpipeline_app_clpeptide', 'decoy',
self.gf('django.db.models.fields.BooleanField')(default=False),
keep_default=False)
def backwards(self, orm):
# Deleting field 'CLPeptide.decoy'
db.delete_column(u'CLMSpipeline_app_clpeptide', 'decoy')
models = {
u'CLMSpipeline_app.clpeptide': {
'Meta': {'object_name': 'CLPeptide'},
'autovalidated': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'dataset': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['CLMSpipeline_app.Dataset']", 'symmetrical': 'False'}),
'decoy': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'delta': ('django.db.models.fields.FloatField', [], {}),
'display_protein1': ('django.db.models.fields.CharField', [], {'max_length': '250'}),
'display_protein2': ('django.db.models.fields.CharField', [], {'max_length': '250'}),
'error': ('django.db.models.fields.FloatField', [], {}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'link_type': ('django.db.models.fields.IntegerField', [], {}),
'match_score': ('django.db.models.fields.FloatField', [], {}),
'notes': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'pep1_link_pos': ('django.db.models.fields.IntegerField', [], {}),
'pep2_link_pos': ('django.db.models.fields.IntegerField', [], {}),
'peptide1': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'peptide2': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'peptide_position1': ('django.db.models.fields.IntegerField', [], {}),
'peptide_position2': ('django.db.models.fields.IntegerField', [], {}),
'peptide_wo_mod1': ('django.db.models.fields.CharField', [], {'max_length': '150'}),
'peptide_wo_mod2': ('django.db.models.fields.CharField', [], {'max_length': '150'}),
'precursor_charge': ('django.db.models.fields.CharField', [], {'max_length': '5'}),
'precursor_intensity': ('django.db.models.fields.FloatField', [], {}),
'precursor_mz': ('django.db.models.fields.FloatField', [], {}),
'rank': ('django.db.models.fields.IntegerField', [], {}),
'rejected': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'run_name': ('django.db.models.fields.CharField', [], {'max_length': '1000'}),
'scan_number': ('django.db.models.fields.IntegerField', [], {}),
'spectrum_intensity_coverage': ('django.db.models.fields.FloatField', [], {}),
'total_fragment_matches': ('django.db.models.fields.FloatField', [], {}),
'validated': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
u'CLMSpipeline_app.dataset': {
'Meta': {'ordering': "['-experimentdate']", 'object_name': 'Dataset'},
'creation_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'experimentdate': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
'fasta_db': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['CLMSpipeline_app.FastaDB']"}),
'file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'instrument_name': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['CLMSpipeline_app.Instrument']"}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'prefix': ('django.db.models.fields.CharField', [], {'max_length': '25'}),
'search_agorithm': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['CLMSpipeline_app.searchAlgorithm']"})
},
u'CLMSpipeline_app.fastadb': {
'Meta': {'ordering': "['name']", 'object_name': 'FastaDB'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '200'})
},
u'CLMSpipeline_app.instrument': {
'Meta': {'ordering': "['name']", 'object_name': 'Instrument'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'})
},
u'CLMSpipeline_app.searchalgorithm': {
'Meta': {'ordering': "['name']", 'object_name': 'searchAlgorithm'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'})
}
}
complete_apps = ['CLMSpipeline_app']
\ No newline at end of file
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Dataset.clpeptides'
db.add_column(u'CLMSpipeline_app_dataset', 'clpeptides',
self.gf('django.db.models.fields.related.ForeignKey')(default=1, to=orm['CLMSpipeline_app.CLPeptide']),
keep_default=False)
# Removing M2M table for field dataset on 'CLPeptide'
db.delete_table('CLMSpipeline_app_clpeptide_dataset')
def backwards(self, orm):
# Deleting field 'Dataset.clpeptides'
db.delete_column(u'CLMSpipeline_app_dataset', 'clpeptides_id')
# Adding M2M table for field dataset on 'CLPeptide'
db.create_table(u'CLMSpipeline_app_clpeptide_dataset', (
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
('clpeptide', models.ForeignKey(orm[u'CLMSpipeline_app.clpeptide'], null=False)),
('dataset', models.ForeignKey(orm[u'CLMSpipeline_app.dataset'], null=False))
))
db.create_unique(u'CLMSpipeline_app_clpeptide_dataset', ['clpeptide_id', 'dataset_id'])
models = {
u'CLMSpipeline_app.clpeptide': {
'Meta': {'object_name': 'CLPeptide'},
'autovalidated': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'decoy': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'delta': ('django.db.models.fields.FloatField', [], {}),
'display_protein1': ('django.db.models.fields.CharField', [], {'max_length': '250'}),
'display_protein2': ('django.db.models.fields.CharField', [], {'max_length': '250'}),
'error': ('django.db.models.fields.FloatField', [], {}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'link_type': ('django.db.models.fields.IntegerField', [], {}),
'match_score': ('django.db.models.fields.FloatField', [], {}),
'notes': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'pep1_link_pos': ('django.db.models.fields.IntegerField', [], {}),
'pep2_link_pos': ('django.db.models.fields.IntegerField', [], {}),
'peptide1': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'peptide2': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'peptide_position1': ('django.db.models.fields.IntegerField', [], {}),
'peptide_position2': ('django.db.models.fields.IntegerField', [], {}),
'peptide_wo_mod1': ('django.db.models.fields.CharField', [], {'max_length': '150'}),
'peptide_wo_mod2': ('django.db.models.fields.CharField', [], {'max_length': '150'}),
'precursor_charge': ('django.db.models.fields.CharField', [], {'max_length': '5'}),
'precursor_intensity': ('django.db.models.fields.FloatField', [], {}),
'precursor_mz': ('django.db.models.fields.FloatField', [], {}),
'rank': ('django.db.models.fields.IntegerField', [], {}),
'rejected': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'run_name': ('django.db.models.fields.CharField', [], {'max_length': '1000'}),
'scan_number': ('django.db.models.fields.IntegerField', [], {}),
'spectrum_intensity_coverage': ('django.db.models.fields.FloatField', [], {}),
'total_fragment_matches': ('django.db.models.fields.FloatField', [], {}),
'validated': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
u'CLMSpipeline_app.dataset': {
'Meta': {'ordering': "['-experimentdate']", 'object_name': 'Dataset'},
'clpeptides': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['CLMSpipeline_app.CLPeptide']"}),
'creation_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'experimentdate': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
'fasta_db': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['CLMSpipeline_app.FastaDB']"}),
'file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'instrument_name': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['CLMSpipeline_app.Instrument']"}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'prefix': ('django.db.models.fields.CharField', [], {'max_length': '25'}),
'search_agorithm': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['CLMSpipeline_app.searchAlgorithm']"})
},
u'CLMSpipeline_app.fastadb': {
'Meta': {'ordering': "['name']", 'object_name': 'FastaDB'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '200'})
},
u'CLMSpipeline_app.instrument': {
'Meta': {'ordering': "['name']", 'object_name': 'Instrument'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'})
},
u'CLMSpipeline_app.searchalgorithm': {
'Meta': {'ordering': "['name']", 'object_name': 'searchAlgorithm'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'})
}
}
complete_apps = ['CLMSpipeline_app']
\ No newline at end of file
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'Dataset.clpeptides'
db.delete_column(u'CLMSpipeline_app_dataset', 'clpeptides_id')
# Adding M2M table for field dataset on 'CLPeptide'
db.create_table(u'CLMSpipeline_app_clpeptide_dataset', (
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
('clpeptide', models.ForeignKey(orm[u'CLMSpipeline_app.clpeptide'], null=False)),
('dataset', models.ForeignKey(orm[u'CLMSpipeline_app.dataset'], null=False))
))
db.create_unique(u'CLMSpipeline_app_clpeptide_dataset', ['clpeptide_id', 'dataset_id'])
def backwards(self, orm):
# User chose to not deal with backwards NULL issues for 'Dataset.clpeptides'
raise RuntimeError("Cannot reverse this migration. 'Dataset.clpeptides' and its values cannot be restored.")
# Removing M2M table for field dataset on 'CLPeptide'
db.delete_table('CLMSpipeline_app_clpeptide_dataset')
models = {
u'CLMSpipeline_app.clpeptide': {
'Meta': {'object_name': 'CLPeptide'},
'autovalidated': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'dataset': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['CLMSpipeline_app.Dataset']", 'symmetrical': 'False'}),
'decoy': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'delta': ('django.db.models.fields.FloatField', [], {}),
'display_protein1': ('django.db.models.fields.CharField', [], {'max_length': '250'}),
'display_protein2': ('django.db.models.fields.CharField', [], {'max_length': '250'}),
'error': ('django.db.models.fields.FloatField', [], {}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'link_type': ('django.db.models.fields.IntegerField', [], {}),
'match_score': ('django.db.models.fields.FloatField', [], {}),
'notes': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'pep1_link_pos': ('django.db.models.fields.IntegerField', [], {}),
'pep2_link_pos': ('django.db.models.fields.IntegerField', [], {}),
'peptide1': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'peptide2': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'peptide_position1': ('django.db.models.fields.IntegerField', [], {}),
'peptide_position2': ('django.db.models.fields.IntegerField', [], {}),
'peptide_wo_mod1': ('django.db.models.fields.CharField', [], {'max_length': '150'}),
'peptide_wo_mod2': ('django.db.models.fields.CharField', [], {'max_length': '150'}),
'precursor_charge': ('django.db.models.fields.CharField', [], {'max_length': '5'}),
'precursor_intensity': ('django.db.models.fields.FloatField', [], {}),
'precursor_mz': ('django.db.models.fields.FloatField', [], {}),
'rank': ('django.db.models.fields.IntegerField', [], {}),
'rejected': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'run_name': ('django.db.models.fields.CharField', [], {'max_length': '1000'}),
'scan_number': ('django.db.models.fields.IntegerField', [], {}),
'spectrum_intensity_coverage': ('django.db.models.fields.FloatField', [], {}),
'total_fragment_matches': ('django.db.models.fields.FloatField', [], {}),
'validated': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
u'CLMSpipeline_app.dataset': {
'Meta': {'ordering': "['-experimentdate']", 'object_name': 'Dataset'},
'creation_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'experimentdate': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
'fasta_db': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['CLMSpipeline_app.FastaDB']"}),
'file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'instrument_name': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['CLMSpipeline_app.Instrument']"}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'prefix': ('django.db.models.fields.CharField', [], {'max_length': '25'}),
'search_agorithm': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['CLMSpipeline_app.searchAlgorithm']"})
},
u'CLMSpipeline_app.fastadb': {
'Meta': {'ordering': "['name']", 'object_name': 'FastaDB'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '200'})
},
u'CLMSpipeline_app.instrument': {
'Meta': {'ordering': "['name']", 'object_name': 'Instrument'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'})
},
u'CLMSpipeline_app.searchalgorithm': {
'Meta': {'ordering': "['name']", 'object_name': 'searchAlgorithm'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'})
}
}
complete_apps = ['CLMSpipeline_app']
\ No newline at end of file
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'CLPeptide.decoy'
db.delete_column(u'CLMSpipeline_app_clpeptide', 'decoy')
# Adding field 'CLPeptide.not_decoy'
db.add_column(u'CLMSpipeline_app_clpeptide', 'not_decoy',
self.gf('django.db.models.fields.BooleanField')(default=False),
keep_default=False)
def backwards(self, orm):
# Adding field 'CLPeptide.decoy'
db.add_column(u'CLMSpipeline_app_clpeptide', 'decoy',
self.gf('django.db.models.fields.BooleanField')(default=False),
keep_default=False)
# Deleting field 'CLPeptide.not_decoy'
db.delete_column(u'CLMSpipeline_app_clpeptide', 'not_decoy')
models = {
u'CLMSpipeline_app.clpeptide': {
'Meta': {'object_name': 'CLPeptide'},
'autovalidated': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'dataset': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['CLMSpipeline_app.Dataset']", 'symmetrical': 'False'}),
'delta': ('django.db.models.fields.FloatField', [], {}),
'display_protein1': ('django.db.models.fields.CharField', [], {'max_length': '250'}),
'display_protein2': ('django.db.models.fields.CharField', [], {'max_length': '250'}),
'error': ('django.db.models.fields.FloatField', [], {}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'link_type': ('django.db.models.fields.IntegerField', [], {}),
'match_score': ('django.db.models.fields.FloatField', [], {}),
'not_decoy': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'notes': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'pep1_link_pos': ('django.db.models.fields.IntegerField', [], {}),
'pep2_link_pos': ('django.db.models.fields.IntegerField', [], {}),
'peptide1': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'peptide2': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'peptide_position1': ('django.db.models.fields.IntegerField', [], {}),
'peptide_position2': ('django.db.models.fields.IntegerField', [], {}),
'peptide_wo_mod1': ('django.db.models.fields.CharField', [], {'max_length': '150'}),
'peptide_wo_mod2': ('django.db.models.fields.CharField', [], {'max_length': '150'}),
'precursor_charge': ('django.db.models.fields.CharField', [], {'max_length': '5'}),
'precursor_intensity': ('django.db.models.fields.FloatField', [], {}),
'precursor_mz': ('django.db.models.fields.FloatField', [], {}),
'rank': ('django.db.models.fields.IntegerField', [], {}),
'rejected': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'run_name': ('django.db.models.fields.CharField', [], {'max_length': '1000'}),
'scan_number': ('django.db.models.fields.IntegerField', [], {}),
'spectrum_intensity_coverage': ('django.db.models.fields.FloatField', [], {}),
'total_fragment_matches': ('django.db.models.fields.FloatField', [], {}),
'validated': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
u'CLMSpipeline_app.dataset': {
'Meta': {'ordering': "['-experimentdate']", 'object_name': 'Dataset'},
'creation_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'experimentdate': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
'fasta_db': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['CLMSpipeline_app.FastaDB']"}),
'file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'instrument_name': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['CLMSpipeline_app.Instrument']"}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'prefix': ('django.db.models.fields.CharField', [], {'max_length': '25'}),
'search_agorithm': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['CLMSpipeline_app.searchAlgorithm']"})
},
u'CLMSpipeline_app.fastadb': {
'Meta': {'ordering': "['name']", 'object_name': 'FastaDB'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '200'})
},
u'CLMSpipeline_app.instrument': {
'Meta': {'ordering': "['name']", 'object_name': 'Instrument'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'})
},
u'CLMSpipeline_app.searchalgorithm': {
'Meta': {'ordering': "['name']", 'object_name': 'searchAlgorithm'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'})
}
}
complete_apps = ['CLMSpipeline_app']
\ No newline at end of file
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Dataset.parsing_status'
db.add_column(u'CLMSpipeline_app_dataset', 'parsing_status',
self.gf('django.db.models.fields.BooleanField')(default=False),
keep_default=False)
# Adding field 'Dataset.parsing_log'
db.add_column(u'CLMSpipeline_app_dataset', 'parsing_log',
self.gf('django.db.models.fields.CharField')(default='', max_length=1000),
keep_default=False)
def backwards(self, orm):
# Deleting field 'Dataset.parsing_status'
db.delete_column(u'CLMSpipeline_app_dataset', 'parsing_status')
# Deleting field 'Dataset.parsing_log'
db.delete_column(u'CLMSpipeline_app_dataset', 'parsing_log')
models = {
u'CLMSpipeline_app.clpeptide': {
'Meta': {'object_name': 'CLPeptide'},
'autovalidated': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'dataset': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['CLMSpipeline_app.Dataset']", 'symmetrical': 'False'}),
'delta': ('django.db.models.fields.FloatField', [], {}),
'display_protein1': ('django.db.models.fields.CharField', [], {'max_length': '250'}),
'display_protein2': ('django.db.models.fields.CharField', [], {'max_length': '250'}),
'error': ('django.db.models.fields.FloatField', [], {}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'link_type': ('django.db.models.fields.IntegerField', [], {}),
'match_score': ('django.db.models.fields.FloatField', [], {}),
'not_decoy': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'notes': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'pep1_link_pos': ('django.db.models.fields.IntegerField', [], {}),
'pep2_link_pos': ('django.db.models.fields.IntegerField', [], {}),
'peptide1': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'peptide2': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'peptide_position1': ('django.db.models.fields.IntegerField', [], {}),
'peptide_position2': ('django.db.models.fields.IntegerField', [], {}),
'peptide_wo_mod1': ('django.db.models.fields.CharField', [], {'max_length': '150'}),
'peptide_wo_mod2': ('django.db.models.fields.CharField', [], {'max_length': '150'}),
'precursor_charge': ('django.db.models.fields.CharField', [], {'max_length': '5'}),
'precursor_intensity': ('django.db.models.fields.FloatField', [], {}),
'precursor_mz': ('django.db.models.fields.FloatField', [], {}),
'rank': ('django.db.models.fields.IntegerField', [], {}),
'rejected': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'run_name': ('django.db.models.fields.CharField', [], {'max_length': '1000'}),
'scan_number': ('django.db.models.fields.IntegerField', [], {}),
'spectrum_intensity_coverage': ('django.db.models.fields.FloatField', [], {}),
'total_fragment_matches': ('django.db.models.fields.FloatField', [], {}),
'validated': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},