wurmlab / sequenceserver

Intuitive graphical web interface for running BLAST bioinformatics tool (i.e. have your own custom NCBI BLAST site!)
https://sequenceserver.com
GNU Affero General Public License v3.0
271 stars 113 forks source link

Support filename with spaces #550

Open yeban opened 3 years ago

yeban commented 3 years ago

Doesn't work despite c466156ca469d0f4d20ac21c46155f9d7b89e0ba

FASTA file to format: /passenger/yannick/sequenceserver/databases/query sadf copy.fa
FASTA type: nucleotide
Proceed? [y/n] (Default: y): y
Enter a database title or will use 'query sadf copy':
Enter taxid (optional):
Could not create BLAST database for: /passenger/yannick/sequenceserver/databases/query sadf copy.fa
Tried: makeblastdb -parse_seqids -hash_index -in '/passenger/yannick/sequenceserver/databases/query sadf copy.fa' -dbtype nucl -title 'query sadf copy' -taxid 0
stdout:
stderr: BLAST options error: Please provide a database name using -out
yannickwurm commented 2 years ago

this is very low priority because noone working on a unix machine should ever have spaces in filenames.

nathanweeks commented 2 years ago

This would be a nice-to-have to make it more convenient to allow the tree directory/categories in https://github.com/wurmlab/sequenceserver/issues/520 to have spaces (and other special characters that would be otherwise interpreted by a shell).

I suspect addressing https://github.com/wurmlab/sequenceserver/issues/569 would fix both the security concerns raised in that issue, as well as this issue.

yannickwurm commented 2 years ago

make it more convenient to allow the tree directory/categories in #520 to have spaces (and other special characters that would be otherwise interpreted by a shell).

Fair point.

I suspect addressing #569 would fix both the security concerns raised in that issue, as well as this issue.

I think you're right

jwillis0720 commented 2 years ago

this is very low priority because noone working on a unix machine should ever have spaces in filenames.

yea, but we don't develop for a lot of folks who obey posix conventions. Dropbox for instance will add a space to it's default file path.

yannickwurm commented 2 years ago

We'd be more than happy to review a pull request which tries to fix this.

jwillis0720 commented 2 years ago

I think this an IgBlast fix. They would need to make their database paths to posix compliant file paths (which they have in their data types for some CLI arguments) rather than strings.

yannickwurm commented 2 years ago

This looks to me like something internal to BLAST. If I replace spaces with \, BLAST still gets stuck.

Thus (I think) the best way to solve this is to:

When the space is early in the pathname (i.e., closer to the root than pwd), then formatting may want to occur elsewhere... e.g. :

In the meantime, we should probably report an error, saying that we cannot handle this situation well.

yannickwurm commented 1 year ago

(the fix may simply to be explicit about providing -out argument