示例#1
0
文件: hase.py 项目: urmovosa/hase
        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
                    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)  # Load the mapper files
        mapper.load_flip(args.mapper,
                         encode=args.encoded)  # often args.encoded is is null
        mapper.cluster = args.cluster  # Is n by default
        mapper.node = args.node

        Analyser = HaseAnalyser()
示例#2
0
文件: hase.py 项目: roshchupkin/hase
			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:
			if len(args.genotype)==1:
				mapper=Mapper()
				mapper.chunk_size=MAPPER_CHUNK_SIZE
				mapper.genotype_names=args.study_name
				mapper.reference_name=args.ref_name
				mapper.cluster=args.cluster