File tree 3 files changed +5
-56
lines changed
3 files changed +5
-56
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ function Trajectory(
33
33
format:: String = " " ,
34
34
chemfiles = false ,
35
35
)
36
- if ! chemfiles && (format == " dcd" || FileOperations . file_extension (filename) == " dcd" )
36
+ if ! chemfiles && (format == " dcd" || split (filename, ' . ' )[ end ] == " dcd" )
37
37
trajectory = NamdDCD (filename, solute, solvent)
38
38
elseif ! chemfiles && format == " PDBTraj"
39
39
trajectory = PDBTraj (filename, solute, solvent)
Original file line number Diff line number Diff line change 1
-
2
- module FileOperations
3
-
4
- #
5
- # Function that removes the extension of a file name
6
- #
7
- remove_extension (file:: String ) = file[1 : findlast (== (' .' ), file)- 1 ]
8
-
9
- #
10
- # Function that determines the basename of a file, removing the path and the extension
11
- #
12
- clearname (filename:: String ) = remove_extension (basename (filename))
13
-
14
- #
15
- # Function that return only the extension of the file
16
- #
17
- file_extension (file:: String ) = file[findlast (== (' .' ), file)+ 1 : end ]
18
-
19
- #
20
- # Function that determines if a character is empty
21
- #
22
- empty_char (c:: Char ) = in (c, (Char (9 ), Char (32 )))
23
-
24
- #
25
- # Function that checks if a line is a comment line or if it is empty
26
- #
27
- function commentary (s:: String )
28
- i = findfirst (c -> ! (empty_char (c)), s)
29
- return isnothing (i) || s[i] == ' #'
30
- end
31
-
32
- end # module
33
-
34
-
35
- """
36
-
37
- $(INTERNAL)
38
-
39
- $(TYPEDEF)
40
-
41
- Structure to contain the names of the output files.
42
-
43
- $(TYPEDFIELDS)
44
-
45
- """
46
- @kwdef mutable struct OutputFiles
47
- output:: String
48
- solute_atoms:: String
49
- solvent_atoms:: String
50
- end
51
-
52
1
"""
53
2
54
3
$(INTERNAL)
Original file line number Diff line number Diff line change @@ -31,14 +31,14 @@ function write(
31
31
32
32
# Names of output files containing atomic contibutions
33
33
atom_contributions_solvent = normpath (
34
- FileOperations . remove_extension ( filename) *
34
+ filename[ 1 : findlast ( == ( ' . ' ), filename)- 1 ] *
35
35
" -ATOM_CONTRIBUTIONS_SOLVENT." *
36
- FileOperations . file_extension (filename)
36
+ split (filename, ' . ' )[ end ]
37
37
)
38
38
atom_contributions_solute = normpath (
39
- FileOperations . remove_extension ( filename) *
39
+ filename[ 1 : findlast ( == ( ' . ' ), filename)- 1 ] *
40
40
" -ATOM_CONTRIBUTIONS_SOLUTE." *
41
- FileOperations . file_extension (filename)
41
+ split (filename, ' . ' )[ end ]
42
42
)
43
43
44
44
#
You can’t perform that action at this time.
0 commit comments