Path Name Convention
In some function, such as fit.xyz and pdbfit, the value for the option "outpath" mush be ended with "/". Is it really necessary?
Comments (5)
-
-
reporter I have done it with the function file.path(). The idea is
- the path name can be ended either with or without "/"
- empty string ("") is equal to "/" and "." represents current working directory
- there are two exceptions:
- exepath="" means default searching path of executable files
- pdb.path="" does not locate the file to root "/". For example, in read.fasta.pdb(aln, pdb.path=""), the file path is extracted directly from aln$id instead of "/aln$id".
Point 3 breaks the consistence of path name convention. Suggestion is to rename the options. For example, pdb.path is called prefix.pdb.path. Exepath can be called exefile, and the default value is just the executable file name (e.g. "dssp").
It may be overkilled but I was constantly confused with the path name ended with or without "/" (they are different in previous version of bio3d). Any comment?
-
Great, file.path() should take care of this nicely.
For your listed exceptions in
#3I like the suggested exefile replacment of exepath. However, for pdb.path replacement by prefix.pdb.path I am not so sure. Generally I am not that fond of making variable names (especially user exposed ones that I have to type) longer without significantly enhancing understandability. Does "prefix" help here? -
reporter "prefix" should be fine. I will change them this way. Thanks!
-
reporter - changed status to resolved
- Log in to comment
We should probably fix this if there is an easy way that copes with cwd "./" maybe paste0(pth,"/") or similar?