Skip to content

Commit

Permalink
Prevent error message, if table already exists
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Nuhn committed Nov 23, 2015
1 parent 23dbc02 commit 35eff95
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions scripts/sequencing/load_phantom_peak_file.pl
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ =head1 load_phantom_peak_file.pl
=head1 SYNOPSIS
export R_LIBS=/software/ensembl/funcgen/R-modules
/software/R-3.2.2/bin/Rscript /software/ensembl/funcgen/spp_package/run_spp.R \
-c=/lustre/scratch109/ensembl/funcgen/mn1/ersa/faang/testbams/K562:hist:BR1_H3K4me3_3526_bwa_samse_1.bam \
-savp -out=/lustre/scratch109/ensembl/funcgen/mn1/ersa/faang/testbams
./scripts/sequencing/load_phantom_peak_file.pl \
--result_set_id 20 \
--result_file /lustre/scratch109/ensembl/funcgen/mn1/ersa/faang/testbams/test \
Expand Down Expand Up @@ -85,7 +91,7 @@ =head1 DESCRIPTION
-dbname => $dbname,
);
my $logic_name = 'phantom peak quality tools';
my @flagstats_analysis_details = (
my @phantom_peak_analysis_details = (
-logic_name => $logic_name,
-program => 'run_spp.R',
-parameters => '',
Expand All @@ -105,7 +111,7 @@ =head1 DESCRIPTION

if (! $analysis && ! $dry_run) {
$logger->info("No analysis with logic name $logic_name found. Creating one.");
$analysis = Bio::EnsEMBL::Analysis->new(@flagstats_analysis_details);
$analysis = Bio::EnsEMBL::Analysis->new(@phantom_peak_analysis_details);
$analysis_adaptor->store($analysis);
}
my $analysis_id = $analysis->dbID;
Expand Down Expand Up @@ -222,7 +228,7 @@ sub create_table {
my $sql_processor = $param->{sql_processor};

my $sql = <<SQL
CREATE TABLE `result_set_qc_phantom_peak` (
CREATE TABLE if not exists `result_set_qc_phantom_peak` (
`result_set_qc_phantom_peak_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`analysis_id` int(10) unsigned,
`result_set_id` int(10) unsigned NOT NULL,
Expand Down

0 comments on commit 35eff95

Please sign in to comment.