1. James Taylor
  2. bx-python
  3. Issues
Issue #20 resolved

Wrong interpretation of Component.size?

Anonymous created an issue

Maybe I'm getting this wrong, but it seems that a component's text size is defined as the length of that component's alignment line, whereas according to the MAF definition it should be that length minus the number of dashes.

This gets problematic for example in Alignment.add_component.

Comments (3)

  1. Bob Harris

    Looking at the source code (lib/bx/align/core.py) I don't see where a Component has anything that's defined as a text size. Could you give some more detail about what you mean by that?

    An Alignment has a text_size field, which is the number of columns in the alignment block. All components' alignment lines must match that length, unless the component has no alignment line (I'm not sure what this latter case is intended for). Note that Alignment.add_component is pretty simplistic. It is not performing alignment. It is simply adding a row to an alignment block with the expectation that that row and any others previously added already line up, complete with dashes.

  2. Anonymous

    Ok, I think I wrongly assumed that Alignment.text_size would be equal to Component.size, but I guess it isn't. Alignment.text_size includes dashes, whereas Component.size doesn't.

    I ran into the problem with Alignment.add_component, because I had set Alignment.text_size to some component's size (meaning not counting the dashes).

    Now it makes a lot of sense to me why one is called "text_size" and the other "size" :)

    Thanks! Marc

  3. Log in to comment