This file is indexed.

/usr/share/votca/scripts/inverse/calc_density_generic.sh is in votca-csg-scripts 1.3.0-3.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#! /bin/bash
#
# Copyright 2009-2013 The VOTCA Development Team (http://www.votca.org)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

if [[ $1 = "--help" ]]; then
cat <<EOF
${0##*/}, version %version%
This script calcs the density using csg_density

Usage: ${0##*/} outputfile csg_density_options
EOF
   exit 0
fi

[[ -z $1 || -z $2 ]] && die "${0##*/}: Missing argument"
output="$1"
shift

sim_prog="$(csg_get_property cg.inverse.program)"

topol=$(csg_get_property cg.inverse.$sim_prog.topol)
[[ -f $topol ]] || die "${0##*/}: topol file '$topol' not found"

traj=$(csg_get_property cg.inverse.$sim_prog.traj)
[[ -f $traj ]] || die "${0##*/}: traj file '$traj' not found"

name=$(csg_get_interaction_property name)

equi_time="$(csg_get_property cg.inverse.$sim_prog.equi_time)"
first_frame="$(csg_get_property cg.inverse.$sim_prog.first_frame)"

with_errors=$(csg_get_property cg.inverse.$sim_prog.density.with_errors)
if [[ ${with_errors} = "yes" ]]; then
  suffix="_with_errors"
else
  suffix=""
fi

if is_done "${name}_density_analysis${suffix}"; then
  echo "density analysis is already done"
  exit 0
fi

if [[ ${with_errors} = "yes" ]]; then
  msg "Calculating density for $name with errors"
  block_length=$(csg_get_property cg.inverse.$sim_prog.density.block_length)
  critical csg_density --trj "$traj" --top "$topol" --out "${output}.block" --begin "$equi_time" --first-frame "$first_frame" --block-length $block_length "$@"
  for i in ${output}.block_*; do
    [[ -f $i ]] || die "${0##*/}: Could not find ${output}.block_* after running csg_density, that usually means the blocksize (cg.inverse.$sim_prog.density.block_length) is too big."
  done
  #mind the --clean option to avoid ${name}.dist.block_* to fail on the second run
  do_external table average --clean --output "${output}" ${output}.block_*
else
  msg "Calculating density for $name"
  critical csg_density --trj "$traj" --top "$topol" --out "$output" --begin "$equi_time" --first-frame "$first_frame" "$@"
fi
critical sed -i -e '/nan/d' -e '/inf/d' "$output"
mark_done "${name}_density_analysis${suffix}"