Ejemplo n.º 1
0
            chain_file = args.chain
            in_file = args.in_gff
            out_file = args.out_gff
            (mapTree, targetChromSizes,
             sourceChromSizes) = read_chain_file(chain_file)
            crossmap_gff_file(mapTree, in_file, out_file, cstyle=args.cstyle)

        elif command == 'wig':
            chain_file = args.chain
            in_file = args.in_wig
            out_file = args.out_wig
            (mapTree, targetChromSizes,
             sourceChromSizes) = read_chain_file(chain_file)
            crossmap_wig_file(mapTree,
                              in_file,
                              out_file,
                              targetChromSizes,
                              in_format='wiggle',
                              cstyle=args.cstyle)

        elif command == 'bigwig':
            chain_file = args.chain
            in_file = args.in_bw
            out_file = args.out_bw
            # check bigwig file
            try:
                bw = pyBigWig.open(in_file)
            except:
                print("\nPlease check if \"%s\" is in bigWig format!\n" %
                      in_file,
                      file=sys.stderr)
                sys.exit(0)
Ejemplo n.º 2
0
			elif len(sys.argv) == 5:
				chain_file = sys.argv[2]
				in_file = sys.argv[3]
				out_file = sys.argv[4]
				(mapTree, targetChromSizes, sourceChromSizes) = read_chain_file(chain_file)
				crossmap_gff_file(mapTree, in_file, out_file)
			else:
				gff_help()
				sys.exit(0)
		elif sys.argv[1].lower() == 'wig':
			if len(sys.argv) == 5:
				chain_file = sys.argv[2]
				in_file = sys.argv[3]
				out_file = sys.argv[4]
				(mapTree, targetChromSizes, sourceChromSizes) = read_chain_file(chain_file)
				crossmap_wig_file(mapTree, in_file, out_file, targetChromSizes, in_format = 'wiggle')
			else:
				wig_help()
				sys.exit(0)
		elif sys.argv[1].lower() == 'bigwig':
			if len(sys.argv) == 5:
				chain_file = sys.argv[2]

				in_file = sys.argv[3]
				try:
					bw = pyBigWig.open(in_file)
				except:
					print ("\nPlease check if \"%s\" is in bigWig format!\n" % in_file, file=sys.stderr)
					sys.exit(0)

				out_file = sys.argv[4]