annotate visualize_pc.R @ 2:90e9ff37bc9e draft

planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit cd0830e5e3502721fa355cc8e3fedc331201a6e4
author chemteam
date Tue, 26 Feb 2019 08:28:26 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
90e9ff37bc9e planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit cd0830e5e3502721fa355cc8e3fedc331201a6e4
chemteam
parents:
diff changeset
1 #!/usr/bin/env Rscript
90e9ff37bc9e planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit cd0830e5e3502721fa355cc8e3fedc331201a6e4
chemteam
parents:
diff changeset
2
90e9ff37bc9e planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit cd0830e5e3502721fa355cc8e3fedc331201a6e4
chemteam
parents:
diff changeset
3 options(stringAsfactors = FALSE)
90e9ff37bc9e planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit cd0830e5e3502721fa355cc8e3fedc331201a6e4
chemteam
parents:
diff changeset
4 args <- commandArgs(trailingOnly = TRUE)
90e9ff37bc9e planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit cd0830e5e3502721fa355cc8e3fedc331201a6e4
chemteam
parents:
diff changeset
5
90e9ff37bc9e planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit cd0830e5e3502721fa355cc8e3fedc331201a6e4
chemteam
parents:
diff changeset
6 library(bio3d)
90e9ff37bc9e planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit cd0830e5e3502721fa355cc8e3fedc331201a6e4
chemteam
parents:
diff changeset
7
90e9ff37bc9e planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit cd0830e5e3502721fa355cc8e3fedc331201a6e4
chemteam
parents:
diff changeset
8 dcdfile <- args[1]
90e9ff37bc9e planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit cd0830e5e3502721fa355cc8e3fedc331201a6e4
chemteam
parents:
diff changeset
9 pdbfile <- args[2]
90e9ff37bc9e planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit cd0830e5e3502721fa355cc8e3fedc331201a6e4
chemteam
parents:
diff changeset
10
90e9ff37bc9e planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit cd0830e5e3502721fa355cc8e3fedc331201a6e4
chemteam
parents:
diff changeset
11 dcd <- read.dcd(dcdfile)
90e9ff37bc9e planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit cd0830e5e3502721fa355cc8e3fedc331201a6e4
chemteam
parents:
diff changeset
12 pdb <- read.pdb(pdbfile)
90e9ff37bc9e planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit cd0830e5e3502721fa355cc8e3fedc331201a6e4
chemteam
parents:
diff changeset
13
90e9ff37bc9e planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit cd0830e5e3502721fa355cc8e3fedc331201a6e4
chemteam
parents:
diff changeset
14 method <- args[3]
90e9ff37bc9e planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit cd0830e5e3502721fa355cc8e3fedc331201a6e4
chemteam
parents:
diff changeset
15 selection <- args[4]
90e9ff37bc9e planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit cd0830e5e3502721fa355cc8e3fedc331201a6e4
chemteam
parents:
diff changeset
16 domain <- args[5]
90e9ff37bc9e planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit cd0830e5e3502721fa355cc8e3fedc331201a6e4
chemteam
parents:
diff changeset
17 id <- args[6]
90e9ff37bc9e planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit cd0830e5e3502721fa355cc8e3fedc331201a6e4
chemteam
parents:
diff changeset
18 pcid <- as.integer(id)
90e9ff37bc9e planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit cd0830e5e3502721fa355cc8e3fedc331201a6e4
chemteam
parents:
diff changeset
19
90e9ff37bc9e planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit cd0830e5e3502721fa355cc8e3fedc331201a6e4
chemteam
parents:
diff changeset
20 pdbout <- args[7]
90e9ff37bc9e planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit cd0830e5e3502721fa355cc8e3fedc331201a6e4
chemteam
parents:
diff changeset
21
90e9ff37bc9e planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit cd0830e5e3502721fa355cc8e3fedc331201a6e4
chemteam
parents:
diff changeset
22
90e9ff37bc9e planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit cd0830e5e3502721fa355cc8e3fedc331201a6e4
chemteam
parents:
diff changeset
23 if (selection == "string") {
90e9ff37bc9e planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit cd0830e5e3502721fa355cc8e3fedc331201a6e4
chemteam
parents:
diff changeset
24 inds <- atom.select(pdb, string = domain)
90e9ff37bc9e planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit cd0830e5e3502721fa355cc8e3fedc331201a6e4
chemteam
parents:
diff changeset
25 }
90e9ff37bc9e planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit cd0830e5e3502721fa355cc8e3fedc331201a6e4
chemteam
parents:
diff changeset
26 if (selection == "elety") {
90e9ff37bc9e planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit cd0830e5e3502721fa355cc8e3fedc331201a6e4
chemteam
parents:
diff changeset
27 inds <- atom.select(pdb, elety = domain)
90e9ff37bc9e planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit cd0830e5e3502721fa355cc8e3fedc331201a6e4
chemteam
parents:
diff changeset
28 }
90e9ff37bc9e planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit cd0830e5e3502721fa355cc8e3fedc331201a6e4
chemteam
parents:
diff changeset
29 if (selection == "resid") {
90e9ff37bc9e planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit cd0830e5e3502721fa355cc8e3fedc331201a6e4
chemteam
parents:
diff changeset
30 inds <- atom.select(pdb, resid = domain)
90e9ff37bc9e planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit cd0830e5e3502721fa355cc8e3fedc331201a6e4
chemteam
parents:
diff changeset
31 }
90e9ff37bc9e planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit cd0830e5e3502721fa355cc8e3fedc331201a6e4
chemteam
parents:
diff changeset
32 if (selection == "segid") {
90e9ff37bc9e planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit cd0830e5e3502721fa355cc8e3fedc331201a6e4
chemteam
parents:
diff changeset
33 inds <- atom.select(pdb, segid = domain)
90e9ff37bc9e planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit cd0830e5e3502721fa355cc8e3fedc331201a6e4
chemteam
parents:
diff changeset
34 }
90e9ff37bc9e planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit cd0830e5e3502721fa355cc8e3fedc331201a6e4
chemteam
parents:
diff changeset
35 xyz <- fit.xyz(fixed=pdb$xyz, mobile=dcd, fixed.inds=inds$xyz, mobile.inds=inds$xyz)
90e9ff37bc9e planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit cd0830e5e3502721fa355cc8e3fedc331201a6e4
chemteam
parents:
diff changeset
36
90e9ff37bc9e planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit cd0830e5e3502721fa355cc8e3fedc331201a6e4
chemteam
parents:
diff changeset
37 if (method == "FALSE") {
90e9ff37bc9e planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit cd0830e5e3502721fa355cc8e3fedc331201a6e4
chemteam
parents:
diff changeset
38 pc <- pca.xyz(xyz[,inds$xyz], use.svd=FALSE)
90e9ff37bc9e planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit cd0830e5e3502721fa355cc8e3fedc331201a6e4
chemteam
parents:
diff changeset
39 }
90e9ff37bc9e planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit cd0830e5e3502721fa355cc8e3fedc331201a6e4
chemteam
parents:
diff changeset
40 if (method == "TRUE") {
90e9ff37bc9e planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit cd0830e5e3502721fa355cc8e3fedc331201a6e4
chemteam
parents:
diff changeset
41 pc <- pca.xyz(xyz[,inds$xyz], use.svd=TRUE)
90e9ff37bc9e planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit cd0830e5e3502721fa355cc8e3fedc331201a6e4
chemteam
parents:
diff changeset
42 }
90e9ff37bc9e planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit cd0830e5e3502721fa355cc8e3fedc331201a6e4
chemteam
parents:
diff changeset
43
90e9ff37bc9e planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit cd0830e5e3502721fa355cc8e3fedc331201a6e4
chemteam
parents:
diff changeset
44 mktrj.pca(pc, pc=pcid, b=pc$au[,pcid], file=pdbout)
90e9ff37bc9e planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit cd0830e5e3502721fa355cc8e3fedc331201a6e4
chemteam
parents:
diff changeset
45