wrpearson / fasta36

Git repository for FASTA36 sequence comparison software
Apache License 2.0
117 stars 17 forks source link

Bug in dealing with dir name? #46

Closed yzhang-github-pub closed 2 years ago

yzhang-github-pub commented 2 years ago

Dr. Pearson,

I got the same error as in the issue 14. For sequence fasta file at /path/to/mySeq.fasta, fasta36 produced *** ERROR [comp_lib9.c:642] cannot open library /path/to/mySeq.fastax. The offending dir name is "1341I124_1348I1_1349I1" (where "I" is the upper case of "i"). I changed the path name and it then worked.

Fasta package version is 36.3.8h.

wrpearson commented 2 years ago

If your fasta file is at "/path/to/mySeq.fasta", then I am puzzled why the error message said "cannot open library /path/to/mySeq.fastax", since your sequence is in .fasta, not .fastax. I suspect that something was miss-typed.

yzhang-github-pub commented 2 years ago

Thank you very much for quick response.

All the paths and fasta files are programmatically generated:

my_path=/path/to/fasta [[ -d $my_path ]] || mkdir -p $my_path

then write fasta to $my_path/mySeq.fasta

if [[ -s $my_path/mySeq.fasta ]]; then

run fasta program

fi

I also manually checked the file path.

I am not sure if the dir path depth (the path is like /root/sub/sub-sub/.../mySeq.fasta) or overall path length causes the problem. After moving mySeq.fasta one level up, fasta program ran successfully.

wrpearson commented 2 years ago

The problem you are seeing is occurring because the MAX_FN (max filename) defined in defs.h is:

define MAX_FN 120

The simplest solution is to increase that length. I suggest:

define MAX_FN MAX_STR -- which will change it to 512.

A better solution would be to allow the filename to be an arbitrary length, but that would require quite a few other changes.

yzhang-github-pub commented 2 years ago

Thanks for your advice!

wrpearson commented 2 years ago

The latest version of the fasta package (v36.3.8i) increases the maximum query file name length to 512, and provides an error message if it is exceeded.