Mercurial > repos > sblanck > mpagenomics_wrappers
annotate markersSelection.py @ 5:af4f63f27c77 draft
planemo upload for repository https://github.com/sblanck/MPAgenomics4Galaxy/tree/master/mpagenomics_wrappers commit 11d660a2de749dae548b2fae0dd81f9f2b2c4b4f
author | sblanck |
---|---|
date | Wed, 08 Apr 2020 15:34:17 +0000 |
parents | |
children |
rev | line source |
---|---|
5
af4f63f27c77
planemo upload for repository https://github.com/sblanck/MPAgenomics4Galaxy/tree/master/mpagenomics_wrappers commit 11d660a2de749dae548b2fae0dd81f9f2b2c4b4f
sblanck
parents:
diff
changeset
|
1 import os |
af4f63f27c77
planemo upload for repository https://github.com/sblanck/MPAgenomics4Galaxy/tree/master/mpagenomics_wrappers commit 11d660a2de749dae548b2fae0dd81f9f2b2c4b4f
sblanck
parents:
diff
changeset
|
2 import sys |
af4f63f27c77
planemo upload for repository https://github.com/sblanck/MPAgenomics4Galaxy/tree/master/mpagenomics_wrappers commit 11d660a2de749dae548b2fae0dd81f9f2b2c4b4f
sblanck
parents:
diff
changeset
|
3 import subprocess |
af4f63f27c77
planemo upload for repository https://github.com/sblanck/MPAgenomics4Galaxy/tree/master/mpagenomics_wrappers commit 11d660a2de749dae548b2fae0dd81f9f2b2c4b4f
sblanck
parents:
diff
changeset
|
4 |
af4f63f27c77
planemo upload for repository https://github.com/sblanck/MPAgenomics4Galaxy/tree/master/mpagenomics_wrappers commit 11d660a2de749dae548b2fae0dd81f9f2b2c4b4f
sblanck
parents:
diff
changeset
|
5 def main(): |
af4f63f27c77
planemo upload for repository https://github.com/sblanck/MPAgenomics4Galaxy/tree/master/mpagenomics_wrappers commit 11d660a2de749dae548b2fae0dd81f9f2b2c4b4f
sblanck
parents:
diff
changeset
|
6 |
af4f63f27c77
planemo upload for repository https://github.com/sblanck/MPAgenomics4Galaxy/tree/master/mpagenomics_wrappers commit 11d660a2de749dae548b2fae0dd81f9f2b2c4b4f
sblanck
parents:
diff
changeset
|
7 inputdata=sys.argv[1] |
af4f63f27c77
planemo upload for repository https://github.com/sblanck/MPAgenomics4Galaxy/tree/master/mpagenomics_wrappers commit 11d660a2de749dae548b2fae0dd81f9f2b2c4b4f
sblanck
parents:
diff
changeset
|
8 response=sys.argv[2] |
af4f63f27c77
planemo upload for repository https://github.com/sblanck/MPAgenomics4Galaxy/tree/master/mpagenomics_wrappers commit 11d660a2de749dae548b2fae0dd81f9f2b2c4b4f
sblanck
parents:
diff
changeset
|
9 tmp_dir=sys.argv[3] |
af4f63f27c77
planemo upload for repository https://github.com/sblanck/MPAgenomics4Galaxy/tree/master/mpagenomics_wrappers commit 11d660a2de749dae548b2fae0dd81f9f2b2c4b4f
sblanck
parents:
diff
changeset
|
10 nbfold=sys.argv[4] |
af4f63f27c77
planemo upload for repository https://github.com/sblanck/MPAgenomics4Galaxy/tree/master/mpagenomics_wrappers commit 11d660a2de749dae548b2fae0dd81f9f2b2c4b4f
sblanck
parents:
diff
changeset
|
11 loss=sys.argv[5] |
af4f63f27c77
planemo upload for repository https://github.com/sblanck/MPAgenomics4Galaxy/tree/master/mpagenomics_wrappers commit 11d660a2de749dae548b2fae0dd81f9f2b2c4b4f
sblanck
parents:
diff
changeset
|
12 outputlog=sys.argv[6] |
af4f63f27c77
planemo upload for repository https://github.com/sblanck/MPAgenomics4Galaxy/tree/master/mpagenomics_wrappers commit 11d660a2de749dae548b2fae0dd81f9f2b2c4b4f
sblanck
parents:
diff
changeset
|
13 output=sys.argv[7] |
af4f63f27c77
planemo upload for repository https://github.com/sblanck/MPAgenomics4Galaxy/tree/master/mpagenomics_wrappers commit 11d660a2de749dae548b2fae0dd81f9f2b2c4b4f
sblanck
parents:
diff
changeset
|
14 log=sys.argv[8] |
af4f63f27c77
planemo upload for repository https://github.com/sblanck/MPAgenomics4Galaxy/tree/master/mpagenomics_wrappers commit 11d660a2de749dae548b2fae0dd81f9f2b2c4b4f
sblanck
parents:
diff
changeset
|
15 |
af4f63f27c77
planemo upload for repository https://github.com/sblanck/MPAgenomics4Galaxy/tree/master/mpagenomics_wrappers commit 11d660a2de749dae548b2fae0dd81f9f2b2c4b4f
sblanck
parents:
diff
changeset
|
16 script_dir=os.path.dirname(os.path.abspath(__file__)) |
af4f63f27c77
planemo upload for repository https://github.com/sblanck/MPAgenomics4Galaxy/tree/master/mpagenomics_wrappers commit 11d660a2de749dae548b2fae0dd81f9f2b2c4b4f
sblanck
parents:
diff
changeset
|
17 |
af4f63f27c77
planemo upload for repository https://github.com/sblanck/MPAgenomics4Galaxy/tree/master/mpagenomics_wrappers commit 11d660a2de749dae548b2fae0dd81f9f2b2c4b4f
sblanck
parents:
diff
changeset
|
18 if (outputlog=="TRUE"): |
af4f63f27c77
planemo upload for repository https://github.com/sblanck/MPAgenomics4Galaxy/tree/master/mpagenomics_wrappers commit 11d660a2de749dae548b2fae0dd81f9f2b2c4b4f
sblanck
parents:
diff
changeset
|
19 errfile=open(log,'w') |
af4f63f27c77
planemo upload for repository https://github.com/sblanck/MPAgenomics4Galaxy/tree/master/mpagenomics_wrappers commit 11d660a2de749dae548b2fae0dd81f9f2b2c4b4f
sblanck
parents:
diff
changeset
|
20 else: |
af4f63f27c77
planemo upload for repository https://github.com/sblanck/MPAgenomics4Galaxy/tree/master/mpagenomics_wrappers commit 11d660a2de749dae548b2fae0dd81f9f2b2c4b4f
sblanck
parents:
diff
changeset
|
21 errfile=open(os.path.join(tmp_dir,"errfile.log"),'w') |
af4f63f27c77
planemo upload for repository https://github.com/sblanck/MPAgenomics4Galaxy/tree/master/mpagenomics_wrappers commit 11d660a2de749dae548b2fae0dd81f9f2b2c4b4f
sblanck
parents:
diff
changeset
|
22 |
af4f63f27c77
planemo upload for repository https://github.com/sblanck/MPAgenomics4Galaxy/tree/master/mpagenomics_wrappers commit 11d660a2de749dae548b2fae0dd81f9f2b2c4b4f
sblanck
parents:
diff
changeset
|
23 |
af4f63f27c77
planemo upload for repository https://github.com/sblanck/MPAgenomics4Galaxy/tree/master/mpagenomics_wrappers commit 11d660a2de749dae548b2fae0dd81f9f2b2c4b4f
sblanck
parents:
diff
changeset
|
24 retcode=subprocess.call(["Rscript", os.path.join(script_dir,"markersSelection.R"), inputdata, response, tmp_dir, nbfold, loss, output], stdout = errfile, stderr = errfile) |
af4f63f27c77
planemo upload for repository https://github.com/sblanck/MPAgenomics4Galaxy/tree/master/mpagenomics_wrappers commit 11d660a2de749dae548b2fae0dd81f9f2b2c4b4f
sblanck
parents:
diff
changeset
|
25 |
af4f63f27c77
planemo upload for repository https://github.com/sblanck/MPAgenomics4Galaxy/tree/master/mpagenomics_wrappers commit 11d660a2de749dae548b2fae0dd81f9f2b2c4b4f
sblanck
parents:
diff
changeset
|
26 # if (plot=="TRUE"): |
af4f63f27c77
planemo upload for repository https://github.com/sblanck/MPAgenomics4Galaxy/tree/master/mpagenomics_wrappers commit 11d660a2de749dae548b2fae0dd81f9f2b2c4b4f
sblanck
parents:
diff
changeset
|
27 # shutil.copy(os.path.join(tmp_dir,"mpagenomics","Rplots.pdf"), pdffigures) |
af4f63f27c77
planemo upload for repository https://github.com/sblanck/MPAgenomics4Galaxy/tree/master/mpagenomics_wrappers commit 11d660a2de749dae548b2fae0dd81f9f2b2c4b4f
sblanck
parents:
diff
changeset
|
28 |
af4f63f27c77
planemo upload for repository https://github.com/sblanck/MPAgenomics4Galaxy/tree/master/mpagenomics_wrappers commit 11d660a2de749dae548b2fae0dd81f9f2b2c4b4f
sblanck
parents:
diff
changeset
|
29 errfile.close() |
af4f63f27c77
planemo upload for repository https://github.com/sblanck/MPAgenomics4Galaxy/tree/master/mpagenomics_wrappers commit 11d660a2de749dae548b2fae0dd81f9f2b2c4b4f
sblanck
parents:
diff
changeset
|
30 |
af4f63f27c77
planemo upload for repository https://github.com/sblanck/MPAgenomics4Galaxy/tree/master/mpagenomics_wrappers commit 11d660a2de749dae548b2fae0dd81f9f2b2c4b4f
sblanck
parents:
diff
changeset
|
31 sys.exit(retcode) |
af4f63f27c77
planemo upload for repository https://github.com/sblanck/MPAgenomics4Galaxy/tree/master/mpagenomics_wrappers commit 11d660a2de749dae548b2fae0dd81f9f2b2c4b4f
sblanck
parents:
diff
changeset
|
32 |
af4f63f27c77
planemo upload for repository https://github.com/sblanck/MPAgenomics4Galaxy/tree/master/mpagenomics_wrappers commit 11d660a2de749dae548b2fae0dd81f9f2b2c4b4f
sblanck
parents:
diff
changeset
|
33 if __name__ == "__main__": |
af4f63f27c77
planemo upload for repository https://github.com/sblanck/MPAgenomics4Galaxy/tree/master/mpagenomics_wrappers commit 11d660a2de749dae548b2fae0dd81f9f2b2c4b4f
sblanck
parents:
diff
changeset
|
34 main() |