# Returns nothing.
- my ( $bed_file, $fh_in, $fh_out, $cols, $record, $bed_entry, $file_hash, $chr,
- $array, $pos, $id, $beg, $end, $score, $new_record );
+ my ( $bed_file, $fh_in, $fh_out, $cols, $record, $bed_entry, $file_hash, $chr, $strand );
$bed_file = "$BP_TMP/assemble_tag_contigs.bed";
$fh_out = Maasha::Filesys::file_write_open( $bed_file );
- $cols = 5; # we only need the first 5 BED columns
+ $cols = 6; # we only need the first 5 BED columns
while ( $record = get_record( $in ) )
{
- if ( $bed_entry = Maasha::UCSC::BED::biopiece2bed( $record, $cols ) ) {
+ if ( $bed_entry = Maasha::UCSC::BED::biopiece2bed( $record, $cols ) )
+ {
+ $strand = $record->{ 'STRAND' } || '+';
+
Maasha::UCSC::BED::bed_entry_put( $bed_entry, $fh_out, $cols );
}
}
close $fh_out;
- $file_hash = Maasha::UCSC::BED::bed_file_split_on_chr( $bed_file );
+ $file_hash = Maasha::UCSC::BED::bed_file_split_on_chr( $bed_file, $BP_TMP, $cols );
unlink $bed_file;
foreach $chr ( sort keys %{ $file_hash } )
{
- $bed_file = Maasha::UCSC::BED::tag_contigs_assemble( $file_hash->{ $chr }, $chr, $BP_TMP );
+ $bed_file = Maasha::UCSC::BED::tag_contigs_assemble( $file_hash->{ $chr }, $chr, $strand, $BP_TMP );
$fh_in = Maasha::Filesys::file_read_open( $bed_file );
my ( $bed_file, # path to BED file
$chr, # chromosome
+ $strand, # strand
$dir, # working directory
) = @_;
$entry->[ chromEnd ] = $end;
$entry->[ name ] = sprintf( "TC%06d", $id );
$entry->[ score ] = $score;
+ $entry->[ strand ] = $strand;
bed_entry_put( $entry, $fh_out );