google-code-export / segtools

Automatically exported from code.google.com/p/segtools
1 stars 1 forks source link

segtools-aggregation fails in gene mode when annotation is preprocessed #28

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Take any gene annotation, run segtools-preproccess --annotation ANNOTATION, 
then use the .pkl output file in segtools-aggregation --mode gene. Get 
following error:

segtools.UnpickleError: Error: Cannot to load an indexed Annotation object as 
an indexed GeneAnnotation object.

I get this error in segtools 1.1.0 on RHEL 5.

Original issue reported on code.google.com by epa...@uw.edu on 10 Jul 2012 at 9:39

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I forgot the stack trace:

Loading GeneAnnotation from file: 
data/5-paper_aggregation/gencode/gencode.v7.annotation.gtf.pkl.gz
  Unpickling GeneAnnotation
Traceback (most recent call last):
  File "/net/noble/vol1/home/epaul9/arch/Linux/RHEL5/x86_64/bin/segtools-aggregation", line 8, in <module>
    load_entry_point('segtools==1.1.10.dev-r374', 'console_scripts', 'segtools-aggregation')()
  File "/net/noble/vol1/home/epaul9/arch/Linux/RHEL5/x86_64/lib/python2.7/segtools-1.1.10.dev_r374-py2.7.egg/segtools/aggregation.py", line 963, in main
    validate(bedfilename, featurefilename, outdir, **kwargs)
  File "/net/noble/vol1/home/epaul9/arch/Linux/RHEL5/x86_64/lib/python2.7/segtools-1.1.10.dev_r374-py2.7.egg/segtools/aggregation.py", line 840, in validate
    features = GeneAnnotation(featurefilename, verbose=verbose)
  File "/net/noble/vol1/home/epaul9/arch/Linux/RHEL5/x86_64/lib/python2.7/segtools-1.1.10.dev_r374-py2.7.egg/segtools/__init__.py", line 93, in __init__
    self._load(filename, verbose=verbose)
  File "/net/noble/vol1/home/epaul9/arch/Linux/RHEL5/x86_64/lib/python2.7/segtools-1.1.10.dev_r374-py2.7.egg/segtools/__init__.py", line 117, in _load
    self._from_pickle(filename, verbose=verbose)
  File "/net/noble/vol1/home/epaul9/arch/Linux/RHEL5/x86_64/lib/python2.7/segtools-1.1.10.dev_r374-py2.7.egg/segtools/__init__.py", line 174, in _from_pickle
    raise self.UnpickleError(msg)
segtools.UnpickleError: Error: Cannot to load an indexed Annotation object as 
an indexed GeneAnnotation object.

This appears to occur due to an inheritance issue. GeneAnnotation is a subclass 
of Annotation. When a gene annotation is pickled it is pickled at a plain 
Annotation. On line 169 of __init__.py (inherited from Annotation by 
GeneAnnotation) GeneAnnotation is trying to load an Annotation as a 
GeneAnnotation, which will fail.

Original comment by epa...@uw.edu on 10 Jul 2012 at 9:52

GoogleCodeExporter commented 9 years ago
Looks like the correct way of fixing this would be to add an gene annotation 
mode for segtools-preprocess. An easy workaround is to not use 
segtools-preprocess.

Original comment by hoffman...@gmail.com on 10 Jul 2012 at 9:58

GoogleCodeExporter commented 9 years ago

Original comment by hoffman...@gmail.com on 10 Jul 2012 at 10:00