-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed and renamed ""coords2dihedrals_inner.py"->"coords2projected_dih…
…edrals.py"
- Loading branch information
Showing
8 changed files
with
176 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/sh | ||
|
||
BRANCH_OF_LOG="180.0" | ||
if [ "$#" -eq 2 ]; then | ||
BRANCH_OF_LOG="$1" | ||
shift 1 | ||
fi | ||
ATOM_SELECTION="$@" | ||
|
||
if [ -z "${EXTRACTCOORDS}" ] | ||
then | ||
EXTRACTCOORDS="pdb2coords.py ${ATOM_SELECTION} -blank" | ||
fi | ||
|
||
|
||
while read pdb_file_name; do | ||
#echo "pdb_file = \"${pdb_file_name}\"" | ||
echo "${0##*/} processing $pdb_file_name" >&2 | ||
pdb2helix.py < "$pdb_file_name" > helix_intervals_projected_dihedrals.tmp | ||
while read interval; do | ||
command="select_interval.py $interval < \"$pdb_file_name\" | ${EXTRACTCOORDS} | coords2projected_dihedrals.py $BRANCH_OF_LOG | tr \"\n\" \" \"" | ||
#echo "${command}" | ||
eval "$command" | ||
echo "" | ||
done < helix_intervals_projected_dihedrals.tmp | ||
done | ||
|
||
rm -f helix_intervals_projected_dihedrals.tmp | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/sh | ||
|
||
BRANCH_OF_LOG="360.0" | ||
if [ "$#" -eq 2 ]; then | ||
BRANCH_OF_LOG="$1" | ||
shift 1 | ||
fi | ||
ATOM_SELECTION="$@" | ||
|
||
if [ -z "${EXTRACTCOORDS}" ] | ||
then | ||
EXTRACTCOORDS="pdb2coords.py ${ATOM_SELECTION} -blank" | ||
fi | ||
|
||
|
||
while read pdb_file_name; do | ||
#echo "pdb_file = \"${pdb_file_name}\"" | ||
echo "${0##*/} processing $pdb_file_name" >&2 | ||
pdb2sheet.py < "$pdb_file_name" > sheet_intervals_projected_dihedrals.tmp | ||
while read interval; do | ||
command="select_interval.py $interval < \"$pdb_file_name\" | ${EXTRACTCOORDS} | coords2projected_dihedrals.py $BRANCH_OF_LOG | tr \"\n\" \" \"" | ||
#echo "${command}" | ||
eval "$command" | ||
echo "" | ||
done < sheet_intervals_projected_dihedrals.tmp | ||
done | ||
|
||
rm -f sheet_intervals_projected_dihedrals.tmp | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/sh | ||
|
||
BRANCH_OF_LOG="" | ||
if [ "$#" -eq 2 ]; then | ||
BRANCH_OF_LOG="$1" | ||
shift 1 | ||
fi | ||
ATOM_SELECTION="$@" | ||
|
||
if [ -z "${EXTRACTCOORDS}" ] | ||
then | ||
EXTRACTCOORDS="pdb2coords.py ${ATOM_SELECTION} -blank" | ||
fi | ||
|
||
|
||
while read pdb_file_name; do | ||
#echo "pdb_file = \"${pdb_file_name}\"" | ||
echo "${0##*/} processing $pdb_file_name" >&2 | ||
pdb2turn.py < "$pdb_file_name" > turn_intervals_projected_dihedrals.tmp | ||
while read interval; do | ||
command="select_interval.py $interval < \"$pdb_file_name\" | ${EXTRACTCOORDS} | coords2projected_dihedrals.py $BRANCH_OF_LOG | tr \"\n\" \" \"" | ||
#echo "${command}" | ||
eval "$command" | ||
echo "" | ||
done < turn_intervals_projected_dihedrals.tmp | ||
done | ||
|
||
rm -f turn_intervals_projected_dihedrals.tmp | ||
|
54 changes: 54 additions & 0 deletions
54
doc/extract_geometry/README_coords2projected_dihedrals.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
Typical Usage: | ||
|
||
coords2dihedrals.py 180 < 12column_text_file.dat | ||
|
||
This script reads a 12-column numeric text file representing the positions | ||
of 4 atoms. Then it calculates the "projected dihedral", which I define | ||
as the difference in direction between two infinitely long lines: | ||
-The first line passes through the first two atoms, | ||
-The other line (the "last line") passes through the last two atoms. | ||
The "projected dihedral" angle can be thought of as the largest possible | ||
apparent angle between these two lines when viewed from all possible | ||
viewing directions. A pair of points (one on each line) is determined | ||
that are closest to each other. The "projected dihedral" angle is the angle | ||
one sees when viewing these two lines from direction of the axis connecting | ||
these two closest points. Note: If these two lines are parallel to each other | ||
or if these 4 points are coplanar, the "projected" dihedral angle is undefined. | ||
|
||
Example input file: | ||
|
||
30.13 11.46 15.12 35.28 -2.32 12.61 30.68 -4.45 16.30 28.68 8.46 10.24 | ||
28.68 8.42 10.24 30.68 -4.45 16.30 25.22 -4.75 19.42 27.57 3.37 8.06 | ||
27.57 3.37 8.06 25.22 -4.75 19.42 20.45 -1.27 20.09 25.80 -2.26 6.61 | ||
25.80 -2.23 6.61 20.45 -1.27 20.09 15.47 1.36 18.12 21.67 -5.88 7.17 | ||
: | ||
The 12 numbers on each line represent the x,y,z coordinates of 4 atoms. | ||
(This is the format of the files generated by the "pdb2coords.py" script.) | ||
For each line containing 12 numbers, this script returns a tuple | ||
containing 4 numbers: | ||
-The "projected dihedral" angle for these 4 atoms (in degrees) | ||
-The distance from the first atom to the first closest point | ||
(IE The point on the first line that is closest to the last line) | ||
-The distance between the pair of points on each line that are closest | ||
to each other, | ||
-The distance from the last atom to the last closest point | ||
(IE The point on the last line that is closest to the first line) | ||
(When a line contains the wrong number of numbers, | ||
the script prints out a list of 4 impossibe negative values: | ||
"-720 -1 -1 -1" to let the caller know that | ||
this particular angle could not be computed.) | ||
|
||
Note: | ||
The "IUPAC/IUB" dihedral-angle convention is used: | ||
4 atoms in the "trans" conformation have a dihedral angle of 180 degrees. | ||
By default, dihedral angles are calculated in the range from 0 to 360.0 degrees. | ||
(This means there is discontinuity in the angle at 0 degrees.) | ||
However this may be a bad choice for polymers which can alternate between | ||
helical conformations which are left and right handed. | ||
In some cases, you may want to have the discontinuity appear at 180 degrees. | ||
(or some other angle which is sparsely populated). | ||
|
||
So you can supply an optional argument (the "branch_of_log") which indicates | ||
where the discontinuity in the dihedral angle will appear. | ||
Dihedral angles returned by this program will lie in the range: | ||
[branch_of_log-360, branch_of_log) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters