<commit_before>#! /usr/bin/env python

import sys
import optparse

import vdj

parser = optparse.OptionParser()
(options, args) = parser.parse_args()

if len(args) == 2:
    inhandle = open(args[0],'r')
    outhandle = open(args[1],'w')
elif len(args) == 1:
    inhandle = open(args[0],'r')
    outhandle = sys.stdout
elif len(args) == 0:
    inhandle = sys.stdin
    outhandle = sys.stdout
else:
    raise Exception, "Wrong number of arguments."

for chain in vdj.parse_imgt(inhandle):
    print >>outhandle, chain.format('fasta')
<commit_msg>Changed imgt2fasta to o/p only id; not description<commit_after>#! /usr/bin/env python

import sys
import optparse

import vdj

parser = optparse.OptionParser()
(options, args) = parser.parse_args()

if len(args) == 2:
    inhandle = open(args[0],'r')
    outhandle = open(args[1],'w')
elif len(args) == 1:
    inhandle = open(args[0],'r')
    outhandle = sys.stdout
elif len(args) == 0:
    inhandle = sys.stdin
    outhandle = sys.stdout
else:
    raise Exception, "Wrong number of arguments."

for chain in vdj.parse_imgt(inhandle):
    # print >>outhandle, chain.format('fasta')  # causes chain.description output instead of chain.id
    print >>outhandle, ">%s\n%s" % (chain.id,chain.seq)

{'fraction_non_alphanumeric': 0.14781906300484654, 'fraction_numerical': 0.01050080775444265, 'mean_word_length': 3.995967741935484, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, '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': '6227332', 'n_tokens_mistral': 460, 'n_tokens_neox': 449, 'n_words': 115}