comparison cuffdata.py @ 10:45275147ac1e

Add composite_file defs to datatype
author Jim Johnson <jj@umn.edu>
date Wed, 17 Oct 2012 12:00:55 -0500
parents 9d25b0fd882b
children e132e60f95b1
comparison
equal deleted inserted replaced
9:b6427cdbf6d4 10:45275147ac1e
38 """ 38 """
39 file_ext = 'cuffdata' 39 file_ext = 'cuffdata'
40 is_binary = False 40 is_binary = False
41 composite_type = 'auto_primary_file' 41 composite_type = 'auto_primary_file'
42 allow_datatype_change = False 42 allow_datatype_change = False
43 def __init__( self, **kwd ):
44 Html.__init(self, **kwd )
45 self.add_composite_file('run.info', description = 'run.info', mimetype = 'text/html', optional = True, is_binary = False )
46 self.add_composite_file('read_groups.info', description = 'read_groups.info', mimetype = 'text/html', optional = True, is_binary = False )
47 self.add_composite_file('cds.count_tracking', description = 'cds.count_tracking', mimetype = 'text/html', optional = True, is_binary = False )
48 self.add_composite_file('cds.diff', description = 'cds.diff', mimetype = 'text/html', optional = True, is_binary = False )
49 self.add_composite_file('cds.fpkm_tracking', description = 'cds.fpkm_tracking', mimetype = 'text/html', optional = True, is_binary = False )
50 self.add_composite_file('cds.read_group_tracking', description = 'cds.read_group_tracking', mimetype = 'text/html', optional = True, is_binary = False )
51 self.add_composite_file('cds_exp.diff', description = 'cds_exp.diff', mimetype = 'text/html', optional = True, is_binary = False )
52 self.add_composite_file('gene_exp.diff', description = 'gene_exp.diff', mimetype = 'text/html', optional = True, is_binary = False )
53 self.add_composite_file('genes.count_tracking', description = 'genes.count_tracking', mimetype = 'text/html', optional = True, is_binary = False )
54 self.add_composite_file('genes.fpkm_tracking', description = 'genes.fpkm_tracking', mimetype = 'text/html', optional = True, is_binary = False )
55 self.add_composite_file('genes.read_group_tracking', description = 'genes.read_group_tracking', mimetype = 'text/html', optional = True, is_binary = False )
56 self.add_composite_file('isoform_exp.diff', description = 'isoform_exp.diff', mimetype = 'text/html', optional = True, is_binary = False )
57 self.add_composite_file('isoforms.count_tracking', description = 'isoforms.count_tracking', mimetype = 'text/html', optional = True, is_binary = False )
58 self.add_composite_file('isoforms.fpkm_tracking', description = 'isoforms.fpkm_tracking', mimetype = 'text/html', optional = True, is_binary = False )
59 self.add_composite_file('isoforms.read_group_tracking', description = 'isoforms.read_group_tracking', mimetype = 'text/html', optional = True, is_binary = False )
60 self.add_composite_file('promoters.diff', description = 'promoters.diff', mimetype = 'text/html', optional = True, is_binary = False )
61 self.add_composite_file('splicing.diff', description = 'splicing.diff', mimetype = 'text/html', optional = True, is_binary = False )
62 self.add_composite_file('tss_group_exp.diff', description = 'tss_group_exp.diff', mimetype = 'text/html', optional = True, is_binary = False )
63 self.add_composite_file('tss_groups.count_tracking', description = 'tss_groups.count_tracking', mimetype = 'text/html', optional = True, is_binary = False )
64 self.add_composite_file('tss_groups.fpkm_tracking', description = 'tss_groups.fpkm_tracking', mimetype = 'text/html', optional = True, is_binary = False )
65 self.add_composite_file('tss_groups.read_group_tracking', description = 'tss_groups.read_group_tracking', mimetype = 'text/html', optional = True, is_binary = False )
43 66
44 def generate_primary_file( self, dataset = None ): 67 def generate_primary_file( self, dataset = None ):
45 """ 68 """
46 This is called only at upload to write the html file 69 This is called only at upload to write the html file
47 cannot rename the datasets here - they come with the default unfortunately 70 cannot rename the datasets here - they come with the default unfortunately
48 """ 71 """
49 return '<html><head></head><body>AutoGenerated Primary File for Composite Dataset</body></html>' 72 rval = ['<html><head><title>CuffDiff Output</title></head>']
73 rval.append('<body>')
74 rval.append('<p/>CuffDiff Outputs:<p/><ul>')
75 for composite_name, composite_file in self.get_composite_files( dataset = dataset ).iteritems():
76 fn = composite_name
77 log.debug( "Velvet log info %s %s %s" % ('JJ generate_primary_file',fn,composite_file))
78 opt_text = ''
79 if composite_file.optional:
80 opt_text = ' (optional)'
81 if composite_file.get('description'):
82 rval.append( '<li><a href="%s" type="text/plain">%s (%s)</a>%s</li>' % ( fn, fn, composite_file.get('description'), opt_text ) )
83 else:
84 rval.append( '<li><a href="%s" type="text/plain">%s</a>%s</li>' % ( fn, fn, opt_text ) )
85 rval.append( '</ul></body></html>' )
86 return "\n".join( rval )
50 87
51 def regenerate_primary_file(self,dataset): 88 def regenerate_primary_file(self,dataset):
52 """ 89 """
53 cannot do this until we are setting metadata 90 cannot do this until we are setting metadata
54 """ 91 """