Skip to content

Commit 4126b0c

Browse files
authored
Merge pull request #30 from BIONF/develop
- option for user-defined data path (genome_dir, blast_dir, weight_dir) - refspec and core taxa will be searched in blast_dir - adapt to new fas version - replace lib32ncurses5 by lib32ncurses6
2 parents 90e1ecd + 4a761b9 commit 4126b0c

File tree

6 files changed

+250
-137
lines changed

6 files changed

+250
-137
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ _**Note: After having all these dependencies installed, you still need to run th
215215
* build-essential
216216
* curl (curl)
217217
* locales
218-
* lib32ncurses5
218+
* lib32ncurses6
219219
* lib32z1
220220

221221
*(In parentheses are Mac's alternative tools)*
@@ -270,8 +270,8 @@ Ebersberger, I., Strauss, S. & von Haeseler, A. HaMStR: Profile hidden markov mo
270270

271271
# Contributors
272272
- [Ingo Ebersberger](https://github.com/ebersber)
273-
- [Holger Bergmann](https://github.com/holgerbgm)
274273
- [Vinh Tran](https://github.com/trvinh)
274+
- [Holger Bergmann](https://github.com/holgerbgm)
275275

276276
## Contact
277277
For further support or bug reports please contact: ebersberger@bio.uni-frankfurt.de

bin/hamstr.pl

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,12 @@
185185
## fixed the issue of long proteins with best total hmm bit score but very poor domain scores. Allow now the option to sort
186186
## hmmsearch output according to the best domain bit score. The current routine assumes that neither query nor
187187
## hit has whitespaces in their names
188+
189+
## 14.04.2020 (Vinh)
190+
## Bug fix (solved): existing symbolic link cannot recognized while checking the reference fasta file
191+
188192
######################## start main ###########################################
189-
my $version = "HaMStR v.13.2.10";
193+
my $version = "HaMStR v.13.2.11";
190194
######################## checking whether the configure script has been run ###
191195
my $configure = 0;
192196
if ($configure == 0){
@@ -195,8 +199,8 @@
195199
########## EDIT THE FOLLOWING LINES TO CUSTOMIZE YOUR SCRIPT ##################
196200
my $prog = 'hmmsearch'; #program for the hmm search
197201
my $eval = 1; # default evalue cutoff for the hmm search
198-
my $sedprog = 'sed';
199-
my $grepprog = 'grep';
202+
my $sedprog = 'gsed';
203+
my $grepprog = 'ggrep';
200204
my $alignmentprog = 'clustalw';
201205
my $alignmentprog_co = 'muscle';
202206
########## EDIT THE FOLLOWING TWO LINES TO CHOOSE YOUR BLAST PROGRAM ##########
@@ -1158,12 +1162,19 @@ sub checkInput {
11581162
push @log, "\nCHECKING FOR REFERENCE FASTA FILES\n";
11591163
for (my $i = 0; $i < @refspec; $i++) {
11601164
my $referencedb = "$blastpath/$refspec[$i]/$refspec[$i]".".fa";
1161-
my $referencedb_prot = "$blastpath/$refspec[$i]/$refspec[$i]"."_prot.fa"; # backward compatibility
1165+
my $referencedb_prot = "$blastpath/$refspec[$i]/$refspec[$i]"."_prot.fa"; # backward compatibility
11621166
my $ref_dir = "$blastpath/$refspec[$i]";
1163-
my $link = `readlink $referencedb`;
1164-
my $ref_location = $referencedb;
1167+
my $link = $referencedb;
1168+
unless (-e $referencedb) {
1169+
$link = `readlink $referencedb`;
1170+
unless ($link =~ /^\./ || $link =~ /^\//) {
1171+
my $cwd = cwd();
1172+
die "Linked source for $referencedb not found in $cwd!";
1173+
}
1174+
}
1175+
# my $ref_location = $referencedb; # not used anywhere else
11651176
chomp($link);
1166-
if (-e "$referencedb") {
1177+
if (-e $referencedb || -e $link) {
11671178
if (defined $link){
11681179
# link to file (.fa)
11691180
my $cwd = cwd();
@@ -1195,7 +1206,7 @@ sub checkInput {
11951206
}
11961207
}
11971208

1198-
}elsif (-e "$referencedb_prot"){
1209+
} elsif (-e "$referencedb_prot"){
11991210
#checking files
12001211
if (-e "$referencedb_prot.mod") {
12011212
push @log, "\tA infile is already modified: linked $referencedb.mod existst. Using this one";
@@ -1221,7 +1232,7 @@ sub checkInput {
12211232
}
12221233
}
12231234

1224-
}else{
1235+
} else {
12251236
#the provided reference fasta file does not exist or link to file does not exist:
12261237
push @log, "${bold}FATAL:${norm} FASTA file for the specified reference $refspec[$i] does not exist. PLEASE PROVIDE A VALID REFERENCE SPECIES!\n";
12271238
$check = 0;

0 commit comments

Comments
 (0)