<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>I am using Bio::Tools::Run::BEDTools. I would like to intersect
two BED files and print out the intersecting lines of the first
BED file. I am using the code below, but it is not printing out
the first file entries. <font face="Courier New, Courier,
monospace"> <br>
</font></p>
<p><font face="Courier New, Courier, monospace"> my $bedtools_fac2 =
Bio::Tools::Run::BEDTools->new( -command => 'intersect');
$bedtools_fac2->set_parameters( -switches =>
'write_entry_1'); <br>
my $result_file2 = $bedtools_fac2->run( -bgv1 => $bed1,
-bgv2 => $files);</font></p>
<p><font face="Courier New, Courier, monospace"><br>
</font>The first file, $bed1, file looks like this:</p>
<p>chr1 5686 5887 1:5786 130 . 44.0 0.00
4.35 100 ABI3VP1 AT5G60130 col<br>
chr1 14354 14555 1:14454 147 . 68.6 0.00
14.69 100 ABI3VP1 AT5G60130 col<br>
chr1 21440 21641 1:21540 163 . 90.9 0.00
27.26 100 ABI3VP1 AT5G60130 col<br>
chr1 41649 41850 1:41749 129 . 42.0 0.00
3.75 100 ABI3VP1 AT5G60130 col</p>
<p>The second file, $files, looks like this:<br>
chr1 1 3630 AT1G01010 intergenic + AT1G01010
0 255,0,0<br>
chr1 631 3630 AT1G01010 upstream_3000 +
AT1G01010 0 255,0,0<br>
chr1 760 3759 AT1G01010
upstream_3000_translation_start + AT1G01010 0 255,0,0<br>
chr1 2631 3630 AT1G01010 upstream_1000 +
AT1G01010 0 255,0,0<br>
chr1 2760 3759 AT1G01010
upstream_1000_translation_start + AT1G01010 0 255,0,0</p>
<p>The output, $result_file2, looks like this:</p>
<p>chr1 4775 4976 AT1G01010.1 cds_updated +
AT1G01010 0 255,0,0<br>
chr1 4775 4976 AT1G01010.1 exon + AT1G01010
0 255,0,0<br>
chr1 1635 1836 AT1G01010 intergenic +
AT1G01010 0 255,0,0<br>
chr1 1635 1836 AT1G01010 upstream_3000 +
AT1G01010 0 255,0,0</p>
<p>Columns 2 and 3, the numbers (4775 4976), in the output file may
have come from the first file, but the rest seems to come from the
2nd file. The intersection is being done, but I would like the
output to come from the first file. I can use <font face="Courier
New, Courier, monospace"> -switches => 'write_entry_1' </font>and
get the same result with <font face="Courier New, Courier,
monospace">-switches => 'write_entry_2'</font> </p>
<p>Matthew<br>
</p>
</body>
</html>