Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ensembl
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ensembl-gh-mirror
ensembl
Commits
5809543b
Commit
5809543b
authored
15 years ago
by
Steve Trevanion
Browse files
Options
Downloads
Patches
Plain Diff
get duplicates if requested, chr Y hack
parent
dca80434
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/Bio/EnsEMBL/Utils/ConversionSupport.pm
+33
-30
33 additions, 30 deletions
modules/Bio/EnsEMBL/Utils/ConversionSupport.pm
with
33 additions
and
30 deletions
modules/Bio/EnsEMBL/Utils/ConversionSupport.pm
+
33
−
30
View file @
5809543b
...
@@ -1122,6 +1122,9 @@ sub _by_chr_num {
...
@@ -1122,6 +1122,9 @@ sub _by_chr_num {
Arg[1] : (optional) Int $cutoff - the cutoff in bp between small and
Arg[1] : (optional) Int $cutoff - the cutoff in bp between small and
large chromosomes
large chromosomes
Arg[2] : (optional) Boolean to include duplicate regions, ie PAR or not
(default is no)
Example : my $chr_slices = $support->split_chromosomes_by_size;
Example : my $chr_slices = $support->split_chromosomes_by_size;
foreach my $block_size (keys %{ $chr_slices }) {
foreach my $block_size (keys %{ $chr_slices }) {
print "Chromosomes with blocksize $block_size: ";
print "Chromosomes with blocksize $block_size: ";
...
@@ -1144,40 +1147,40 @@ sub _by_chr_num {
...
@@ -1144,40 +1147,40 @@ sub _by_chr_num {
=cut
=cut
sub
split_chromosomes_by_size
{
sub
split_chromosomes_by_size
{
my
$self
=
shift
;
my
$self
=
shift
;
my
$cutoff
=
shift
||
5000000
;
my
$cutoff
=
shift
||
5000000
;
my
$dup
=
shift
||
0
;
my
$slice_adaptor
=
$self
->
dba
->
get_SliceAdaptor
;
my
$slice_adaptor
=
$self
->
dba
->
get_SliceAdaptor
;
my
$top_slices
;
my
$top_slices
;
if
(
$self
->
param
('
chromosomes
'))
{
if
(
$self
->
param
('
chromosomes
'))
{
foreach
my
$chr
(
$self
->
param
('
chromosomes
'))
{
foreach
my
$chr
(
$self
->
param
('
chromosomes
'))
{
push
@
{
$top_slices
},
$slice_adaptor
->
fetch_by_region
('
chromosome
',
$chr
);
push
@
{
$top_slices
},
$slice_adaptor
->
fetch_by_region
('
chromosome
',
$chr
);
}
}
else
{
$top_slices
=
$slice_adaptor
->
fetch_all
('
chromosome
');
}
}
}
else
{
$top_slices
=
$slice_adaptor
->
fetch_all
('
chromosome
',
undef
,
0
,
$dup
);
}
my
(
$big_chr
,
$small_chr
,
$min_big_chr
,
$min_small_chr
);
my
(
$big_chr
,
$small_chr
,
$min_big_chr
,
$min_small_chr
);
foreach
my
$slice
(
@
{
$top_slices
})
{
foreach
my
$slice
(
@
{
$top_slices
})
{
if
(
$slice
->
length
<
$cutoff
)
{
next
if
(
$slice
->
length
eq
10000
);
#hack for chrY pseudoslice
if
(
!
$min_small_chr
or
(
$min_small_chr
>
$slice
->
length
))
{
if
(
$slice
->
length
<
$cutoff
)
{
$min_small_chr
=
$slice
->
length
;
if
(
!
$min_small_chr
or
(
$min_small_chr
>
$slice
->
length
))
{
}
$min_small_chr
=
$slice
->
length
;
# push small chromosomes onto $small_chr
}
push
@
{
$small_chr
},
$slice
;
# push small chromosomes onto $small_chr
}
push
@
{
$small_chr
},
$slice
;
if
(
!
$min_big_chr
or
(
$min_big_chr
>
$slice
->
length
)
&&
$slice
->
length
>
$cutoff
)
{
$min_big_chr
=
$slice
->
length
;
}
# push _all_ chromosomes onto $big_chr
push
@
{
$big_chr
},
$slice
;
}
}
if
(
!
$min_big_chr
or
(
$min_big_chr
>
$slice
->
length
)
&&
$slice
->
length
>
$cutoff
)
{
$min_big_chr
=
$slice
->
length
;
}
# push _all_ chromosomes onto $big_chr
push
@
{
$big_chr
},
$slice
;
}
my
$chr_slices
;
$chr_slices
->
{
int
(
$min_big_chr
/
150
)}
=
$big_chr
if
$min_big_chr
;
$chr_slices
->
{
int
(
$min_small_chr
/
150
)}
=
$small_chr
if
$min_small_chr
;
my
$chr_slices
;
return
$chr_slices
;
$chr_slices
->
{
int
(
$min_big_chr
/
150
)}
=
$big_chr
if
$min_big_chr
;
$chr_slices
->
{
int
(
$min_small_chr
/
150
)}
=
$small_chr
if
$min_small_chr
;
return
$chr_slices
;
}
}
=head2 log
=head2 log
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment