From 9d3d3eaaa297f82e2a15e9c49e390587e2b4575b Mon Sep 17 00:00:00 2001 From: Web Admin <w3adm@sanger.ac.uk> Date: Tue, 13 Jan 2004 10:30:47 +0000 Subject: [PATCH] add some calc stuff --- modules/Bio/EnsEMBL/DBSQL/SliceAdaptor.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/Bio/EnsEMBL/DBSQL/SliceAdaptor.pm b/modules/Bio/EnsEMBL/DBSQL/SliceAdaptor.pm index bf99509e44..b9886d612a 100644 --- a/modules/Bio/EnsEMBL/DBSQL/SliceAdaptor.pm +++ b/modules/Bio/EnsEMBL/DBSQL/SliceAdaptor.pm @@ -803,6 +803,12 @@ sub fetch_by_Feature{ } } +## Size may be stored as a %age of the length of the feature +## Size = 100% gives no context +## Size = 200% gives context - 50% the size of the feature either side of feature + + $size = int( ($1-100)/200 * ($fend-$fstart+1) ) if( $size =~/([\d+\.]+)%/ ); + #return a new slice covering the region of the feature return Bio::EnsEMBL::Slice->new(-seq_region_name => $slice->seq_region_name, -coord_system => $slice->coord_system, -- GitLab