Skip to content
Snippets Groups Projects
Commit c6db8b19 authored by Daniel Rios's avatar Daniel Rios
Browse files

updated translation_attribs to calculate peptide stats in vega and otherfeatures databases

parent 416308b2
No related branches found
No related tags found
No related merge requests found
......@@ -153,8 +153,8 @@ elsif(defined ($pattern)){
$sth->execute();
my $dbs = $sth->fetchall_arrayref();
foreach my $db_name (@{$dbs}){
my ($species) = ( $db_name->[0] =~ /(^[a-z]+_[a-z]+)_core_\d+/ );
#this is a core database
my ($species) = ( $db_name->[0] =~ /(^[a-z]+_[a-z]+)_(core|vega|otherfeatures)_\d+/ );
my $dba = Bio::EnsEMBL::DBSQL::DBAdaptor->new(-host => $host,
-user => $user,
-pass => $pass,
......@@ -162,7 +162,20 @@ elsif(defined ($pattern)){
-group => 'core',
-species => $species,
-dbname => $db_name->[0]
);
);
if ($db_name->[0] =~ /(vega|otherfeatures)/){
my $other_dbname = $db_name->[0];
$other_dbname =~ s/$1/core/;
#for vega databases, add the core as the dna database
my $core_db = Bio::EnsEMBL::DBSQL::DBAdaptor->new(-host => $host,
-user => $user,
-pass => $pass,
-port => $port,
-species => $species,
-dbname => $other_dbname
);
$dba->dnadb($core_db);
}
push @{$dbas},$dba;
}
}
......@@ -174,13 +187,24 @@ elsif(defined ($dbname)){
-port => $port,
-dbname => $dbname
);
if ($dbname =~ /(vega|otherfeatures)/){
my $other_dbname = $dbname;
$other_dbname =~ s/$1/core/;
#for vega databases, add the core as the dna database
my $core_db = Bio::EnsEMBL::DBSQL::DBAdaptor->new(-host => $host,
-user => $user,
-pass => $pass,
-port => $port,
-dbname => $other_dbname
);
$dba->dnadb($core_db);
}
push @{$dbas},$dba;
}
else{
thrown("Not entered properly database connection param. Read docs\n");
}
my %attributes; #hash containing attributes to be stored and removed from the databse
my $run_both = undef;
if (!defined($pepstats_only) and !defined($met_and_stop_only)){
......@@ -250,7 +274,7 @@ sub get_pepstats {
my $peptide_seq ;
eval { $peptide_seq = $translation->seq ; };
eval { $peptide_seq = $translation->seq};
return {} if ($@ || $peptide_seq =~ m/[BZX]/ig);
if( $peptide_seq !~ /\n$/ ){ $peptide_seq .= "\n" }
$peptide_seq =~ s/\*$//;
......@@ -291,7 +315,8 @@ sub get_met_and_stop{
my $peptide_seq ;
eval { $peptide_seq = $translation->seq ; };
return {} if ($@ || $peptide_seq =~ m/[BZX]/ig);
# return {} if ($@ || $peptide_seq =~ m/[BZX]/ig);
return if ($@); #if there is no translation, return
if( $peptide_seq !~ /\n$/ ){ $peptide_seq .= "\n" }
#need to get transleatable_seq to find out if there is a stop codon
......
......@@ -133,3 +133,19 @@ foreach my $pattern (@ranges){
#print $call,"\n";
}
#we now need to run it for the otherfeatures|vega databases, but only the pepstats
$options .= "--pepstats_only ";
my $vega_db = ".*_vega_$release\_.*";
$call = "bsub -o /lustre/scratch1/ensembl/dr2/tmp_smallfiles/output_translation_vega.txt -q $queue -R$memory ./translation_attribs.pl -user $user -pass $pass $options";
$call .= " --pattern '" . $vega_db. "'";
system($call);
#print $call,"\n";
my $other_db = ".*_otherfeatures_$release\_.*";
$call = "bsub -o /lustre/scratch1/ensembl/dr2/tmp_smallfiles/output_translation_other.txt -q $queue -R$memory ./translation_attribs.pl -user $user -pass $pass $options";
$call .= " --pattern '" . $other_db. "'";
system($call);
#print $call,"\n";
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