<commit_before>#!/usr/lib/python
#-*- utf-8 -*-

import vcf
from optparse import OptionParser

msg_usage = 'usage: %prog [-I] vcf [-O] map file name'
descr ='''transfer vcf file into map file used in GenotypeCorrector.'''
optparser = OptionParser(usage = msg_usage, description = descr)
optparser.add_option('-I', '--input', dest = 'vcffile',
                      help = 'input your vcf file')
optparser.add_option('-O', '--output', dest = 'mapfile',
                      help = 'output name of map file')
options, args = optparser.parse_args()


parse_gt={'0|0':'A','0|1':'X','1|0':'X','1|1':'B','.|.':'-'}

def fb2map(fbfile, mapfile):
    vcffile = open(fbfile)
    myvcf = vcf.Reader(vcffile)
    samples = myvcf.samples # samples list in this vcf file<commit_msg>briefly describe the script<commit_after>#!/usr/lib/python
#-*- utf-8 -*-

import vcf
from optparse import OptionParser

msg_usage = 'usage: %prog [-I] vcf [-O] map file name'
descr ='''convert vcf file to map format file used in GenotypeCorrector. To use this script, the vcf package need to be installed. The genotypes 0/0, 0/1, 1/1 will be converted to A, X, B in map file. Misisng genotypes are presented as - in map file.'''
optparser = OptionParser(usage = msg_usage, description = descr)
optparser.add_option('-I', '--input', dest = 'vcffile',
                      help = 'input your vcf file')
optparser.add_option('-O', '--output', dest = 'mapfile',
                      help = 'output name of map file')
options, args = optparser.parse_args()


parse_gt={'0|0':'A','0|1':'X','1|0':'X','1|1':'B','.|.':'-'}

def fb2map(fbfile, mapfile):
    vcffile = open(fbfile)
    myvcf = vcf.Reader(vcffile)
    samples = myvcf.samples # samples list in this vcf file
{'fraction_non_alphanumeric': 0.16589861751152074, 'fraction_numerical': 0.014976958525345621, 'mean_word_length': 3.488372093023256, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6757570', 'n_tokens_mistral': 619, 'n_tokens_neox': 591, 'n_words': 177}