Skip to content

Commit

Permalink
Merge pull request #30 from BIONF/develop
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
trvinh authored May 11, 2020
2 parents 90e1ecd + 4a761b9 commit 4126b0c
Show file tree
Hide file tree
Showing 6 changed files with 250 additions and 137 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ _**Note: After having all these dependencies installed, you still need to run th
* build-essential
* curl (curl)
* locales
* lib32ncurses5
* lib32ncurses6
* lib32z1

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

# Contributors
- [Ingo Ebersberger](https://github.com/ebersber)
- [Holger Bergmann](https://github.com/holgerbgm)
- [Vinh Tran](https://github.com/trvinh)
- [Holger Bergmann](https://github.com/holgerbgm)

## Contact
For further support or bug reports please contact: [email protected]
29 changes: 20 additions & 9 deletions bin/hamstr.pl
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,12 @@
## fixed the issue of long proteins with best total hmm bit score but very poor domain scores. Allow now the option to sort
## hmmsearch output according to the best domain bit score. The current routine assumes that neither query nor
## hit has whitespaces in their names

## 14.04.2020 (Vinh)
## Bug fix (solved): existing symbolic link cannot recognized while checking the reference fasta file

######################## start main ###########################################
my $version = "HaMStR v.13.2.10";
my $version = "HaMStR v.13.2.11";
######################## checking whether the configure script has been run ###
my $configure = 0;
if ($configure == 0){
Expand All @@ -195,8 +199,8 @@
########## EDIT THE FOLLOWING LINES TO CUSTOMIZE YOUR SCRIPT ##################
my $prog = 'hmmsearch'; #program for the hmm search
my $eval = 1; # default evalue cutoff for the hmm search
my $sedprog = 'sed';
my $grepprog = 'grep';
my $sedprog = 'gsed';
my $grepprog = 'ggrep';
my $alignmentprog = 'clustalw';
my $alignmentprog_co = 'muscle';
########## EDIT THE FOLLOWING TWO LINES TO CHOOSE YOUR BLAST PROGRAM ##########
Expand Down Expand Up @@ -1158,12 +1162,19 @@ sub checkInput {
push @log, "\nCHECKING FOR REFERENCE FASTA FILES\n";
for (my $i = 0; $i < @refspec; $i++) {
my $referencedb = "$blastpath/$refspec[$i]/$refspec[$i]".".fa";
my $referencedb_prot = "$blastpath/$refspec[$i]/$refspec[$i]"."_prot.fa"; # backward compatibility
my $referencedb_prot = "$blastpath/$refspec[$i]/$refspec[$i]"."_prot.fa"; # backward compatibility
my $ref_dir = "$blastpath/$refspec[$i]";
my $link = `readlink $referencedb`;
my $ref_location = $referencedb;
my $link = $referencedb;
unless (-e $referencedb) {
$link = `readlink $referencedb`;
unless ($link =~ /^\./ || $link =~ /^\//) {
my $cwd = cwd();
die "Linked source for $referencedb not found in $cwd!";
}
}
# my $ref_location = $referencedb; # not used anywhere else
chomp($link);
if (-e "$referencedb") {
if (-e $referencedb || -e $link) {
if (defined $link){
# link to file (.fa)
my $cwd = cwd();
Expand Down Expand Up @@ -1195,7 +1206,7 @@ sub checkInput {
}
}

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

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

0 comments on commit 4126b0c

Please sign in to comment.