annotate rmsf.R @ 5:6bcb804a54c3 draft default tip

"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 3b99f08f22b9e0c16c0a0adc82f8c16c1a25cedf"
author chemteam
date Mon, 07 Oct 2019 12:45:26 -0400
parents e838317708a6
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
1 #!/usr/bin/env Rscript
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
2
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
3 options(stringAsfactors = FALSE)
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
4 args <- commandArgs(trailingOnly = TRUE)
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
5
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
6 library(bio3d)
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
7
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
8 dcdfile <- args[1]
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
9 pdbfile <- args[2]
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
10 selection <- args[3]
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
11
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
12 dcd <- read.dcd(dcdfile)
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
13 pdb <- read.pdb(pdbfile)
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
14
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
15
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
16 if (selection == "string") {
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
17 domain <- args[4]
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
18 output <- args[5]
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
19 rmsf_plot <- args[6]
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
20 inds <- atom.select(pdb, string = domain)
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
21 }
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
22 if (selection == "resno") {
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
23 res1 <- args[4]
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
24 res2 <- args[5]
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
25 output <- args[6]
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
26 rmsf_plot <- args[7]
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
27 inds <- atom.select(pdb, resno=res1:res2)
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
28 }
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
29 if (selection == "elety") {
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
30 domain <- args[4]
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
31 output <- args[5]
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
32 rmsf_plot <- args[6]
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
33 inds <- atom.select(pdb, elety = domain)
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
34 }
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
35 if (selection == "resid") {
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
36 domain <- args[4]
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
37 output <- args[5]
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
38 rmsf_plot <- args[6]
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
39 inds <- atom.select(pdb, resid = domain)
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
40 }
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
41 if (selection == "segid") {
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
42 domain <- args[4]
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
43 output <- args[5]
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
44 rmsf_plot <- args[6]
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
45 inds <- atom.select(pdb, segid = domain)
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
46 }
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
47
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
48 xyz <- fit.xyz(fixed=pdb$xyz, mobile=dcd, fixed.inds=inds$xyz, mobile.inds=inds$xyz)
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
49
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
50 rf <- rmsf(xyz[,inds$xyz])
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
51
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
52 write.table(rf, file = output, row.names = TRUE, col.names = FALSE, quote =FALSE, sep="\t")
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
53
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
54 png(rmsf_plot)
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
55 plot(rf, ylab="RMSF", xlab="Residue Position", typ="l")
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
56 dev.off()
e838317708a6 planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tree/master/tools/bio3d commit 580d80c3fd856bb3ae18ef7b5458eb3b5e2c7374
chemteam
parents:
diff changeset
57