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
4cac8efd
Commit
4cac8efd
authored
20 years ago
by
Patrick Meidl
Browse files
Options
Downloads
Patches
Plain Diff
removed obsolete scripts
parent
7d421ed2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
misc-scripts/density_feature/vega_densities_multi_db.pl
+0
-101
0 additions, 101 deletions
misc-scripts/density_feature/vega_densities_multi_db.pl
misc-scripts/density_feature/vega_seq_region_stats.pl
+0
-209
0 additions, 209 deletions
misc-scripts/density_feature/vega_seq_region_stats.pl
with
0 additions
and
310 deletions
misc-scripts/density_feature/vega_densities_multi_db.pl
deleted
100644 → 0
+
0
−
101
View file @
7d421ed2
#
# These script runs all density creation scripts on all
# databases that match input pattern. It calls all configured
# scripts of this directory with host, user,pass,port and dbname
# parameter.
#
use
strict
;
use
Getopt::
Long
;
use
DBI
;
#
# configure this hash and command line parameter section for
# adding new scripts
#
my
%density_scripts
=
(
"
gene
"
=>
"
vega_gene_density_calc.pl
",
"
gc
"
=>
"
percent_gc_calc.pl
",
"
repeat
"
=>
"
repeat_coverage_calc.pl
",
"
stats
"
=>
"
vega_seq_region_stats.pl
",
"
snp
"
=>
"
snp_lite_density.pl
"
);
my
@density_scripts
=
();
my
(
$host
,
$user
,
$pass
,
$port
,
$dbpattern
);
GetOptions
(
"
host=s
",
\
$host
,
"
user=s
",
\
$user
,
"
pass=s
",
\
$pass
,
"
port=i
",
\
$port
,
"
gene
",
sub
{
push
(
@density_scripts
,
$density_scripts
{'
gene
'}
);
},
"
gc
",
sub
{
push
(
@density_scripts
,
$density_scripts
{'
gc
'}
);
},
"
repeat
",
sub
{
push
(
@density_scripts
,
$density_scripts
{'
repeat
'}
);
},
"
stats
",
sub
{
push
(
@density_scripts
,
$density_scripts
{'
stats
'}
);
},
"
snp
",
sub
{
push
(
@density_scripts
,
$density_scripts
{'
snp
'}
);
},
"
dbpattern=s
",
\
$dbpattern
);
if
(
!
$host
||
!
$user
)
{
usage
();
}
my
$dsn
=
"
DBI:mysql:host=
$host
";
my
$args
=
"
-host
$host
";
if
(
$user
)
{
$args
.=
"
-user
$user
";
}
if
(
$port
)
{
$args
.=
"
-port
$port
";
$dsn
.=
"
;port=
$port
";
}
if
(
$pass
)
{
$args
.=
"
-pass
$pass
";
}
if
(
$host
)
{
$args
.=
"
-host
$host
";
}
my
$db
=
DBI
->
connect
(
$dsn
,
$user
,
$pass
);
my
@dbnames
=
map
{
$_
->
[
0
]
}
@
{
$db
->
selectall_arrayref
(
"
show databases
"
)
};
for
my
$dbname
(
@dbnames
)
{
if
(
$dbpattern
)
{
if
(
$dbname
!~
/$dbpattern/
)
{
next
;
}
}
else
{
print
STDERR
"
$dbname
\n
";
next
;
}
if
(
!
@density_scripts
)
{
print
"
Matches
$dbname
.
\n
";
}
else
{
for
my
$scriptname
(
@density_scripts
)
{
print
(
"
/usr/local/ensembl/bin/perl
$scriptname
$args
-dbname
$dbname
\n
"
);
system
(
"
/usr/local/ensembl/bin/perl
$scriptname
$args
-dbname
$dbname
"
);
}
}
}
sub
usage
{
print
STDERR
"
densities_multi_db.pl runs
\n
";
print
STDERR
<<EOF;
with parameters -host [hostname] -user [username with write permit]
-pass [password] -port [portnumber]
on all databases that match -dbpattern [some_db_regexp]
on -gene, -repeat, -stats, -gc.
Without -dbpattern it lists all available databases and does nothing.
EOF
exit
();
}
This diff is collapsed.
Click to expand it.
misc-scripts/density_feature/vega_seq_region_stats.pl
deleted
100644 → 0
+
0
−
209
View file @
7d421ed2
#!/usr/local/bin/perl
=head1 NAME
vega_seq_region_stats.pl -
script to calculate gene and snp numbers for mapview stats
=head1 SYNOPSIS
=head1 DESCRIPTION
=head1 LICENCE
This code is distributed under an Apache style licence:
Please see http://www.ensembl.org/code_licence.html for details
=head1 AUTHOR
Patrick Meidl <pm2@sanger.ac.uk>
=head1 CONTACT
Post questions to the EnsEMBL development list ensembl-dev@ebi.ac.uk
=cut
use
strict
;
BEGIN
{
$ENV
{'
ENSEMBL_SERVERROOT
'}
=
"
../../..
";
unshift
(
@INC
,"
$ENV
{'ENSEMBL_SERVERROOT'}/conf
");
unshift
(
@INC
,"
$ENV
{'ENSEMBL_SERVERROOT'}/ensembl-compara/modules
");
unshift
(
@INC
,"
$ENV
{'ENSEMBL_SERVERROOT'}/ensembl-draw/modules
");
unshift
(
@INC
,"
$ENV
{'ENSEMBL_SERVERROOT'}/ensembl-external/modules
");
unshift
(
@INC
,"
$ENV
{'ENSEMBL_SERVERROOT'}/ensembl-otter/modules
");
unshift
(
@INC
,"
$ENV
{'ENSEMBL_SERVERROOT'}/modules
");
unshift
(
@INC
,"
$ENV
{'ENSEMBL_SERVERROOT'}/ensembl/modules
");
unshift
(
@INC
,"
$ENV
{'ENSEMBL_SERVERROOT'}/bioperl-live
");
}
use
SiteDefs
;
use
EnsWeb
;
use
EnsEMBL::DB::
Core
;
use
Getopt::
Long
;
my
(
$species
,
$run
,
$help
);
&GetOptions
(
"
species=s
"
=>
\
$species
,
"
run=s
"
=>
\
$run
,
"
help
"
=>
\
$help
,
"
h
"
=>
\
$help
,
);
if
(
$help
||
!
(
$species
&&
$run
)){
print
qq(Usage:
./vega_seq_region_stats.pl
--species=Homo_sapiens
--run=gene,snp
[--help]\n\n)
;
exit
;
}
$ENV
{'
ENSEMBL_SPECIES
'}
=
$species
;
## set db user/pass to allow write access
my
$db_ref
=
$
EnsWeb::
species_defs
->
databases
;
$db_ref
->
{'
ENSEMBL_DB
'}{'
USER
'}
=
$
EnsWeb::
species_defs
->
ENSEMBL_WRITE_USER
;
$db_ref
->
{'
ENSEMBL_DB
'}{'
PASS
'}
=
$
EnsWeb::
species_defs
->
ENSEMBL_WRITE_PASS
;
## connect to databases
my
%run
;
@run
{
split
(
/,/
,
$run
)}
=
1
;
my
@dbs
=
qw(core)
;
push
@dbs
,
'
glovar
'
if
(
$run
{'
snp
'});
my
$databases
=
&
EnsEMBL::DB::Core::
get_databases
(
@dbs
);
die
"
Problem connecting to databases:
$databases
->{'error'}
\n
"
if
$databases
->
{'
error
'}
;
warn
"
Database error:
$databases
->{'non_fatal_error'}
\n
"
if
$databases
->
{'
non_fatal_error
'};
## get slice and attribute adaptors, loop over all toplevel slices
my
$slice_adaptor
=
$databases
->
{'
core
'}
->
get_SliceAdaptor
();
my
$attrib_adaptor
=
$databases
->
{'
core
'}
->
get_AttributeAdaptor
();
my
$top_slices
=
$slice_adaptor
->
fetch_all
("
toplevel
");
foreach
my
$slice
(
@$top_slices
)
{
my
%num
;
my
@attribs
;
print
STDERR
"
Processing seq_region
",
$slice
->
seq_region_name
(),
"
:
\n
";
## genes
if
(
$run
{'
gene
'})
{
print
STDERR
"
\t
Genes...
\n
";
my
@genes
=
@
{
$slice
->
get_all_Genes
()};
foreach
my
$gene
(
@genes
)
{
my
$type
=
$gene
->
type
;
$num
{
$type
}
++
;
if
(
$type
=~
/seudogene$/
)
{
$num
{'
Total_Pseudogenes
'}
++
;
}
}
print
STDERR
"
Slice
",
$slice
->
seq_region_name
(),
"
has the following features:
\n\n
";
foreach
my
$type
(
keys
%num
)
{
print
STDERR
"
$type
=
$num
{
$type
}
\n
";
}
push
@attribs
,
Bio::EnsEMBL::
Attribute
->
new
(
-
NAME
=>
'
Known genes
',
-
CODE
=>
'
KnownGeneCount
',
-
VALUE
=>
$num
{'
Known
'},
-
DESCRIPTION
=>
'
Total Number of Known genes
');
push
@attribs
,
Bio::EnsEMBL::
Attribute
->
new
(
-
NAME
=>
'
Novel CDS
',
-
CODE
=>
'
NovelCDSCount
',
-
VALUE
=>
$num
{'
Novel_CDS
'},
-
DESCRIPTION
=>
'
Total Number of Novel CDSs
');
push
@attribs
,
Bio::EnsEMBL::
Attribute
->
new
(
-
NAME
=>
'
Novel transcripts
',
-
CODE
=>
'
NovelTransCount
',
-
VALUE
=>
$num
{'
Novel_Transcript
'},
-
DESCRIPTION
=>
'
Total Number of Novel transcripts
');
push
@attribs
,
Bio::EnsEMBL::
Attribute
->
new
(
-
NAME
=>
'
Putative transcripts
',
-
CODE
=>
'
PutTransCount
',
-
VALUE
=>
$num
{'
Putative
'},
-
DESCRIPTION
=>
'
Total Number of Putative transcripts
');
push
@attribs
,
Bio::EnsEMBL::
Attribute
->
new
(
-
NAME
=>
'
Predicted transcripts
',
-
CODE
=>
'
PredTransCount
',
-
VALUE
=>
$num
{'
Predicted_Gene
'},
-
DESCRIPTION
=>
'
Total Number of Predicted transcripts
');
push
@attribs
,
Bio::EnsEMBL::
Attribute
->
new
(
-
NAME
=>
'
Total Pseudogenes
',
-
CODE
=>
'
TotPsCount
',
-
VALUE
=>
$num
{'
Total_Pseudogenes
'},
-
DESCRIPTION
=>
'
Total Number of Pseudogenes
');
push
@attribs
,
Bio::EnsEMBL::
Attribute
->
new
(
-
NAME
=>
'
Unclassified pseudogenes
',
-
CODE
=>
'
UnclassPsCount
',
-
VALUE
=>
$num
{'
Pseudogene
'},
-
DESCRIPTION
=>
'
Number of Unclassified pseudogenes
');
push
@attribs
,
Bio::EnsEMBL::
Attribute
->
new
(
-
NAME
=>
'
Processed pseudogenes
',
-
CODE
=>
'
ProcPsCount
',
-
VALUE
=>
$num
{'
Processed_pseudogene
'},
-
DESCRIPTION
=>
'
Number of Processed pseudogenes
');
push
@attribs
,
Bio::EnsEMBL::
Attribute
->
new
(
-
NAME
=>
'
Unprocessed pseudogenes
',
-
CODE
=>
'
UnprocPsCount
',
-
VALUE
=>
$num
{'
Unprocessed_pseudogene
'},
-
DESCRIPTION
=>
'
Number of Unprocessed pseudogenes
');
push
@attribs
,
Bio::EnsEMBL::
Attribute
->
new
(
-
NAME
=>
'
Ig Segments
',
-
CODE
=>
'
IgSegCount
',
-
VALUE
=>
$num
{'
Ig_Segment
'},
-
DESCRIPTION
=>
'
Total Number of Ig Segments
');
push
@attribs
,
Bio::EnsEMBL::
Attribute
->
new
(
-
NAME
=>
'
Ig Pseudogene Segments
',
-
CODE
=>
'
IgPsSegCount
',
-
VALUE
=>
$num
{'
Ig_Pseudogene_Segment
'},
-
DESCRIPTION
=>
'
Total Number of Ig Pseudogene Segments
');
}
## snps
if
(
$run
{'
snp
'})
{
print
STDERR
"
\t
SNPs...
\n
";
my
$snps
=
$slice
->
get_all_ExternalFeatures
('
GlovarSNP
');
push
@attribs
,
Bio::EnsEMBL::
Attribute
->
new
(
-
NAME
=>
'
SNPs
',
-
CODE
=>
'
SNPCount
',
-
VALUE
=>
scalar
(
@$snps
),
-
DESCRIPTION
=>
'
Total Number of SNPs
');
}
$attrib_adaptor
->
store_on_Slice
(
$slice
,
\
@attribs
);
# print_chromo_stats([$slice]);
}
sub
print_chromo_stats
{
my
$chromosomes
=
shift
;
foreach
my
$chr
(
@$chromosomes
)
{
print
"
\n
chromosome:
",
$chr
->
seq_region_name
(),"
\n
";
foreach
my
$attrib
(
@
{
$chr
->
get_all_Attributes
()})
{
print
"
",
$attrib
->
name
(),
"
:
",
$attrib
->
value
(),
"
\n
";
}
}
}
1
;
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