comparison vsnp_build_tables.py @ 1:aed013f6b13b draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/vsnp commit 94e69abb568077267eb8b15ef624624e2899a750"
author iuc
date Wed, 30 Sep 2020 19:07:47 +0000
parents 0ad85e7db2fc
children 2e863710a2f0
comparison
equal deleted inserted replaced
0:0ad85e7db2fc 1:aed013f6b13b
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 2
3 import argparse 3 import argparse
4 import multiprocessing 4 import multiprocessing
5 import os 5 import os
6 import queue
7 import re
8
6 import pandas 9 import pandas
7 import queue
8 import pandas.io.formats.excel 10 import pandas.io.formats.excel
9 import re
10 from Bio import SeqIO 11 from Bio import SeqIO
11 12
12 INPUT_JSON_AVG_MQ_DIR = 'input_json_avg_mq_dir' 13 INPUT_JSON_AVG_MQ_DIR = 'input_json_avg_mq_dir'
13 INPUT_JSON_DIR = 'input_json_dir' 14 INPUT_JSON_DIR = 'input_json_dir'
14 INPUT_NEWICK_DIR = 'input_newick_dir' 15 INPUT_NEWICK_DIR = 'input_newick_dir'
30 all_ref = ref_df[ref_df['reference'] == gbk_chrome] 31 all_ref = ref_df[ref_df['reference'] == gbk_chrome]
31 positions = all_ref.position.to_frame() 32 positions = all_ref.position.to_frame()
32 # Create an annotation file. 33 # Create an annotation file.
33 annotation_file = "%s_annotations.csv" % group 34 annotation_file = "%s_annotations.csv" % group
34 with open(annotation_file, "a") as fh: 35 with open(annotation_file, "a") as fh:
35 for index, row in positions.iterrows(): 36 for _, row in positions.iterrows():
36 pos = row.position 37 pos = row.position
37 try: 38 try:
38 aaa = pro.iloc[pro.index.get_loc(int(pos))][['chrom', 'locus', 'product', 'gene']] 39 aaa = pro.iloc[pro.index.get_loc(int(pos))][['chrom', 'locus', 'product', 'gene']]
39 try: 40 try:
40 chrom, name, locus, tag = aaa.values[0] 41 chrom, name, locus, tag = aaa.values[0]