Exemplo n.º 1
0
 def __plink_to_npz(self, p, file_name):
     '''Convert p from plink to npz format using the file set specified by file_name.'''
     npz = file_name+'.npz'
     # Save test problem in plink format
     io.write_plink(p, prefix=file_name)
     # Convert plink -> npz
     io.plink_to_npz(file_name, npz)
     # Load npz and check that the problem object didn't change
     p2 = io.read_npz(npz)
     return p2
Exemplo n.º 2
0
def __main(options):
    '''
    --------------------------------------------------
    Main program - accepts an options struct.
    --------------------------------------------------
    '''
    if options.target == 'npz':
        haplotype = options.prefix + '.hap.tped'
        haplotype = haplotype if os.path.isfile(haplotype) else None 
        return io.plink_to_npz(options.prefix, options.npz, options.pedigree, haplotype=haplotype,
                               info=None,verbose=options.debug,
                               pedigree_genotyped=options.pedigree_genotyped)
    else:
        return io.npz_to_plink(options.npz, options.prefix, verbose=options.debug)
Exemplo n.º 3
0
def __main(options):
    '''
    --------------------------------------------------
    Main program - accepts an options struct.
    --------------------------------------------------
    '''
    if options.target == 'npz':
        haplotype = options.prefix + '.hap.tped'
        haplotype = haplotype if os.path.isfile(haplotype) else None
        return io.plink_to_npz(options.prefix,
                               options.npz,
                               options.pedigree,
                               haplotype=haplotype,
                               info=None,
                               verbose=options.debug,
                               pedigree_genotyped=options.pedigree_genotyped)
    else:
        return io.npz_to_plink(options.npz,
                               options.prefix,
                               verbose=options.debug)