Skip to content
Snippets Groups Projects
Commit 6d7cf213 authored by Andreas Kusalananda Kähäri's avatar Andreas Kusalananda Kähäri
Browse files

Make sure the analysis_description is also deleted and properly

reinstated.  The analysis_id in the analysis table and in the
analysis_description table seems to become unsynced otherwise.
parent 26dfcddc
No related branches found
No related tags found
No related merge requests found
......@@ -99,6 +99,13 @@ print "Deleting old knownGeneDensity and geneDensity features\n";
$sth = $db->dbc->prepare("DELETE df, dt, a FROM density_feature df, density_type dt, analysis a WHERE a.analysis_id=dt.analysis_id AND dt.density_type_id=df.density_type_id AND a.logic_name IN ('knownGeneDensity', 'geneDensity')");
$sth->execute();
$sth = $db->dbc()->prepare(
qq(
DELETE ad
FROM analysis_description ad
WHERE ad.display_label IN ('knownGeneDensity', 'geneDensity')) );
$sth->execute();
my $dfa = $db->get_DensityFeatureAdaptor();
my $dta = $db->get_DensityTypeAdaptor();
my $aa = $db->get_AnalysisAdaptor();
......@@ -112,14 +119,20 @@ my $slice_adaptor = $db->get_SliceAdaptor();
my $top_slices = $slice_adaptor->fetch_all('toplevel');
my @sorted_slices = sort { $b->seq_region_length() <=> $a->seq_region_length()} @$top_slices;
my $analysis = new Bio::EnsEMBL::Analysis (-program => "gene_density_calc.pl",
-database => "ensembl",
-gff_source => "gene_density_calc.pl",
-gff_feature => "density",
-logic_name => "knownGeneDensity");
$aa->store( $analysis );
my $analysis =
new Bio::EnsEMBL::Analysis(
-program => "gene_density_calc.pl",
-database => "ensembl",
-gff_source => "gene_density_calc.pl",
-gff_feature => "density",
-logic_name => "knownGeneDensity",
-description => 'Known gene density features in a database '
. 'as calculated by gene_density_calc.pl',
-display_label => 'knownGeneDensity',
-displayable => 1 );
$aa->store($analysis);
$aa->update($analysis);
$analysis = new Bio::EnsEMBL::Analysis (-program => "gene_density_calc.pl",
-database => "ensembl",
......
......@@ -54,7 +54,20 @@ if( ! $dna_count ) {
print "Deleting old PercentGC features\n";
$sth = $db->dbc->prepare("DELETE df, dt, a FROM density_feature df, density_type dt, analysis a WHERE a.analysis_id=dt.analysis_id AND dt.density_type_id=df.density_type_id AND a.logic_name='PercentGC'");
$sth = $db->dbc->prepare(
qq(
DELETE df, dt, a
FROM density_feature df, density_type dt, analysis a
WHERE a.analysis_id=dt.analysis_id
AND dt.density_type_id=df.density_type_id
AND a.logic_name='PercentGC') );
$sth->execute();
$sth = $db->dbc()->prepare(
qq(
DELETE ad
FROM analysis_description ad
WHERE ad.display_label = 'PercentGC') );
$sth->execute();
#
......@@ -73,14 +86,19 @@ my @sorted_slices = sort { $b->seq_region_length() <=> $a->seq_region_length()}
# Create new analysis object for density calculation.
#
my $analysis = new Bio::EnsEMBL::Analysis (-program => "percent_gc_calc.pl",
-database => "ensembl",
-gff_source => "percent_gc_calc.pl",
-gff_feature => "density",
-logic_name => "PercentGC");
my $analysis =
new Bio::EnsEMBL::Analysis(
-program => "percent_gc_calc.pl",
-database => "ensembl",
-gff_source => "percent_gc_calc.pl",
-gff_feature => "density",
-logic_name => "PercentGC",
-description => 'Percentage of G/C bases in the sequence.',
-display_label => 'PercentGC',
-displayable => 1 );
$aa->store($analysis);
$aa->update($analysis);
#
# Create new density type.
......
......@@ -67,6 +67,13 @@ print "Deleting old PercentageRepeat features\n";
$sth = $db->dbc->prepare("DELETE df, dt, a FROM density_feature df, density_type dt, analysis a WHERE a.analysis_id=dt.analysis_id AND dt.density_type_id=df.density_type_id AND a.logic_name='PercentageRepeat'");
$sth->execute();
$sth = $db->dbc()->prepare(
qq(
DELETE ad
FROM analysis_description ad
WHERE ad.display_label = 'PercentageRepeat') );
$sth->execute();
my $slice_adaptor = $db->get_SliceAdaptor();
my $dfa = $db->get_DensityFeatureAdaptor();
my $dta = $db->get_DensityTypeAdaptor();
......@@ -78,13 +85,20 @@ my $aa = $db->get_AnalysisAdaptor();
# Create new analysis object for density calculation.
#
my $analysis = new Bio::EnsEMBL::Analysis (-program => "repeat_coverage_calc.pl",
-database => "ensembl",
-gff_source => "repeat_coverage_calc.pl",
-gff_feature => "density",
-logic_name => "PercentageRepeat");
my $analysis =
new Bio::EnsEMBL::Analysis(
-program => "repeat_coverage_calc.pl",
-database => "ensembl",
-gff_source => "repeat_coverage_calc.pl",
-gff_feature => "density",
-logic_name => "PercentageRepeat",
-description =>
'Percentage of repetetive elements for top level seq_regions.',
-display_label => 'PercentageRepeat',
-displayable => 1 );
$aa->store($analysis);
$aa->update($analysis);
my $slices = $slice_adaptor->fetch_all( "toplevel" );
my @sorted_slices = sort { $b->seq_region_length() <=> $a->seq_region_length() } @$slices;
......
......@@ -53,6 +53,13 @@ if( ! variation_attach( $db )) {
my $sth = $db->dbc->prepare("DELETE df, dt, a FROM density_feature df, density_type dt, analysis a WHERE a.analysis_id=dt.analysis_id AND dt.density_type_id=df.density_type_id AND a.logic_name='snpDensity'");
$sth->execute();
$sth = $db->dbc()->prepare(
qq(
DELETE ad
FROM analysis_description ad
WHERE ad.display_label = 'snpDensity') );
$sth->execute();
#
# Get the adaptors needed;
#
......@@ -65,15 +72,19 @@ my $slice_adaptor = $db->get_SliceAdaptor();
my $top_slices = $slice_adaptor->fetch_all( "toplevel" );
my @sorted_slices = sort { $b->seq_region_length() <=> $a->seq_region_length()} @$top_slices;
my $analysis = new Bio::EnsEMBL::Analysis (-program => "variation_density.pl",
-database => "ensembl",
-gff_source => "variation_density.pl",
-gff_feature => "density",
-logic_name => "snpDensity");
$aa->store( $analysis );
my $analysis =
new Bio::EnsEMBL::Analysis(
-program => "variation_density.pl",
-database => "ensembl",
-gff_source => "variation_density.pl",
-gff_feature => "density",
-logic_name => "snpDensity",
-description => 'Density of SNP features on the sequence',
-display_label => 'snpDensity',
-displayable => 1 );
$aa->store($analysis);
$aa->update($analysis);
#
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment