Mercurial > repos > bgruening > alevin
annotate vpolo_convert.py @ 10:e4c01dcece8b draft
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/salmon commit 26e9f1627e91a4be6bdc7e71cd44f1ea1701ee6f"
author | bgruening |
---|---|
date | Thu, 22 Jul 2021 14:05:58 +0000 |
parents | ff78e9c7b0d8 |
children |
rev | line source |
---|---|
2
e53f19161c59
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/salmon commit c17bc974bf9bbaa1fc1e47ea72162fd244f0e612"
bgruening
parents:
diff
changeset
|
1 #!/usr/bin/env python |
7
ff78e9c7b0d8
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/salmon commit dee6a6f4aa8cbee9f81692fc6f3a2e4ad1f3abf6"
bgruening
parents:
2
diff
changeset
|
2 import argparse |
ff78e9c7b0d8
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/salmon commit dee6a6f4aa8cbee9f81692fc6f3a2e4ad1f3abf6"
bgruening
parents:
2
diff
changeset
|
3 import os |
2
e53f19161c59
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/salmon commit c17bc974bf9bbaa1fc1e47ea72162fd244f0e612"
bgruening
parents:
diff
changeset
|
4 |
e53f19161c59
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/salmon commit c17bc974bf9bbaa1fc1e47ea72162fd244f0e612"
bgruening
parents:
diff
changeset
|
5 from vpolo.alevin import parser as par |
7
ff78e9c7b0d8
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/salmon commit dee6a6f4aa8cbee9f81692fc6f3a2e4ad1f3abf6"
bgruening
parents:
2
diff
changeset
|
6 |
2
e53f19161c59
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/salmon commit c17bc974bf9bbaa1fc1e47ea72162fd244f0e612"
bgruening
parents:
diff
changeset
|
7 parser = argparse.ArgumentParser() |
e53f19161c59
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/salmon commit c17bc974bf9bbaa1fc1e47ea72162fd244f0e612"
bgruening
parents:
diff
changeset
|
8 parser.add_argument("--mtx", "-m", action="store_true", help="--dumpMtx flag set") |
e53f19161c59
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/salmon commit c17bc974bf9bbaa1fc1e47ea72162fd244f0e612"
bgruening
parents:
diff
changeset
|
9 parser.add_argument("--umi", "-u", action="store_true", help="--dumpUmiGraph flag set") |
e53f19161c59
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/salmon commit c17bc974bf9bbaa1fc1e47ea72162fd244f0e612"
bgruening
parents:
diff
changeset
|
10 args = parser.parse_args() |
e53f19161c59
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/salmon commit c17bc974bf9bbaa1fc1e47ea72162fd244f0e612"
bgruening
parents:
diff
changeset
|
11 |
e53f19161c59
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/salmon commit c17bc974bf9bbaa1fc1e47ea72162fd244f0e612"
bgruening
parents:
diff
changeset
|
12 if args.mtx: |
e53f19161c59
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/salmon commit c17bc974bf9bbaa1fc1e47ea72162fd244f0e612"
bgruening
parents:
diff
changeset
|
13 alevin_df = par.read_quants_bin("output") |
e53f19161c59
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/salmon commit c17bc974bf9bbaa1fc1e47ea72162fd244f0e612"
bgruening
parents:
diff
changeset
|
14 with open("quants_mat.tsv", "w") as f: |
e53f19161c59
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/salmon commit c17bc974bf9bbaa1fc1e47ea72162fd244f0e612"
bgruening
parents:
diff
changeset
|
15 f.write(alevin_df.to_csv(sep="\t")) |
e53f19161c59
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/salmon commit c17bc974bf9bbaa1fc1e47ea72162fd244f0e612"
bgruening
parents:
diff
changeset
|
16 |
e53f19161c59
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/salmon commit c17bc974bf9bbaa1fc1e47ea72162fd244f0e612"
bgruening
parents:
diff
changeset
|
17 if args.umi: |
e53f19161c59
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/salmon commit c17bc974bf9bbaa1fc1e47ea72162fd244f0e612"
bgruening
parents:
diff
changeset
|
18 os.mkdir("umiout") |
e53f19161c59
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/salmon commit c17bc974bf9bbaa1fc1e47ea72162fd244f0e612"
bgruening
parents:
diff
changeset
|
19 par.read_umi_graph("output", "umiout") |