annotate dccm.R @ 1:0692d9f9edd3 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:17:42 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
0692d9f9edd3 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 125359d8080653f896089c28cce5308450336f93
chemteam
parents:
diff changeset
1 #!/usr/bin/env Rscript
0692d9f9edd3 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 125359d8080653f896089c28cce5308450336f93
chemteam
parents:
diff changeset
2
0692d9f9edd3 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 125359d8080653f896089c28cce5308450336f93
chemteam
parents:
diff changeset
3 options(stringAsfactors = FALSE)
0692d9f9edd3 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 125359d8080653f896089c28cce5308450336f93
chemteam
parents:
diff changeset
4 args <- commandArgs(trailingOnly = TRUE)
0692d9f9edd3 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 125359d8080653f896089c28cce5308450336f93
chemteam
parents:
diff changeset
5
0692d9f9edd3 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 125359d8080653f896089c28cce5308450336f93
chemteam
parents:
diff changeset
6 library(bio3d)
0692d9f9edd3 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 125359d8080653f896089c28cce5308450336f93
chemteam
parents:
diff changeset
7 require(lattice)
0692d9f9edd3 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 125359d8080653f896089c28cce5308450336f93
chemteam
parents:
diff changeset
8
0692d9f9edd3 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 125359d8080653f896089c28cce5308450336f93
chemteam
parents:
diff changeset
9 dcdfile <- args[1]
0692d9f9edd3 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 125359d8080653f896089c28cce5308450336f93
chemteam
parents:
diff changeset
10 pdbfile <- args[2]
0692d9f9edd3 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 125359d8080653f896089c28cce5308450336f93
chemteam
parents:
diff changeset
11
0692d9f9edd3 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 125359d8080653f896089c28cce5308450336f93
chemteam
parents:
diff changeset
12 dcd <- read.dcd(dcdfile)
0692d9f9edd3 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 125359d8080653f896089c28cce5308450336f93
chemteam
parents:
diff changeset
13 pdb <- read.pdb(pdbfile)
0692d9f9edd3 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 125359d8080653f896089c28cce5308450336f93
chemteam
parents:
diff changeset
14
0692d9f9edd3 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 125359d8080653f896089c28cce5308450336f93
chemteam
parents:
diff changeset
15 selection <- args[3]
0692d9f9edd3 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 125359d8080653f896089c28cce5308450336f93
chemteam
parents:
diff changeset
16 domain <- args[4]
0692d9f9edd3 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 125359d8080653f896089c28cce5308450336f93
chemteam
parents:
diff changeset
17
0692d9f9edd3 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 125359d8080653f896089c28cce5308450336f93
chemteam
parents:
diff changeset
18 output <- args[5]
0692d9f9edd3 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 125359d8080653f896089c28cce5308450336f93
chemteam
parents:
diff changeset
19 dccm_plot <- args[6]
0692d9f9edd3 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 125359d8080653f896089c28cce5308450336f93
chemteam
parents:
diff changeset
20
0692d9f9edd3 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 125359d8080653f896089c28cce5308450336f93
chemteam
parents:
diff changeset
21 dcd <- read.dcd(dcdfile)
0692d9f9edd3 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 125359d8080653f896089c28cce5308450336f93
chemteam
parents:
diff changeset
22 pdb <- read.pdb(pdbfile)
0692d9f9edd3 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 125359d8080653f896089c28cce5308450336f93
chemteam
parents:
diff changeset
23
0692d9f9edd3 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 125359d8080653f896089c28cce5308450336f93
chemteam
parents:
diff changeset
24 if (selection == "string") {
0692d9f9edd3 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 125359d8080653f896089c28cce5308450336f93
chemteam
parents:
diff changeset
25 inds <- atom.select(pdb, string = domain)
0692d9f9edd3 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 125359d8080653f896089c28cce5308450336f93
chemteam
parents:
diff changeset
26 }
0692d9f9edd3 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 125359d8080653f896089c28cce5308450336f93
chemteam
parents:
diff changeset
27 if (selection == "elety") {
0692d9f9edd3 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 125359d8080653f896089c28cce5308450336f93
chemteam
parents:
diff changeset
28 inds <- atom.select(pdb, elety = domain)
0692d9f9edd3 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 125359d8080653f896089c28cce5308450336f93
chemteam
parents:
diff changeset
29 }
0692d9f9edd3 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 125359d8080653f896089c28cce5308450336f93
chemteam
parents:
diff changeset
30 if (selection == "resid") {
0692d9f9edd3 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 125359d8080653f896089c28cce5308450336f93
chemteam
parents:
diff changeset
31 inds <- atom.select(pdb, resid = domain)
0692d9f9edd3 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 125359d8080653f896089c28cce5308450336f93
chemteam
parents:
diff changeset
32 }
0692d9f9edd3 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 125359d8080653f896089c28cce5308450336f93
chemteam
parents:
diff changeset
33 if (selection == "segid") {
0692d9f9edd3 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 125359d8080653f896089c28cce5308450336f93
chemteam
parents:
diff changeset
34 inds <- atom.select(pdb, segid = domain)
0692d9f9edd3 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 125359d8080653f896089c28cce5308450336f93
chemteam
parents:
diff changeset
35 }
0692d9f9edd3 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 125359d8080653f896089c28cce5308450336f93
chemteam
parents:
diff changeset
36
0692d9f9edd3 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 125359d8080653f896089c28cce5308450336f93
chemteam
parents:
diff changeset
37 xyz <- fit.xyz(fixed=pdb$xyz, mobile=dcd, fixed.inds=inds$xyz, mobile.inds=inds$xyz)
0692d9f9edd3 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 125359d8080653f896089c28cce5308450336f93
chemteam
parents:
diff changeset
38 cij<-dccm(xyz[,inds$xyz])
0692d9f9edd3 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 125359d8080653f896089c28cce5308450336f93
chemteam
parents:
diff changeset
39
0692d9f9edd3 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 125359d8080653f896089c28cce5308450336f93
chemteam
parents:
diff changeset
40 write.table(cij, file = output, row.names = TRUE, col.names = FALSE, quote =FALSE, sep="\t")
0692d9f9edd3 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 125359d8080653f896089c28cce5308450336f93
chemteam
parents:
diff changeset
41
0692d9f9edd3 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 125359d8080653f896089c28cce5308450336f93
chemteam
parents:
diff changeset
42 png(dccm_plot)
0692d9f9edd3 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 125359d8080653f896089c28cce5308450336f93
chemteam
parents:
diff changeset
43 plot(cij)
0692d9f9edd3 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 125359d8080653f896089c28cce5308450336f93
chemteam
parents:
diff changeset
44 dev.off()
0692d9f9edd3 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 125359d8080653f896089c28cce5308450336f93
chemteam
parents:
diff changeset
45
0692d9f9edd3 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 125359d8080653f896089c28cce5308450336f93
chemteam
parents:
diff changeset
46