sequenceserver icon indicating copy to clipboard operation
sequenceserver copied to clipboard

Support filename with spaces

Open yeban opened this issue 4 years ago • 8 comments

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

yeban avatar Oct 06 '21 12:10 yeban

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

yannickwurm avatar Nov 25 '21 21:11 yannickwurm

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.

nathanweeks avatar Jan 15 '22 13:01 nathanweeks

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

yannickwurm avatar Jan 17 '22 10:01 yannickwurm

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.

jwillis0720 avatar Mar 10 '22 04:03 jwillis0720

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

yannickwurm avatar Mar 10 '22 10:03 yannickwurm

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.

jwillis0720 avatar Mar 10 '22 16:03 jwillis0720

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:

  • find fasta file
  • replace spaces with underscores
  • then do blast formatting.

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. :

  • move the fasta file to /tmp/ first.
  • format there
  • move the formatted db back to where we want it

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

yannickwurm avatar Jul 30 '22 14:07 yannickwurm

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

yannickwurm avatar May 25 '23 09:05 yannickwurm