Skip to content

Commit

Permalink
option to use average distance instead of shortest distance measures.…
Browse files Browse the repository at this point in the history
… also added v0.5.5 tar.gz
  • Loading branch information
AdamDS committed Sep 29, 2016
1 parent 0ac2f78 commit 67a72a6
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
Binary file renamed HotSpot3D-0.5.4.tar.gz → HotSpot3D-0.5.5.tar.gz
Binary file not shown.
18 changes: 17 additions & 1 deletion lib/TGI/Mutpro/Preprocess/Calpro.pm
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ use TGI::Mutpro::Preprocess::Uniprot;
use TGI::Mutpro::Preprocess::PdbStructure;
use TGI::Mutpro::Preprocess::HugoGeneMethods;

my $MINDISTANCE = "minDistance";
my $AVGDISTANCE = "averageDistance";

sub new {
my $class = shift;
my $this = {};
Expand All @@ -70,6 +73,7 @@ sub new {
$this->{'uniprot_ref'} = undef;
$this->{'stat'} = undef;
$this->{'pdb_file_dir'} = undef;
$this->{'distance_measure'} = $AVGDISTANCE;
## add drug port database file (08.04.2014)
#$this->{'drugport_file'} = undef;
bless $this, $class;
Expand All @@ -87,6 +91,7 @@ sub process {
'output-dir=s' => \$this->{'output_dir'},
'uniprot-id=s' => \$this->{'uniprot_id'},
'pdb-file-dir=s' => \$this->{'pdb_file_dir'},
'measure=s' => \$this->{'distance_measure'},
#'drugport-file=s' => \$this->{'drugport_file'},

'help' => \$help,
Expand All @@ -96,6 +101,10 @@ sub process {
unless(defined $this->{'uniprot_id'}) { warn 'You must provide a Uniprot ID !', "\n"; die $this->help_text(); }
unless( $this->{'output_dir'} and (-e $this->{'output_dir'} ) ) { warn 'You must provide a output directory ! ', "\n"; die $this->help_text(); }
unless( $this->{'pdb_file_dir'} and (-e $this->{'pdb_file_dir'}) ) { warn 'You must provide a PDB file directory ! ', "\n"; die $this->help_text(); }
if ( $this->{'distance_measure'} eq $MINDISTANCE or $this->{'distance_measure'} eq $AVGDISTANCE ) {
warn "HotSpot3D::Calpro warning: measure not recognized, resetting to default = averageDistance\n";
$this->{'distance_measure'} = $AVGDISTANCE;
}
#unless( $this->{'drugport_file'} and (-e $this->{'drugport_file'}) ) { warn 'You must provide a drugport database file ! ', "\n"; die $this->help_text(); }
#### processing ####
# This can be used if only want to write out pairs when one is in a Uniprot-annotated domain
Expand Down Expand Up @@ -314,7 +323,13 @@ sub writeProximityFile {
# is not close to the amino acid at '$residuePosition'
# of peptide chain '$uniprotChain'
$aaObjRef = $$peptideRef{$chain}->getAminoAcidObject($position);
$distanceBetweenResidues = $$aaObjRef->minDistance($uniprotAminoAcidRef);
if ( $this->{'distance_measure'} == $MINDISTANCE ) {
$distanceBetweenResidues = $$aaObjRef->minDistance($uniprotAminoAcidRef);
} elsif ( $this->{'distance_measure'} == $AVGDISTANCE ) {
$distanceBetweenResidues = $$aaObjRef->averageDistance($uniprotAminoAcidRef);
} else {
$distanceBetweenResidues = $$aaObjRef->averageDistance($uniprotAminoAcidRef);
}
if ( $distanceBetweenResidues > $this->{'max_3d_dis'} ) { next; }
# Also skip if the two amino acids are in the same chain and
# within <= $PrimarySequenceDistance
Expand Down Expand Up @@ -557,6 +572,7 @@ Usage: hotspot3d calpro [options]
OPTIONAL
--3d-distance-cutoff Maximum 3D distance (<= Angstroms), default: 100
--linear-cutoff Minimum linear distance (> peptides), default: 0
--measure Distance measurement between residues (minDistance or averageDistance), default: averageDistance
--help this message
Expand Down
12 changes: 11 additions & 1 deletion lib/TGI/Mutpro/Preprocess/Uppro.pm
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ use List::MoreUtils qw( uniq );
use TGI::Mutpro::Preprocess::Uniprot;
use TGI::Mutpro::Preprocess::HugoGeneMethods;

my $MINDISTANCE = "minDistance";
my $AVGDISTANCE = "averageDistance";

sub new {
my $class = shift;
my $this = {};
Expand All @@ -34,6 +37,7 @@ sub new {
'status' => undef,
'pdb_file_dir' => undef,
'genes' => undef,
'distance_measure' => $AVGDISTANCE,
#'drugport_file' => undef,
'cmd_list_submit_file' => "cmd_list_submit_file",
);
Expand All @@ -53,6 +57,7 @@ sub process {
'output-dir=s' => \$this->{'output_dir'},
'pdb-file-dir=s' => \$this->{'pdb_file_dir'},
'gene-file=s' => \$this->{'genes'},
'measure=s' => \$this->{'distance_measure'},
#'drugport-file=s' => \$this->{'drugport_file'},
'cmd-list-submit-file=s' => \$this->{'cmd_list_submit_file'},
'hold' => \$this->{'hold'},
Expand All @@ -72,11 +77,15 @@ sub process {
my $pdbcor_dir = "$pro_dir\/pdbCoordinateFiles";
my $log_file = "$this->{'output_dir'}\/hugo.uniprot.pdb.csv";
my $log_dir = "$this->{'output_dir'}\/Logs\/";
my $measure = $this->{'distance_measure'};
unless (-e $pro_dir) { mkdir($pro_dir) || die "HotSpot3D Uppro Error: can not make $pro_dir !\n"; }
unless (-e $log_file) { if (system("touch $log_file") != 0) { die "HotSpot3D Uppro Error: can not make hugo uniprot file !\n"; } }
unless (-e $inpro_dir) { mkdir($inpro_dir) || die "HotSpot3D Uppro Error: can not make $inpro_dir !\n"; }
unless (-e $pdbcor_dir) { mkdir($pdbcor_dir) || die "HotSpot3D Uppro Error: can not make $pdbcor_dir !\n"; }
unless ( -e $log_dir ) { mkdir( $log_dir ) || die "HotSpot3D Uppro Error: can not make $log_dir !\n"; }
unless ( $measure eq $MINDISTANCE or $measure eq $AVGDISTANCE ) {
warn "HotSpot3D::Uppro warning: measure not recognized, resetting to default = averageDistance\n";
}
my %uniprotid_toupdate;
my $uniprot_to_structureref = $this->current_structures($log_file);
my $uniprot_fileref = $this->currentuniprot_files($pro_dir);
Expand Down Expand Up @@ -143,7 +152,7 @@ sub process {
system("touch $inpro_dir/$_.ProximityFile.csv");
my $bsub = "bsub -oo ".$log_dir.$_.".err.log -R 'select[type==LINUX64 && mem>16000] rusage[mem=16000]' -M 16000000";
my $update_program = " 'hotspot3d calpro";
my $programOptions = " --output-dir=".$this->{'output_dir'}." --pdb-file-dir=".$this->{'pdb_file_dir'}." --uniprot-id=".$_." --3d-distance-cutoff=".$this->{'max_3d_dis'}." --linear-cutoff=".$this->{'min_seq_dis'}."'";
my $programOptions = " --output-dir=".$this->{'output_dir'}." --pdb-file-dir=".$this->{'pdb_file_dir'}." --uniprot-id=".$_." --3d-distance-cutoff=".$this->{'max_3d_dis'}." --linear-cutoff=".$this->{'min_seq_dis'}." --measure=".$this->{'distance_measure'}."'";
my $submit_cmd = $bsub.$update_program.$programOptions;
print STDOUT $submit_cmd."\n";
$cmd_list_submit_file_fh->print($submit_cmd."\n");
Expand Down Expand Up @@ -209,6 +218,7 @@ Usage: hotspot3d uppro [options]
--gene-file File with HUGO gene names in the first column (like a .maf)
--3d-distance-cutoff Maximum 3D distance (<= Angstroms), defaul: 100
--linear-distance-cutoff Minimum linear distance (> peptides), default: 0
--measure Distance measure between residues (minDistance or averageDistance), default: averageDistance
--cmd-list-submit-file Batch jobs file to run calpro step in parallel, default: cmd_list_submit_file
--hold Do not submit batch jobs, just write cmd_list_submit_file, default: submits (takes no input)
Expand Down

0 comments on commit 67a72a6

Please sign in to comment.