| Trees | Indices | Help |
|
|---|
|
|
object --+
|
list --+
|
GenericTools.VerboseList --+
|
Location
this is really best interfaced through LocationFromString
fuzzy: < or >
join: {0 = no join, 1 = join, 2 = order}
>>> location = Location([Location([339]), Location([564])]) # zero-based
>>> location
Location(Location(339), Location(564))
>>> print location # one-based
340..565
>>> print location.five_prime()
340
>>> location_rev = Location([Location([339]), Location([564])], 1)
>>> print location_rev
complement(340..565)
>>> print location_rev.five_prime()
565
|
|||
new list |
|
||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from Inherited from |
|||
|
|||
direction2index =
|
|||
|
|||
|
Inherited from |
|||
|
|||
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
|
str(x)
|
repr(x)
|
1: 5'
-1: 3'
>>> loc1 = LocationFromString("join(1..3,complement(5..6))")
>>> loc1.direction_and_index(1)
(1, 0)
>>> loc1.direction_and_index(-1)
(-1, -1)
>>> loc1.reverse()
>>> print loc1
complement(join(1..3,complement(5..6)))
>>> loc1.direction_and_index(1)
(-1, -1)
|
>>> loc = LocationFromString("complement(join(1..5,complement(6..10)))")
>>> loc.findside(1)
Location(5)
>>> loc.findside(-1)
Location(0)
|
>>> loc = LocationFromString("complement(join(MOOCOW:1..5,SEQ:complement(6..10)))")
>>> loc.findseqname_3prime()
'MOOCOW'
|
>>> loc = LocationFromString("complement(join(MOOCOW:1..5,SEQ:complement(6..10)))")
>>> loc.findseqname()
'SEQ'
>>> loc.findseqname(-1)
'MOOCOW'
|
WARNING: doesn't deal with joins!!!!
>>> location1 = LocationFromString("1..50")
>>> location2 = LocationFromString("25..200")
>>> print location1.intersection(location2)
25..50
>>> print location1.intersection(location2)
25..50
|
>>> fwd_location = LocationFromString('X:5830132..5831528')
>>> print fwd_location.sublocation(LocationFromString('1..101'))
X:5830132..5830232
>>> print fwd_location.sublocation(LocationFromString('1267..1286'))
X:5831398..5831417
>>> rev_location = LocationFromString('I:complement(8415686..8416216)')
>>> print rev_location.sublocation(LocationFromString('1..101'))
I:complement(8416116..8416216)
>>> print rev_location.sublocation(LocationFromString('100..200'))
I:complement(8416017..8416117)
|
x+y
|
reverse *IN PLACE*
|
>>> loc1 = LocationFromString("join(I:complement(1..9000),I:complement(9001..10000))")
>>> loc1.reorient()
>>> print loc1
complement(join(I:1..9000,I:9001..10000))
>>> loc2 = LocationFromString("join(I:complement(1..9000),I:9001..10000)")
>>> loc2.reorient()
>>> print loc2
join(I:complement(1..9000),I:9001..10000)
|
works for single level non-complex joins
>>> LOC = LocationFromString
>>> l1 = LOC("join(alpha:1..30,alpha:50..70)")
>>> print l1.bounding()
join(alpha:1..70)
>>> l2 = LOC("join(alpha:1..30,alpha:complement(50..70))")
>>> print l2.bounding()
join(alpha:1..30,alpha:complement(50..70))
>>> l3 = LOC("join(alpha:1..30,alpha:complement(50..70),beta:6..20,alpha:25..45)")
>>> print l3.bounding()
join(alpha:1..45,alpha:complement(50..70),beta:6..20)
|
| Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Thu Aug 18 17:53:38 2011 | http://epydoc.sourceforge.net |