File: concatenate-DNA-base-pairs.sh

package info (click to toggle)
macromoleculebuilder 4.0.0%2Bdfsg-3.1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 122,532 kB
  • sloc: cpp: 23,631; python: 5,047; ansic: 2,101; awk: 145; perl: 144; makefile: 40; sh: 21
file content (23 lines) | stat: -rwxr-xr-x 772 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash

# This script is for use with the sphericalHelix command. Takes the last.*.pdb files and concatenates them, first one chain, then the other, in order of residue number.

rm DA.pdb;
grep -h DA last.?.pdb > DA.pdb
grep -h DA last.??.pdb >> DA.pdb
grep -h DA last.???.pdb >> DA.pdb
grep -h DA last.????.pdb >> DA.pdb
rm DT.pdb
grep -h DT last.?.pdb > DT.pdb
grep -h DT last.??.pdb >> DT.pdb
grep -h DT last.???.pdb >> DT.pdb
grep -h DT last.????.pdb >> DT.pdb

cat DA.pdb > DNA-spiral.pdb
tac DT.pdb >> DNA-spiral.pdb

sed -i 's/H5T/P  /g' DNA-spiral.pdb 
awk '{if ($3 == "P"){print $5"P"$2,$0} else {print $5"Z"$2,$0}}' DNA-spiral.pdb > temp.2.pdb
sort -k1 temp.2.pdb > temp.3.pdb
cut -b 13-90 temp.3.pdb > DNA-spiral.pdb
rm temp.2.pdb temp.3.pdb DA.pdb DT.pdb