# record is converted and undef is returned if
# convertion failed.
- # IMPORTANT! The BED_END and THICK_END positions
+ # IMPORTANT! The chromEnd and thickEnd positions
# will be the inexact position used in the
- # UCSC scheme.
+ # UCSC scheme (+1 to all ends).
my ( $bp_record, # hashref
$cols, # number of columns in BED entry - OPTIONAL (but faster)
$cols ||= 12; # max number of columns possible
- $bed_entry[ chrom ] = $bp_record->{ "CHR" } ||
- $bp_record->{ "S_ID" } ||
- return undef;
+ $bed_entry[ chrom ] = $bp_record->{ "CHR" } ||
+ $bp_record->{ "S_ID" } ||
+ return undef;
if ( defined $bp_record->{ "CHR_BEG" } ) {
$bed_entry[ chromStart ] = $bp_record->{ "CHR_BEG" };
}
if ( defined $bp_record->{ "CHR_END" } ) {
- $bed_entry[ chromEnd ] = $bp_record->{ "CHR_END" };
+ $bed_entry[ chromEnd ] = $bp_record->{ "CHR_END" } + 1;
} elsif ( defined $bp_record->{ "S_END" }) {
- $bed_entry[ chromEnd ] = $bp_record->{ "S_END" };
+ $bed_entry[ chromEnd ] = $bp_record->{ "S_END" } + 1;
} else {
return undef;
}
- $bed_entry[ chromEnd ]++;
-
return wantarray ? @bed_entry : \@bed_entry if $cols == 3;
$bed_entry[ name ] = $bp_record->{ "Q_ID" } || return wantarray ? @bed_entry : \@bed_entry;
$bed_entry[ blockCount ] = $bp_record->{ "BLOCK_COUNT" };
$bed_entry[ blockSizes ] = $bp_record->{ "BLOCK_LENS" };
$bed_entry[ blockStarts ] = join ",", @begs;
- $bed_entry[ thickEnd ] = $bp_record->{ "THICK_END" } + 1;
+ # $bed_entry[ thickEnd ] = $bp_record->{ "THICK_END" } + 1;
}
elsif ( defined $bp_record->{ "BLOCK_COUNT" } and
- defined $bp_record->{ "BLOCK_LENS" } and
- defined $bp_record->{ "Q_BEGS" } )
+ defined $bp_record->{ "BLOCK_LENS" } and
+ defined $bp_record->{ "Q_BEGS" } )
{
$bed_entry[ blockCount ] = $bp_record->{ "BLOCK_COUNT" };
$bed_entry[ blockSizes ] = $bp_record->{ "BLOCK_LENS" };
$bed_entry[ blockStarts ] = $bp_record->{ "Q_BEGS" };
- $bed_entry[ thickEnd ] = $bp_record->{ "THICK_END" } + 1;
+ # $bed_entry[ thickEnd ] = $bp_record->{ "THICK_END" } + 1;
}
return wantarray ? @bed_entry : \@bed_entry;
REC_TYPE => "PSL",
BLOCK_LENS => $psl->[ blockSizes ],
SNUMINSERT => $psl->[ tNumInsert ],
- Q_END => $psl->[ qEnd ],
+ Q_END => $psl->[ qEnd ] - 1,
SBASEINSERT => $psl->[ tBaseInsert ],
- S_END => $psl->[ tEnd ],
+ S_END => $psl->[ tEnd ] - 1,
QBASEINSERT => $psl->[ qBaseInsert ],
REPMATCHES => $psl->[ repMatches ],
QNUMINSERT => $psl->[ qNumInsert ],