def __npz_to_plink(self, p, file_name): '''Convert p from npz to plink format using the file set specified by file_name.''' npz = file_name+'.npz' # Save test problem in plink format io.write_npz(p, npz) # Convert plink -> npz io.npz_to_plink(npz, file_name) # Load npz and check that the problem object didn't change p2 = io.read_plink(prefix=file_name) return p2
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)
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)