<commit_before>import sys, argparse

parser = argparse.ArgumentParser()

parser.add_argument('--db2Name', help='tab-separated database lookup: full name file for reference (eg nr or swissprot)')
parser.add_argument('-b','--blast', help='blast input file')

args = parser.parse_args()

blastOrder = []
blastD = {}
with open(args.blast, 'r') as f:
    for line in f:
        line = line.rstrip().split('\t')
        blastOrder.append(line[1])
        blastD[line[1]] = line


#potentially huge file --> don't want this in memory
with open(args.db2Name, 'r') as f:
    for line in f:
        line = line.rstrip().split('\t')
    hitInfo = blastD.get(line[0], None)
    if hitInfo is not None:
        hitInfo.extend(line[1:])
    f.close()

for hit in blastOrder:
    print('\t'.join(map(str,blastD[hit])) + '\n')



<commit_msg>addStitle update<commit_after>import sys, argparse

parser = argparse.ArgumentParser()

parser.add_argument('--db2Name', help='tab-separated database lookup: full name file for reference (eg nr or swissprot)')
parser.add_argument('-b','--blast', help='blast input file')

args = parser.parse_args()

blastOrder = []
blastD = {}
with open(args.blast, 'r') as f:
    for line in f:
        line = line.rstrip().split('\t')
	blastOrder.append(line[1])
	blastD[line[1]] = line
    f.close()

#potentially huge file --> don't want this in memory
with open(args.db2Name, 'r') as f:
    for line in f:
        line = line.rstrip().split('\t')
	hitInfo = blastD.get(line[0], None)
	if hitInfo is not None:
	    hitInfo.extend(line[1:])
    f.close()

#outExtendedTab = open(args.blast, 'w')
for hit in blastOrder:
    #outExtendedTab.write('\t'.join(map(str,blastD[hit])) + '\n')
    sys.stdout.write('\t'.join(map(str,blastD[hit])) + '\n')




{'fraction_non_alphanumeric': 0.170261066969353, 'fraction_numerical': 0.00681044267877412, 'mean_word_length': 3.664021164021164, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2338140', 'n_tokens_mistral': 639, 'n_tokens_neox': 616, 'n_words': 157}