comparison dccm.R @ 0:386b4f4b6a85 draft

planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 125359d8080653f896089c28cce5308450336f93
author chemteam
date Wed, 27 Mar 2019 15:16:19 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:386b4f4b6a85
1 #!/usr/bin/env Rscript
2
3 options(stringAsfactors = FALSE)
4 args <- commandArgs(trailingOnly = TRUE)
5
6 library(bio3d)
7 require(lattice)
8
9 dcdfile <- args[1]
10 pdbfile <- args[2]
11
12 dcd <- read.dcd(dcdfile)
13 pdb <- read.pdb(pdbfile)
14
15 selection <- args[3]
16 domain <- args[4]
17
18 output <- args[5]
19 dccm_plot <- args[6]
20
21 dcd <- read.dcd(dcdfile)
22 pdb <- read.pdb(pdbfile)
23
24 if (selection == "string") {
25 inds <- atom.select(pdb, string = domain)
26 }
27 if (selection == "elety") {
28 inds <- atom.select(pdb, elety = domain)
29 }
30 if (selection == "resid") {
31 inds <- atom.select(pdb, resid = domain)
32 }
33 if (selection == "segid") {
34 inds <- atom.select(pdb, segid = domain)
35 }
36
37 xyz <- fit.xyz(fixed=pdb$xyz, mobile=dcd, fixed.inds=inds$xyz, mobile.inds=inds$xyz)
38 cij<-dccm(xyz[,inds$xyz])
39
40 write.table(cij, file = output, row.names = TRUE, col.names = FALSE, quote =FALSE, sep="\t")
41
42 png(dccm_plot)
43 plot(cij)
44 dev.off()
45
46