elif args.mode == 'meta-stage': #ARG_CHECKER.check(args,mode='meta-stage') ##### Init data readers ##### if args.derivatives is None: raise ValueError( 'For meta-stage analysis partial derivatives data are required!' ) mapper = Mapper() mapper.chunk_size = MAPPER_CHUNK_SIZE mapper.genotype_names = args.study_name mapper.reference_name = args.ref_name # Reference dataset if args.snp_id_inc is not None: # If this is not none the argument contains a table of snps to include mapper.include = pd.DataFrame.from_csv(args.snp_id_inc, index_col=None) print 'Include:' print mapper.include.head() if 'ID' not in mapper.include.columns and ( 'CHR' not in mapper.include.columns or 'bp' not in mapper.include.columns): raise ValueError( '{} table does not have ID or CHR,bp columns'.format( args.snp_id_inc)) if args.snp_id_exc is not None: # If this is not None the argument contains a table of snps to exclude mapper.exclude = pd.DataFrame.from_csv(args.snp_id_exc, index_col=None) print 'Exclude:' print mapper.exclude.head() if 'ID' not in mapper.exclude.columns and ( 'CHR' not in mapper.exclude.columns
if (cov.folder.n_files>1 and cov.folder.format!='.npy') or (cov.folder.n_files>2 and cov.folder.format=='.npy'): #TODO (middle) test raise ValueError('In covariates folder should be only one file!') gen=[] for i,j in enumerate(args.genotype): gen.append(Reader('genotype')) gen[i].start(j,hdf5=args.hdf5, study_name=args.study_name[i], ID=False) if args.mapper is not None: mapper=Mapper() mapper.chunk_size=MAPPER_CHUNK_SIZE mapper.genotype_names=args.study_name mapper.reference_name=args.ref_name if args.snp_id_inc is not None: mapper.include=pd.DataFrame.from_csv(args.snp_id_inc,index_col=None) print 'Include:' print mapper.include.head() if 'ID' not in mapper.include.columns and ('CHR' not in mapper.include.columns or 'bp' not in mapper.include.columns): raise ValueError('{} table does not have ID or CHR,bp columns'.format(args.snp_id_inc)) if args.snp_id_exc is not None: mapper.exclude=pd.DataFrame.from_csv(args.snp_id_exc,index_col=None) print 'Exclude:' print mapper.exclude.head() if 'ID' not in mapper.exclude.columns and ('CHR' not in mapper.exclude.columns or 'bp' not in mapper.exclude.columns): raise ValueError('{} table does not have ID or CHR,bp columns'.format(args.snp_id_exc)) mapper.load(args.mapper) mapper.load_flip(args.mapper) mapper.cluster=args.cluster mapper.node=args.node else: