[Tutor] Please help with comparision in range of numbers

Srinivas Iyyer srini_iyyer_bio at yahoo.com
Thu Sep 15 23:39:41 CEST 2005

Hello group,

I have a data like this in tab-delim text.

1427021_s_at	chr7:102786983-102794499	(+)
1452285_a_at	chr7:102786983-102794499	(+)
1445553_at	chr7:102848766-102910961	(-)
1420925_at	chr7:102863841-102887410	(+)
1450041_a_at	chr7:102863841-102887410	(+)
1447553_x_at	chr7:102899711-102899995	(-)
1418478_at	chr7:102991513-103023463	(-)
1452892_at	chr7:103132162-103291925	(-)
1430157_at	chr7:103292083-103297768	(+)

First column represents the identifier. 
Second column representes the position of the
identifier on genome. Because many people might not
understand genome, lets consider it as a sequence
composed of A, T , G and C with lengths of thousands
of thousands of ATGCs. 

The analogy is something like:

Jill am driving from washington DC to Miami on I-95
Jack is driving from Miami to DC on I-95 North.

If we scale the I-95 South as (-) (negative direction)
from 0-1000000000 units (arbitary) and similarly, I-95
North as (+) (positive direction) again from 0-500,000
arbitarary units. 

My aims is to find if Jack and Jill happen to be in
Florence, south carolina then coordinates (considering
that they are apart 1 or 2 miles or units distance)
then they would be something like :
Jack    chr7:102863841-102887410	(+)
Jill	chr7:102886711-102899995	(-)

Then they are falling in the same range of coordinates
(between 86711 and 87410).

I want to find such instances of jack and jill's that
fall in the same ranges and they should be in opposite
to each other. 

Truely, I always flunk and my mind gets blackedout
when I see these number ranges.  I do not know how to
write : check "if a range of numbers fall in the other
range of numbers" condition. 

tutors could any one help me please. 

thank u


Yahoo! Mail - PC Magazine Editors' Choice 2005 

More information about the Tutor mailing list