Giter VIP home page Giter VIP logo

Comments (5)

phantomas1234 avatar phantomas1234 commented on June 10, 2024

sorry, that doesn't work because the input is actually not a Genotype

from gnomic.

lyschoening avatar lyschoening commented on June 10, 2024

@phantomas1234 a Mutation is not a genotype, but a change. You want to use change_to_text() not genotype_to_text()

from gnomic.

lyschoening avatar lyschoening commented on June 10, 2024

Haha, the button changed to Reopen just as I clicked :)

from gnomic.

phantomas1234 avatar phantomas1234 commented on June 10, 2024
from gnomic.utils import genotype_to_string, genotype_to_text, change_to_text, change_to_string

from gnomic import Mutation, FeatureTree, Feature, Accession

g = Mutation(new=FeatureTree(Feature(type='reaction', accession=Accession(identifier='3OAR140'), variant='down-regulation(-0.996)')), old=FeatureTree(Feature(type='reaction', accession=Accession(identifier='3OAR140'))), multiple=False)
change_to_string(g)

That one seems to be broken too?

AttributeError                            Traceback (most recent call last)
<ipython-input-43-561e8086745e> in <module>()
      4 
      5 g = Mutation(new=FeatureTree(Feature(type='reaction', accession=Accession(identifier='3OAR140'), variant='down-regulation(-0.996)')), old=FeatureTree(Feature(type='reaction', accession=Accession(identifier='3OAR140'))), multiple=False)
----> 6 change_to_string(g)

/Users/niso/anaconda3/lib/python3.5/site-packages/gnomic/utils.py in change_to_string(change)
    118                 s = '{}>>{}'.format(feature_to_string(change.old), feature_to_string(change.new))
    119             else:
--> 120                 s = '{}>{}'.format(feature_to_string(change.old), feature_to_string(change.new))
    121         elif change.old is None:
    122             # FIXME phenotypes should not have a + or - prefix; only a postfix.

/Users/niso/anaconda3/lib/python3.5/site-packages/gnomic/utils.py in feature_to_string(feature)
    146         return ':'.join(feature_to_string(f) for f in feature.contents)
    147     elif isinstance(feature, FeatureTree):
--> 148         contents = ' '.join(feature_to_string(f) for f in feature.contents)
    149         if isinstance(feature, FeatureSet):
    150             return '{{{contents}}}'.format(contents=contents)

/Users/niso/anaconda3/lib/python3.5/site-packages/gnomic/utils.py in <genexpr>(.0)
    146         return ':'.join(feature_to_string(f) for f in feature.contents)
    147     elif isinstance(feature, FeatureTree):
--> 148         contents = ' '.join(feature_to_string(f) for f in feature.contents)
    149         if isinstance(feature, FeatureSet):
    150             return '{{{contents}}}'.format(contents=contents)

/Users/niso/anaconda3/lib/python3.5/site-packages/gnomic/utils.py in feature_to_string(feature)
    146         return ':'.join(feature_to_string(f) for f in feature.contents)
    147     elif isinstance(feature, FeatureTree):
--> 148         contents = ' '.join(feature_to_string(f) for f in feature.contents)
    149         if isinstance(feature, FeatureSet):
    150             return '{{{contents}}}'.format(contents=contents)

/Users/niso/anaconda3/lib/python3.5/site-packages/gnomic/utils.py in <genexpr>(.0)
    146         return ':'.join(feature_to_string(f) for f in feature.contents)
    147     elif isinstance(feature, FeatureTree):
--> 148         contents = ' '.join(feature_to_string(f) for f in feature.contents)
    149         if isinstance(feature, FeatureSet):
    150             return '{{{contents}}}'.format(contents=contents)

/Users/niso/anaconda3/lib/python3.5/site-packages/gnomic/utils.py in feature_to_string(feature)
    155     else:
    156         s = ''
--> 157         if feature.type and feature.type.name != 'phene':
    158             s += '{}.'.format(feature.type.name)
    159 

AttributeError: 'str' object has no attribute 'name'

from gnomic.

lyschoening avatar lyschoening commented on June 10, 2024

Feature.type must be a Type.

from gnomic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.