Skip to content

Commit dd764bd

Browse files
committed
Merge branch 'master' of https://github.com/ding-lab/hotspot3d
Conflicts: HotSpot3D-1.0.3.tar.gz HotSpot3D-1.0.4.tar.gz HotSpot3D-1.1.0.tar.gz README.md bin/hotspot3d dist.ini lib/TGI/Mutpro/Main/Cluster.pm
2 parents 1e652cc + df66f00 commit dd764bd

File tree

10 files changed

+1467
-88
lines changed

10 files changed

+1467
-88
lines changed

bin/hotspot3d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ sub help_text {
7070
return <<HELP
7171
Program: hotspot3d - 3D mutation proximity analysis program.
7272
Version: $VERSION
73-
Author: Beifang Niu, Adam D Scott, Sohini Sengupta, & John Wallis
73+
Author: Beifang Niu, Adam D Scott, Sohini Sengupta, John Wallis & Amila Weerasinghe
7474
7575
Usage: hotspot3d <command> [options]
7676

dist.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name = HotSpot3D
2-
author = Beifang Niu, John Wallis, Adam D Scott, Sohini Sengupta , & Amila Weerasinghe from McDonnell Genome Institute of Washington University at St. Louis
2+
author = Beifang Niu, John Wallis, Adam D Scott, Sohini Sengupta, & Amila Weerasinghe from McDonnell Genome Institute of Washington University at St. Louis
33
version = 1.1.0
44
license = Perl_5
55
copyright_holder = McDonnell Genome Institute at Washington University
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env Rscript
2+
args = commandArgs(trailingOnly=TRUE)
3+
y = read.table(args[1])
4+
z = read.table(args[2])
5+
6+
RD<-y[[2]]
7+
ID<-y[[1]]
8+
9+
x0<-z[[1]]
10+
y0<-z[[3]]
11+
x1<-z[[2]]+1
12+
y1<-z[[3]]
13+
14+
pdf(args[3],width=23.6,height=13.3)
15+
par(mar=c(8,5,5,1))
16+
barplot(RD,names.arg=ID,ylab="Reachabilty Distance (A)",main=paste("Reachability Plot: Epsilon=",args[4],"MinPts=",args[5]),col="Red", border=NA, space=0, las=2, cex.names=0.4)
17+
segments (x0,y0,x1,y1)
18+
dev.off()
19+
20+
# args: 1-RD.out, 2-clusters.out, 3-pdf_file_name, 4-epsilon, 5-MinPts, 6-cutoff

lib/TGI/Mutpro/Main/Cluster.pm

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ sub new {
6060
$this->{'weight_header'} = $WEIGHT;
6161
$this->{'clustering'} = undef;
6262
$this->{'structure_dependence'} = undef;
63+
#$this->{'pairwise_file'} = '3D_Proximity.pairwise';
64+
$this->{'Epsilon'} = undef;
65+
$this->{'MinPts'} = undef;
66+
$this->{'number_of_runs'} = undef;
67+
$this->{'probability_cut_off'} = undef;
6368
bless $this, $class;
6469
$this->process();
6570
return $this;
@@ -120,8 +125,12 @@ sub setOptions {
120125
'clustering=s' => \$this->{'clustering'},
121126
'structure-dependence=s' => \$this->{'structure_dependence'},
122127
'help' => \$help,
128+
129+
'Epsilon=f' => \$this->{'Epsilon'},
130+
'MinPts=f' => \$this->{'MinPts'},
131+
'number-of-runs=f' => \$this->{'number_of_runs'},
132+
'probability-cut-off=f' => \$this->{'probability_cut_off'},
123133
);
124-
if ( $help ) { print STDERR help_text(); exit 0; }
125134
unless( $options ) { die $this->help_text(); }
126135
if ( not defined $this->{'clustering'} ) {
127136
$this->{'clustering'} = $NETWORK;
@@ -132,9 +141,13 @@ sub setOptions {
132141
warn "HotSpot3D::Cluster warning: no structure-dependence option given, setting to default independent\n";
133142
}
134143
if ( $this->{'clustering'} eq $DENSITY ) {
135-
TGI::Mutpro::Main::Density->new();
136-
exit;
144+
if ( $help ) { print STDERR density_help_text(); exit 0; }
145+
else{
146+
TGI::Mutpro::Main::Density->new($this);
147+
exit;
148+
}
137149
}
150+
if ( $help ) { print STDERR help_text(); exit 0; }
138151
if ( not defined $this->{'p_value_cutoff'} ) {
139152
if ( not defined $this->{'3d_distance_cutoff'} ) {
140153
warn "HotSpot3D::Cluster warning: no pair distance limit given, setting to default p-value cutoff = 0.05\n";
@@ -964,6 +977,26 @@ sub structureDependence {
964977
return $ANY;
965978
}
966979

980+
sub density_help_text{
981+
my $this = shift;
982+
return <<HELP
983+
984+
Usage: hotspot3d density [options]
985+
986+
REQUIRED
987+
--pairwise-file 3D pairwise data file
988+
989+
OPTIONAL
990+
--Epsilon Epsilon value, default: 10
991+
--MinPts MinPts, default: 4
992+
--number-of-runs Number of density clustering runs to perform before the cluster membership probability being calculated, default: 10
993+
--probability-cut-off Clusters will be formed with variants having at least this probability, default: 100
994+
995+
--help this message
996+
997+
HELP
998+
}
999+
9671000
sub help_text{
9681001
my $this = shift;
9691002
return <<HELP

0 commit comments

Comments
 (0)