Skip to content

Commit

Permalink
(OK) v0.4.4: add temp folder name selection (-t)
Browse files Browse the repository at this point in the history
  • Loading branch information
wym6912 committed Oct 19, 2022
1 parent a4b881f commit b9f6f39
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ unzip mt1x.zip
/usr/bin/wmsa -i mt1x.fasta -o mt1x.wmsa.fasta -T 16 -c 0.9
```

The arugments in last line means the input file ( `-i` ) is `mt1x.fasta `, the output file ( `-o` ) is `mt1x.wmsa.fasta `, use `16 `threads (` -T` ) and the similarity of cd-hit (` -c` ) in `wmsa `is `0.9`.
The arugments in last line means the input file ( `-i` ) is `mt1x.fasta`, the output file ( `-o` ) is `mt1x.wmsa.fasta`, use `16` threads ( `-T` ) and the similarity of cd-hit ( `-c` ) in `wmsa `is `0.9`.

For dataset from www.drive5.com/bench, see [here](https://github.com/malabz/WMSA-dataset/blob/main/benchmark/README.md) for testing in `wmsa` .

Expand Down
3 changes: 2 additions & 1 deletion constants.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ char centerfile[maxf];
char cmdstr[maxf], cmdstr2[maxf], cmdstr3[maxf];

// tmp directory
char tmpdir[maxf] = "./swap/";
char tmpdir[maxf] = "./swap/", *readtmpdir;
int tmpinthisdir;

char orderprotein[20] = {'A', 'R', 'N', 'D', 'C', 'Q', 'E', 'G', 'H', 'I', 'L', 'K', 'M', 'F', 'P', 'S', 'T', 'W', 'Y', 'V'};
int BLOSUM62[20][20] = {
Expand Down
3 changes: 2 additions & 1 deletion msa.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ extern char centerfile[];
extern char cmdstr[], cmdstr2[], cmdstr3[];

// tmp directory
extern char tmpdir[];
extern char tmpdir[], *readtmpdir;
extern int tmpinthisdir;

extern char orderprotein[], orderDNA[];
extern int BLOSUM62[20][20], trans[4][4];
13 changes: 12 additions & 1 deletion msa_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#if REPORTCOSTS
#include <time.h>
#endif
#define VERSION "0.4.3"
#define VERSION "0.4.4"
#define SHOWVERSION reporterr( "%s (%s, %d-bit) Version " VERSION "\n\n", "MSA align", (seq_type == 1) ? "nuc" : ((seq_type == 0) ? "unknown" : "aa"), sizeof(int *) * 8 )
// #define FILESAVE
#define MIN(X, Y) ((X) > (Y) ? (Y) : (X))
Expand All @@ -31,6 +31,7 @@ void print_help_message()
reporterr("-d: print debug info on profilealign, staralign and cd-hit*\n");
reporterr("-s: do not simply check the result is ok\n");
reporterr("-v: only print version\n");
reporterr("-t: temp folder name\n");
reporterr("== MAFFT common arguments ==\n");
reporterr("-V, -f, -S: ppenalty_dist, penalty, nmax_shift\n");
reporterr("-z, -w: fftthreshold, fftWinsize\n");
Expand Down Expand Up @@ -78,6 +79,7 @@ void arguments(int argc, char *argv[])
BLOSUM = 62;
simplycheck = 1;
profilealignthread = NOTKNOWNINT;
tmpinthisdir = 0;
while(--argc > 0 && (*++ argv)[0] == '-' )
{
while ( (c = *++ argv[0]) )
Expand All @@ -93,6 +95,10 @@ void arguments(int argc, char *argv[])
outputfile = *++ argv;
-- argc;
goto nextoption;
case 't':
readtmpdir = *++ argv;
-- argc;
goto nextoption;
// Sequence type
case 'P':
seq_type = 2;
Expand Down Expand Up @@ -231,6 +237,11 @@ int main(int argc, char **argv)
programfolder = get_exe_path(programfolder, PATH_MAX + 100);
if(printdebug) puts(programfolder);
// now the value programfolder is the right value, and the last place of the folder name is not '/'.
if(readtmpdir != NULL)
{
if(tmpinthisdir) sprintf(tmpdir, "./%s/", readtmpdir);
else sprintf(tmpdir, "%s/", readtmpdir);
}
if(maketmpfolder())
{
reporterr("Warning: cannot make folder %s\n", tmpdir);
Expand Down

0 comments on commit b9f6f39

Please sign in to comment.