Mercurial > repos > iuc > vsnp_build_tables
comparison vsnp_build_tables.py @ 2:a52b819aa990 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:23 +0000 |
| parents | 5e258fba246c |
| children | efb86aade548 |
comparison
equal
deleted
inserted
replaced
| 1:0bc0009f9ea0 | 2:a52b819aa990 |
|---|---|
| 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] |
