Hi,
I think msaslice.regions() is the recommended way to do this.  It gives you 
NLMSASlice(s) indexed in terms of the multiple alignment coordinate system 
(including all inserts) rather than in terms of a specific sequence.  So this 
will show you how all sequences align to each other, not just to a reference 
sequence.  Note that regions() returns a list, since (due to the length limits 
of 32 bit integers) NLMSA may have to split the whole alignment into more than 
one coordinate system, so in principle it is possible for the regions() result 
to span multiple coordinate systems.  So you use it like this

for coordslice in msaslice.regions(): # most likely just one coord system...

Once you have that you can do something like

l = coordslice.edges()
coordmin, coordmax = min([t[0].start for t in l]), max([t[0].stop for t in l])
for coords, otherSeq, e in l:
    orgName = seq2name[otherSeq].split('.')[0]
    if orgName in allowedIndexes:
        orgIndex = allowedIndexes[orgName]
        alignmentStrs[orgIndex,coords.start - coordmin\
               :coords.stop - coordmin] = list(str(otherSeq))

A couple notes on regions():
- regions() does not work over XMLRPC.  You have to be accessing the NLMSA 
locally.
- as far as I know, not very many people have used this, so you may run into 
problems.  If you do, we'll fix them.

Yours,

Chris

-- 
You received this message because you are subscribed to the Google Groups 
"pygr-dev" group.
To post to this group, send email to pygr-...@googlegroups.com.
To unsubscribe from this group, send email to 
pygr-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/pygr-dev?hl=en.

Reply via email to