r-help-bounces@r-project.org wrote on 08/19/2011 12:15:39 PM:

> [image removed] 
> 
> [R] how to merge distance data based on location
> 
> Matthew Keller 
> 
> to:
> 
> r help
> 
> 08/19/2011 12:18 PM
> 
> Sent by:
> 
> r-help-bounces@r-project.org
> 
> Hi all,
> 
> I have two data frames, two columns each, 1000s of rows. Each row
> represents a segment of the genome where a deletion has occurred.
> First column is start position of the deletion in genomic distance,
> second is end position.
> 
> So, e.g., first 3 rows of data frame A is:
> 1003 1023
> 5932 6120
> 12348 12689
> 
> first 3 rows of data frame B is:
> 852 5305
> 1010 1015
> 8500 9500
> 10000 13000

The first row of data frame B describes a deletion that fully envelopes 
the deletion described in the second row.  Does this make sense?

> 
> I want to merge based on distance, such that each row will be
> deletions that overlap. So I'd like:
> 1003 1023    852 5305   1010 1015
> 5932 6120
> 8500 9500
> 12348 12689    10000 13000

Would you mind describing what you plan to do with the resulting merged 
data frame?  I ask because there may be some approach (other than data 
frame merging) that might serve your needs better.

What if the second row of data frame B was
1025 1038
it would still overlap with the first row of B, but it wouldn't overlap 
with the first row of A.  How would you want your merged data frame to 
look?

> 
> Does anyone have ideas about how to accomplish this?
> Thank you,
> 
> Matthew Keller
> 
> -- 
> Matthew C Keller
> Asst. Professor of Psychology
> University of Colorado at Boulder
> www.matthewckeller.com
> 

Jean


`·.,,  ><(((º>   `·.,,  ><(((º>   `·.,,  ><(((º>

Jean V. Adams
Statistician
U.S. Geological Survey
Great Lakes Science Center
223 East Steinfest Road
Antigo, WI 54409  USA
	[[alternative HTML version deleted]]

