Mercurial > repos > cstrittmatter > skesa
annotate run_skesa_collection.py @ 19:abb622c228c4 draft
planemo upload commit 1e3adef29c2d50fa89df02d0153e069c4328557e
author | cstrittmatter |
---|---|
date | Mon, 27 Aug 2018 08:59:02 -0400 |
parents | |
children |
rev | line source |
---|---|
19
abb622c228c4
planemo upload commit 1e3adef29c2d50fa89df02d0153e069c4328557e
cstrittmatter
parents:
diff
changeset
|
1 import sys |
abb622c228c4
planemo upload commit 1e3adef29c2d50fa89df02d0153e069c4328557e
cstrittmatter
parents:
diff
changeset
|
2 |
abb622c228c4
planemo upload commit 1e3adef29c2d50fa89df02d0153e069c4328557e
cstrittmatter
parents:
diff
changeset
|
3 from pathlib import Path |
abb622c228c4
planemo upload commit 1e3adef29c2d50fa89df02d0153e069c4328557e
cstrittmatter
parents:
diff
changeset
|
4 |
abb622c228c4
planemo upload commit 1e3adef29c2d50fa89df02d0153e069c4328557e
cstrittmatter
parents:
diff
changeset
|
5 path1 = sys.argv[1] |
abb622c228c4
planemo upload commit 1e3adef29c2d50fa89df02d0153e069c4328557e
cstrittmatter
parents:
diff
changeset
|
6 |
abb622c228c4
planemo upload commit 1e3adef29c2d50fa89df02d0153e069c4328557e
cstrittmatter
parents:
diff
changeset
|
7 cores = sys.argv[2] |
abb622c228c4
planemo upload commit 1e3adef29c2d50fa89df02d0153e069c4328557e
cstrittmatter
parents:
diff
changeset
|
8 |
abb622c228c4
planemo upload commit 1e3adef29c2d50fa89df02d0153e069c4328557e
cstrittmatter
parents:
diff
changeset
|
9 memory = sys.argv[2] |
abb622c228c4
planemo upload commit 1e3adef29c2d50fa89df02d0153e069c4328557e
cstrittmatter
parents:
diff
changeset
|
10 |
abb622c228c4
planemo upload commit 1e3adef29c2d50fa89df02d0153e069c4328557e
cstrittmatter
parents:
diff
changeset
|
11 print(path1) |
abb622c228c4
planemo upload commit 1e3adef29c2d50fa89df02d0153e069c4328557e
cstrittmatter
parents:
diff
changeset
|
12 |
abb622c228c4
planemo upload commit 1e3adef29c2d50fa89df02d0153e069c4328557e
cstrittmatter
parents:
diff
changeset
|
13 #print(path2) |
abb622c228c4
planemo upload commit 1e3adef29c2d50fa89df02d0153e069c4328557e
cstrittmatter
parents:
diff
changeset
|
14 |
abb622c228c4
planemo upload commit 1e3adef29c2d50fa89df02d0153e069c4328557e
cstrittmatter
parents:
diff
changeset
|
15 pathlist = Path(path1).glob('*fastq*') |
abb622c228c4
planemo upload commit 1e3adef29c2d50fa89df02d0153e069c4328557e
cstrittmatter
parents:
diff
changeset
|
16 |
abb622c228c4
planemo upload commit 1e3adef29c2d50fa89df02d0153e069c4328557e
cstrittmatter
parents:
diff
changeset
|
17 i = 0 |
abb622c228c4
planemo upload commit 1e3adef29c2d50fa89df02d0153e069c4328557e
cstrittmatter
parents:
diff
changeset
|
18 skcmd = [] |
abb622c228c4
planemo upload commit 1e3adef29c2d50fa89df02d0153e069c4328557e
cstrittmatter
parents:
diff
changeset
|
19 |
abb622c228c4
planemo upload commit 1e3adef29c2d50fa89df02d0153e069c4328557e
cstrittmatter
parents:
diff
changeset
|
20 skcmd.append("skesa ") |
abb622c228c4
planemo upload commit 1e3adef29c2d50fa89df02d0153e069c4328557e
cstrittmatter
parents:
diff
changeset
|
21 |
abb622c228c4
planemo upload commit 1e3adef29c2d50fa89df02d0153e069c4328557e
cstrittmatter
parents:
diff
changeset
|
22 for path in pathlist: |
abb622c228c4
planemo upload commit 1e3adef29c2d50fa89df02d0153e069c4328557e
cstrittmatter
parents:
diff
changeset
|
23 # because path is object not string-wq |
abb622c228c4
planemo upload commit 1e3adef29c2d50fa89df02d0153e069c4328557e
cstrittmatter
parents:
diff
changeset
|
24 i += 1 |
abb622c228c4
planemo upload commit 1e3adef29c2d50fa89df02d0153e069c4328557e
cstrittmatter
parents:
diff
changeset
|
25 path_in_str = str(path) |
abb622c228c4
planemo upload commit 1e3adef29c2d50fa89df02d0153e069c4328557e
cstrittmatter
parents:
diff
changeset
|
26 if i == 2: |
abb622c228c4
planemo upload commit 1e3adef29c2d50fa89df02d0153e069c4328557e
cstrittmatter
parents:
diff
changeset
|
27 skcmd.append("," + path_in_str) |
abb622c228c4
planemo upload commit 1e3adef29c2d50fa89df02d0153e069c4328557e
cstrittmatter
parents:
diff
changeset
|
28 #print("," + path_in_str) |
abb622c228c4
planemo upload commit 1e3adef29c2d50fa89df02d0153e069c4328557e
cstrittmatter
parents:
diff
changeset
|
29 i = 0 |
abb622c228c4
planemo upload commit 1e3adef29c2d50fa89df02d0153e069c4328557e
cstrittmatter
parents:
diff
changeset
|
30 if i == 1: |
abb622c228c4
planemo upload commit 1e3adef29c2d50fa89df02d0153e069c4328557e
cstrittmatter
parents:
diff
changeset
|
31 skcmd.append(" --fastq " + path_in_str) |
abb622c228c4
planemo upload commit 1e3adef29c2d50fa89df02d0153e069c4328557e
cstrittmatter
parents:
diff
changeset
|
32 #print(" --fastq " + path_in_str) |
abb622c228c4
planemo upload commit 1e3adef29c2d50fa89df02d0153e069c4328557e
cstrittmatter
parents:
diff
changeset
|
33 |
abb622c228c4
planemo upload commit 1e3adef29c2d50fa89df02d0153e069c4328557e
cstrittmatter
parents:
diff
changeset
|
34 |
abb622c228c4
planemo upload commit 1e3adef29c2d50fa89df02d0153e069c4328557e
cstrittmatter
parents:
diff
changeset
|
35 |
abb622c228c4
planemo upload commit 1e3adef29c2d50fa89df02d0153e069c4328557e
cstrittmatter
parents:
diff
changeset
|
36 if cores != 0: |
abb622c228c4
planemo upload commit 1e3adef29c2d50fa89df02d0153e069c4328557e
cstrittmatter
parents:
diff
changeset
|
37 skcmd.append(" --cores " + cores) |
abb622c228c4
planemo upload commit 1e3adef29c2d50fa89df02d0153e069c4328557e
cstrittmatter
parents:
diff
changeset
|
38 |
abb622c228c4
planemo upload commit 1e3adef29c2d50fa89df02d0153e069c4328557e
cstrittmatter
parents:
diff
changeset
|
39 |
abb622c228c4
planemo upload commit 1e3adef29c2d50fa89df02d0153e069c4328557e
cstrittmatter
parents:
diff
changeset
|
40 skcmd.append(" --memory " + memory) |
abb622c228c4
planemo upload commit 1e3adef29c2d50fa89df02d0153e069c4328557e
cstrittmatter
parents:
diff
changeset
|
41 |
abb622c228c4
planemo upload commit 1e3adef29c2d50fa89df02d0153e069c4328557e
cstrittmatter
parents:
diff
changeset
|
42 skcmds = ''.join(skcmd) |
abb622c228c4
planemo upload commit 1e3adef29c2d50fa89df02d0153e069c4328557e
cstrittmatter
parents:
diff
changeset
|
43 print(skcmds) |