I am confused on why the code below does not work:
class ComparativeAnnotatorConfiguration(HashableNamespace):
"""
Takes the initial configuration from the main driver script and builds paths to all files that will be produced
by these tasks.
"""
def __init__(self, args, gene_set, query_genome_files, target_genome_files, annot_files, transmap):
self.work_dir = os.path.join(args.workDir, 'comparativeAnnotator', gene_set.sourceGenome, gene_set.geneSet)
self.metrics_dir = os.path.join(args.outputDir, 'metrics')
self.tx_set_dir = os.path.join(args.outputDir, 'tm_transcript_set')
self.reference = self.Reference(args, query_genome_files, annot_files, self.work_dir)
self.transmap = self.TransMap(args, query_genome_files, target_genome_files, annot_files, transmap, self.work_dir)
class Reference(HashableNamespace):
"""
The args object that will be passed directly to jobTree
"""
def __init__(self, args, query_genome_files, annot_files, out_dir):
self.__dict__.update(vars(args.jobTreeOptions))
self.outDir = out_dir
self.refGenome = query_genome_files.genome
self.refFasta = query_genome_files.genome_fasta
self.sizes = query_genome_files.chrom_sizes
self.annotationGp = annot_files.gp
self.gencodeAttributes = annot_files.attributes
self.mode = 'reference'
class TransMap(Reference):
"""
The args object that will be passed directly to jobTree
"""
def __init__(self, args, query_genome_files, target_genome_files, annot_files, transmap, out_dir):
super(self.__class__, self).Reference.__init__(self, args, query_genome_files, annot_files, out_dir)
self.genome = target_genome_files.genome
self.psl = transmap.psl
self.refPsl = annot_files.psl
self.targetGp = transmap.gp
self.fasta = target_genome_files.fasta
self.mode = 'transMap'
Attempting to instantiate leads to the error:
AttributeError: 'super' object has no attribute 'Reference'
I have tried different versions such as super(TransMap, self).Reference.__init__
and Reference.__init__
, but all give different versions of a NameError
. How is this different than the simple case outlined here: