annotate vpolo_convert.py @ 14:b265be7af3db draft

"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/salmon commit 4c71464b5f5047e0745067c115c37a5d06867649"
author bgruening
date Mon, 13 Jul 2020 17:13:55 -0400
parents 7fdb9d1591e2
children cc05793bb896
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12
7fdb9d1591e2 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/salmon commit c17bc974bf9bbaa1fc1e47ea72162fd244f0e612"
bgruening
parents:
diff changeset
1 #!/usr/bin/env python
7fdb9d1591e2 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/salmon commit c17bc974bf9bbaa1fc1e47ea72162fd244f0e612"
bgruening
parents:
diff changeset
2
7fdb9d1591e2 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/salmon commit c17bc974bf9bbaa1fc1e47ea72162fd244f0e612"
bgruening
parents:
diff changeset
3 from vpolo.alevin import parser as par
7fdb9d1591e2 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/salmon commit c17bc974bf9bbaa1fc1e47ea72162fd244f0e612"
bgruening
parents:
diff changeset
4 import argparse
7fdb9d1591e2 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/salmon commit c17bc974bf9bbaa1fc1e47ea72162fd244f0e612"
bgruening
parents:
diff changeset
5 import os
7fdb9d1591e2 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/salmon commit c17bc974bf9bbaa1fc1e47ea72162fd244f0e612"
bgruening
parents:
diff changeset
6
7fdb9d1591e2 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/salmon commit c17bc974bf9bbaa1fc1e47ea72162fd244f0e612"
bgruening
parents:
diff changeset
7 parser = argparse.ArgumentParser()
7fdb9d1591e2 "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")
7fdb9d1591e2 "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")
7fdb9d1591e2 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/salmon commit c17bc974bf9bbaa1fc1e47ea72162fd244f0e612"
bgruening
parents:
diff changeset
10 args = parser.parse_args()
7fdb9d1591e2 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/salmon commit c17bc974bf9bbaa1fc1e47ea72162fd244f0e612"
bgruening
parents:
diff changeset
11
7fdb9d1591e2 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/salmon commit c17bc974bf9bbaa1fc1e47ea72162fd244f0e612"
bgruening
parents:
diff changeset
12 if args.mtx:
7fdb9d1591e2 "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")
7fdb9d1591e2 "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:
7fdb9d1591e2 "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"))
7fdb9d1591e2 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/salmon commit c17bc974bf9bbaa1fc1e47ea72162fd244f0e612"
bgruening
parents:
diff changeset
16
7fdb9d1591e2 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/salmon commit c17bc974bf9bbaa1fc1e47ea72162fd244f0e612"
bgruening
parents:
diff changeset
17 if args.umi:
7fdb9d1591e2 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/salmon commit c17bc974bf9bbaa1fc1e47ea72162fd244f0e612"
bgruening
parents:
diff changeset
18 os.mkdir("umiout")
7fdb9d1591e2 "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")