Skip to content

Commit

Permalink
Rename the format and modify the output file name
Browse files Browse the repository at this point in the history
  • Loading branch information
Jian-Long Huang committed Jan 29, 2013
1 parent 0deb5bb commit 6ed47a1
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 16 deletions.
9 changes: 6 additions & 3 deletions bdorpy/blast2accmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# http://opensource.org/licenses/MIT
#
# Author: Jian-Long Huang (jianlong@ntu.edu.tw)
# Version: 0.1
# Version: 0.2
# Created: 2013.1.25
#
# Required:
Expand All @@ -23,7 +23,7 @@
#
# File Formats:
# * blast.xml: blast XML
# * output: blast-accmap
# * output: blastaccmap

import sys
import argparse
Expand All @@ -40,11 +40,14 @@ def main():
help='evalue thresh (default: 0.01)')
parser.add_argument('-t', '--min_hit_num', dest='min_hit_num', type=int, default=1,
help='minimum number of hit sequences (default: 1)')
parser.add_argument('-o', '--output', dest='output_file', default='blast2accmap_output_' + name.genid() + '.tsv',
parser.add_argument('-o', '--output', dest='output_file',
help='output file name. If this option is not specified, the script will generate '
'one with unique identifier at current directory.')
args = parser.parse_args()

if args.output_file is None:
args.output_file = args.input_file + '_out_' + name.genid() + 'blastaccmap'

total_query_num = 0
parsed_query_num = 0

Expand Down
9 changes: 6 additions & 3 deletions bdorpy/blastparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# http://opensource.org/licenses/MIT
#
# Author: Jian-Long Huang (jianlong@ntu.edu.tw)
# Version: 2.0
# Version: 2.1
# Created: 2013.1.22
#
# Required :
Expand All @@ -34,7 +34,7 @@
#
# File formats:
# * blast.xml: NCBI blast XML
# * output: blast-list
# * output: blastlist
#
# Tested:
# * BLASTN 2.2.27+
Expand All @@ -57,7 +57,7 @@ def main():
help='evalue thresh (default: 0.01)')
parser.add_argument('-r', '--rank', dest='aln_rank', type=int, default=250,
help='alignment rank (default: 250)')
parser.add_argument('-o', '--output', dest='output_file', default='bp_output_' + name.genid() + '.tsv',
parser.add_argument('-o', '--output', dest='output_file',
help='output file name. If this option is not specified, the script will generate '
'one with unique identifier at current directory.')
parser.add_argument('-b', '--best', dest='best_hit', action='store_true', default=False,
Expand All @@ -76,6 +76,9 @@ def main():
if args.best_hit is True:
args.aln_rank = 1

if args.output_file is None:
args.output_file = args.input_file + '_out_' + name.genid() + '.blastlist'

with open(args.intput_file, 'r') as result_handle, open(args.output_file, 'w') as fw:
for i in proglog.start_message():
fw.write(i)
Expand Down
6 changes: 3 additions & 3 deletions bdorpy/cquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
# http://opensource.org/licenses/MIT
#
# Author: Jian-Long Huang (jianlong@ntu.edu.tw)
# Version: 1.0
# Version: 1.1
# Created: 2013.1.23
#
# Usage: cquery <input.tsv>
# Usage: cquery <input.blastlist>
#
# Options:
# -e, --evalue NUM: evalue thresh (default: 0.01)
#
# File formats:
# * input.tsv: blast-list
# * input.blastlist: blastlist
#
# Support multiple input files and Unix style pathname pattern.
#
Expand Down
7 changes: 5 additions & 2 deletions bdorpy/fa2lens.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# http://opensource.org/licenses/MIT
#
# Author: Jian-Long Huang (jianlong@ntu.edu.tw)
# Version: 0.1
# Version: 0.2
# Created: 2013.1.26
#
# Required:
Expand All @@ -33,11 +33,14 @@ def main():
parser.add_argument('input_file')
parser.add_argument('-s', '--sep', dest='sep', default='\n',
help='seperator (default: newline)')
parser.add_argument('-o', '--output', dest='output_file', default='fa2lens_output_' + name.genid() + '.txt',
parser.add_argument('-o', '--output', dest='output_file',
help='output file name. If this option is not specified, the script will generate '
'one with unique identifier at current directory.')
args = parser.parse_args()

if args.output_file is None:
args.output_file = args.input_file + '_out_' + name.genid() + '.leng.txt'

with open(args.input_file, 'r') as fin, open(args.output_file, 'w') as fw:
records = map(str, map(len, list(SeqIO.parse(fin, 'fasta'))))
fw.write(args.sep.join(records))
Expand Down
6 changes: 3 additions & 3 deletions bdorpy/fetchfa.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
# http://opensource.org/licenses/MIT
#
# Author: Jian-Long Huang (jianlong@ntu.edu.tw)
# Version: 0.2
# Version: 0.3
# Created: 2013.1.24
#
# Required:
# * Biopython: http://biopython.org
#
# Usage: batchgfa <input.tsv> [options]
# Usage: batchgfa <input.blastaccmap> [options]
# -d, --db STR: database (default: protein)
# -q, --query STR: accessions to be fetched. If this option is specifid, the script will use the values
# to fetch data, and no input file is required to be handled.
Expand All @@ -23,7 +23,7 @@
# -l, --log STR: log file name
#
# File formats:
# * input.tsv: blast-accmap
# * input.blastaccmap: blastaccmap
# * output: fasta

import os
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# blast-accmap - a tab-separated lists
# blastaccmap - a tab-separated lists
#
# Updated: 2013.1.25

Expand Down
2 changes: 1 addition & 1 deletion docs/format/blast-list.txt → docs/format/blastlist.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# blast-list - a tab-separated lists
# blastlist - a tab-separated lists
#
# Updated: 2013.1.24

Expand Down

0 comments on commit 6ed47a1

Please sign in to comment.