Skip to content

Commit

Permalink
Fixing a bug which caused prep to filter out all the drugs
Browse files Browse the repository at this point in the history
  • Loading branch information
amilacsw committed Dec 5, 2017
1 parent ddebbe2 commit 843d071
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Usage

Stable: v0.6.0

Beta: up to v1.8.1
Beta: up to v1.8.2
Author: Beifang Niu, John Wallis, Adam D Scott, Sohini Sengupta, & Amila Weerasinghe

Expand Down
4 changes: 2 additions & 2 deletions bin/hotspot3d
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
#----------------------------------
# $Authors: Beifang Niu & Adam D Scott
# $Date: 2013-08-08 13:22:08 -0500 (Thu Aug 8 13:22:08 CDT 2013) $
# $Revision: 1.8.1 $
# $Revision: 1.8.2 $
# $URL: $
#----------------------------------
use strict;
use warnings;

our $VERSION = 'V1.8.1';
our $VERSION = 'V1.8.2';

use Carp;
use FileHandle;
Expand Down
2 changes: 1 addition & 1 deletion dist.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = HotSpot3D
author = Beifang Niu, John Wallis, Adam D Scott, Sohini Sengupta, Amila Weerasinghe, & Matthew H Bailey from McDonnell Genome Institute of Washington University at St. Louis
version = 1.8.1
version = 1.8.2
license = Perl_5
copyright_holder = McDonnell Genome Institute at Washington University
copyright_year = 2017
Expand Down
6 changes: 3 additions & 3 deletions lib/TGI/Mutpro/Preprocess/Calpro.pm
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ sub writeProximityFile {
# Get AminoAcid object for residue in chain '$uniprotChain',
# at position $position
$uniprotAminoAcidRef = $$peptideRef{$uniprotChain}->getAminoAcidObject( $residuePosition );
next if ( $$uniprotAminoAcidRef->isAA() == 0 );
next if ( $$uniprotAminoAcidRef->isHOH() == 1 );
$uniprotAaName = $$uniprotAminoAcidRef->name();
# Updated 170510 : use a hash with chain and regions for retrieving the offset
$uniprotChainOffset = getOffset( $allOffsets, $uniprotChain, $residuePosition );
Expand Down Expand Up @@ -339,7 +339,7 @@ sub writeProximityFile {
foreach $position ( sort {$a<=>$b} @tmp_array_positions ) {
$otherChainOffset = getOffset( $allOffsets, $chain, $position );
$aaObjRef = $$peptideRef{$chain}->getAminoAcidObject($position);
next if ( $$aaObjRef->isAA() == 0 );
next if ( $$aaObjRef->isHOH() == 1 );
if ( (defined $otherChainOffset) and ($otherChainOffset eq "N/A") ) {
$correctedPosition = $position;
} else {
Expand Down Expand Up @@ -526,7 +526,7 @@ sub checkOffsets {
next if ( $uniprotB !~ /^\w+$/ || $offsetA !~ /^-?\d+$/ || $offsetB !~ /^-?\d+$/ || $positionA !~ /^-?\d+$/ || $positionB !~ /^-?\d+$/ );
$aminoAcidA = TGI::Mutpro::Preprocess::PdbStructure::convertAA( $aminoAcidA );
$aminoAcidB = TGI::Mutpro::Preprocess::PdbStructure::convertAA( $aminoAcidB );
next if ( !defined $aminoAcidA || !defined $aminoAcidB );
next if ( !defined $aminoAcidA & !defined $aminoAcidB );
#next unless ( TGI::Mutpro::Preprocess::AminoAcid::checkAA( $aminoAcidA ) and TGI::Mutpro::Preprocess::AminoAcid::checkAA( $aminoAcidB )
if ( defined $pdbUniprotPosition{$pdbId}{$uniprotA}{$positionA+$offsetA} && $pdbUniprotPosition{$pdbId}{$uniprotA}{$positionA+$offsetA} ne $aminoAcidA ) {
print $coorfh "Inconsistent amino acids for $uniprotA position $positionA+$offsetA in $pdbId: '$pdbUniprotPosition{$pdbId}{$uniprotA}{$positionA+$offsetA}' and $aminoAcidA \n";
Expand Down
5 changes: 3 additions & 2 deletions lib/TGI/Mutpro/Preprocess/PdbStructure.pm
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,7 @@ sub convertAA {
# Convert single amino acid code to triplet
# or triplet to single amino acid code
my $residue = $_[0];
my $convertedAA = undef;
$residue = uc $residue;
my %oneToThree = (
A => 'ALA',
Expand Down Expand Up @@ -563,8 +564,8 @@ sub convertAA {
}elsif ( defined $threeToOne{$residue} ) {
return $threeToOne{$residue};
}elsif ( length( $residue ) <= 3 ) {
length( $residue ) == 1 ? return "Z" : return $residue;
} else { carp "Unrecognized format for amino acid '$residue'"; }
length( $residue ) == 1 ? return "Z" : return $convertedAA;
} else { return $convertedAA; carp "Unrecognized format for amino acid '$residue'"; }
}

sub printStructure {
Expand Down
8 changes: 6 additions & 2 deletions lib/TGI/Mutpro/Preprocess/Uppro.pm
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ use List::MoreUtils qw( uniq );

use TGI::Mutpro::Preprocess::Uniprot;
use TGI::Mutpro::Preprocess::HugoGeneMethods;
use TGI::Files::File;
use TGI::Files::MAF;
use TGI::Files::List;

Expand Down Expand Up @@ -168,8 +169,8 @@ sub process {
$fh->print( "\t$alias_list\n" );
}
$fh->close();
my $cmd_list_submit_file_fh;
unless( open ( $cmd_list_submit_file_fh, ">", $this->{'cmd_list_submit_file'} ) ) { die "HotSpot3D Uppro Error: Could not open cmd file (".$this->{'cmd_list_submit_file'}.")"; }
my $cmd_list_submit_file_fh = new FileHandle; #TGI::Files::File->new( $this->{'cmd_list_submit_file'} ) ;
unless( $cmd_list_submit_file_fh -> open ( $this->{'cmd_list_submit_file'}, "w" ) ) { die "HotSpot3D Uppro Error: Could not open cmd file (".$this->{'cmd_list_submit_file'}.")"; }
print STDOUT "Creating ".$this->{'cmd_list_submit_file'}."\n";
my $command = "";
if ( $this->{'parallel'} eq $BSUB ) {
Expand Down Expand Up @@ -215,12 +216,15 @@ sub makeBSUBCalproCommand {
sub makeSerialCalproCommand {
my ( $this , $inpro_dir , $cmd_list_submit_file_fh , $uniprotid_toupdate ) = @_;
my $log_dir = "$this->{'output_dir'}\/Logs\/";
my $serialCommand = "echo Serially Running Calpro Commands";
map {
system("touch $inpro_dir/$_.ProximityFile.csv");
my $command = $this->makeCalproCommand( $_ );
print STDOUT $command."\n";
$cmd_list_submit_file_fh->print( $command."\n" );
$serialCommand .= ";".$command;
} keys %{$uniprotid_toupdate};
return $serialCommand;
}

sub makeLocalCalproCommand {
Expand Down

0 comments on commit 843d071

Please sign in to comment.