Exemplo n.º 1
0
                  file=sys.stderr)
            print("Number of stdev from the mean = %f" %
                  (args.insert_size_fold),
                  file=sys.stderr)
            if args.add_tags:
                print("Add tags to each alignment = %s" % (args.add_tags),
                      file=sys.stderr)
            else:
                print("Add tags to each alignment = False", file=sys.stderr)
            (mapTree, targetChromSizes,
             sourceChromSizes) = read_chain_file(chain_file)
            crossmap_bam_file(mapping=mapTree,
                              chainfile=chain_file,
                              infile=in_file,
                              outfile_prefix=out_file,
                              chrom_size=targetChromSizes,
                              IS_size=args.insert_size,
                              IS_std=args.insert_size_stdev,
                              fold=args.insert_size_fold,
                              addtag=args.add_tags,
                              cstyle=args.cstyle)

        elif command == 'gff':
            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
Exemplo n.º 2
0
				print("Insert size stdev = %f" % (options.insert_size_stdev), file=sys.stderr)
				print("Number of stdev from the mean = %f" % (options.insert_size_fold), file=sys.stderr)
				if options.add_tags:
					print("Add tags to each alignment = %s" % ( options.add_tags), file=sys.stderr)
				else:
					print("Add tags to each alignment = %s" % ( False), file=sys.stderr)
				chain_file = args[1]
				in_file = args[2]
				out_file = args[3] if len(args) >= 4 else None
				(mapTree, targetChromSizes, sourceChromSizes) = read_chain_file(chain_file)

				if out_file in ["STDOUT","-"]:
					out_file = None
				if options.add_tags:
					crossmap_bam_file(mapping = mapTree, chainfile = chain_file, infile = in_file, outfile_prefix = out_file,
									chrom_size = targetChromSizes, IS_size=options.insert_size, IS_std=options.insert_size_stdev,
									fold=options.insert_size_fold,addtag=True)
				else:
					crossmap_bam_file(mapping = mapTree, chainfile = chain_file, infile = in_file, outfile_prefix = out_file,
									chrom_size = targetChromSizes, IS_size=options.insert_size, IS_std=options.insert_size_stdev,
									fold=options.insert_size_fold,addtag=False)
			else:
				parser.print_help()

		elif sys.argv[1].lower() == 'vcf':
			usage=("\nCrossMap.py vcf <chain_file>  <input.vcf>  <refGenome.fa>  <output_file> [options]\n\nExamples:\n"
				  "CrossMap.py vcf hg19ToHg18.over.chain.gz test.hg19.vcf hg18.fa test.hg18.vcf                     #comparing ref_allele to alt_allele to make sure they are different.\n"
				  "CrossMap.py vcf hg19ToHg18.over.chain.gz test.hg19.vcf hg18.fa test.hg18.vcf  --no-comp-alleles  #do NOT compare ref_allele to alt_allele.")
			parser = optparse.OptionParser(usage, add_help_option=False)
			parser.add_option("--no-comp-alleles", action="store_true",dest="no_comp_alleles", help=
							"If set, CrossMap does NOT check if the reference allele is different from the alternate allele.")