Skip to content

Commit

Permalink
fixing drug related bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
amilacsw committed Dec 5, 2017
2 parents 4532d89 + 8de6b5b commit cf2dcd1
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 23 deletions.
Binary file modified HotSpot3D-1.8.2.tar.gz
Binary file not shown.
16 changes: 4 additions & 12 deletions lib/TGI/Mutpro/Preprocess/Calpro.pm
Original file line number Diff line number Diff line change
Expand Up @@ -300,11 +300,7 @@ sub writeProximityFile {
# Get AminoAcid object for residue in chain '$uniprotChain',
# at position $position
$uniprotAminoAcidRef = $$peptideRef{$uniprotChain}->getAminoAcidObject( $residuePosition );
next if ( $$uniprotAminoAcidRef->isHOH() == 0 ); #skip water, but not other compounds
#my $thisIsProtein1 = 1;
#if ( not $$uniprotAminoAcidRef->isAA() ) {
# $thisIsProtein1 = 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 @@ -343,11 +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->isHOH() == 0 ); #skip water, but not other compounds
#my $thisIsProtein2 = 1;
#if ( not $$uniprotAminoAcidRef->isAA() ) {
# $thisIsProtein2 = 0;
#}
next if ( $$aaObjRef->isHOH() == 1 );
if ( (defined $otherChainOffset) and ($otherChainOffset eq "N/A") ) {
$correctedPosition = $position;
} else {
Expand Down Expand Up @@ -535,8 +527,8 @@ sub checkOffsets {
#if not an AA, convertAA returns original value if length aminoAcid <= 3, 'Z' if length == 1, undef otherwise
$aminoAcidA = TGI::Mutpro::Preprocess::PdbStructure::convertAA( $aminoAcidA );
$aminoAcidB = TGI::Mutpro::Preprocess::PdbStructure::convertAA( $aminoAcidB );
next if ( !defined $aminoAcidA || !defined $aminoAcidB );
#check if position has an amino acid & whether its name is same as converted aminoAcid
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
16 changes: 7 additions & 9 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 All @@ -559,15 +560,12 @@ sub convertAA {
my %threeToOne;
foreach (keys %oneToThree) { $threeToOne{$oneToThree{$_}} = $_; }
if ( defined $oneToThree{$residue} ) {
return $oneToThree{$residue};
} 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'";
}
return undef;
return $oneToThree{$residue};
}elsif ( defined $threeToOne{$residue} ) {
return $threeToOne{$residue};
}elsif ( length( $residue ) <= 3 ) {
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 cf2dcd1

Please sign in to comment.