コード例 #1
0
            last_x=0
            contign=0
        contig,p=end[:-2],end[-1:]

        if not contig in scaffold_hash: 
            print("scaffold:",contig,scaffold)
            scaffold_hash[contig]=scaffold
        if (not contig == last_c) and last_s==scaffold:
            if not (contig,last_c) in bl:
                print("\t".join(map(str,["#edge:",last_end,end,{'length':int(x-last_x),'contig':False}])))

        elif last_c==contig:

            if args.breaks and is_broken(contig,breaks):

                new_scaffold = scaffold_raw + idGen.id()
                scaffold_rename[scaffold_raw]=new_scaffold
                if p=="3" : ## contig on the + strand

                    
#                      
#                    new_3prime_end = end
                    
                    
                    print("\t".join(map(str,["#edge:",last_end,end,{'length':int(x-last_x),'contig':True}])))
                    print("\t".join(map(str,["#edge:",last_end,end,{'length':int(x-last_x),'contig':True}])))

                    end     = new_contig + ".3"
                    contig  = new_contig
                    scaffold= new_scaffold
                else:       ## contig on the - strand
コード例 #2
0
            scaffold_hash[contig] = scaffold
        if (not contig == last_c) and last_s == scaffold:
            if not (contig, last_c) in bl:
                print("\t".join(
                    map(str, [
                        "#edge:", last_end, end, {
                            'length': int(x - last_x),
                            'contig': False
                        }
                    ])))

        elif last_c == contig:

            if args.breaks and is_broken(contig, breaks):

                new_scaffold = scaffold_raw + idGen.id()
                scaffold_rename[scaffold_raw] = new_scaffold
                if p == "3":  ## contig on the + strand

                    #
                    #                    new_3prime_end = end

                    print("\t".join(
                        map(str, [
                            "#edge:", last_end, end, {
                                'length': int(x - last_x),
                                'contig': True
                            }
                        ])))
                    print("\t".join(
                        map(str, [
コード例 #3
0
        pysam.faidx(args.fasta)

    fastafile = pysam.Fastafile(args.fasta)

    outfasta = fastaWriter(args.outfile)
    #    print("opened outfile", file=sys.stderr)

    logfile = False
    if args.logfile: logfile = open(args.logfile, "wt")

    name_prefix = ""
    if args.prefix:
        name_prefix = args.prefix
    else:
        import idGen as idGen
        name_prefix = "Sc" + idGen.id()
        print("name_prefix", name_prefix, file=sys.stderr)
    #    for i in range(5):
    #        name_prefix += random.choice( "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz" )

#31      Scaffold142609_1.5      GGGGTACCAGGTGTCTGGGTGCTGGCAGAGCCGGCACTGATGTTTTCTGGG     Scaffold41854_1.5       GGTACCAGGTGTCTGGGTGCTGGCAGAGCCGGCACTGATGTTTTCTGGGGG     GGGGTACCAGGTGTCTGGGTGCTGGCAGAGCCGGCACTGATGTTTTCTGGGGG

    gapclose_data = {}
    if args.gapclose:
        fh = open(args.gapclose)
        while True:
            l = fh.readline()
            if not l: break
            if l[0] == "#": continue
            scaffold, end1, kmer1, end2, kmer2, closure = l.strip().split()
            gapclose_data[end1, end2] = (kmer1, kmer2, closure)
コード例 #4
0
        pysam.faidx(args.fasta)

    fastafile = pysam.Fastafile( args.fasta )

    outfasta=fastaWriter(args.outfile)
#    print("opened outfile", file=sys.stderr)

    logfile=False
    if args.logfile: logfile=open(args.logfile,"wt")

    name_prefix=""
    if args.prefix:
        name_prefix=args.prefix
    else:
        import idGen as idGen
        name_prefix="Sc" + idGen.id()
        print("name_prefix",name_prefix,file=sys.stderr)
    #    for i in range(5):
    #        name_prefix += random.choice( "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz" )

#31      Scaffold142609_1.5      GGGGTACCAGGTGTCTGGGTGCTGGCAGAGCCGGCACTGATGTTTTCTGGG     Scaffold41854_1.5       GGTACCAGGTGTCTGGGTGCTGGCAGAGCCGGCACTGATGTTTTCTGGGGG     GGGGTACCAGGTGTCTGGGTGCTGGCAGAGCCGGCACTGATGTTTTCTGGGGG

    gapclose_data={}
    if args.gapclose:
        fh=open(args.gapclose)
        while True:
            l=fh.readline()
            if not l: break
            if l[0]=="#": continue
            scaffold,end1,kmer1,end2,kmer2,closure=l.strip().split()
            gapclose_data[end1,end2]=(kmer1,kmer2,closure)
コード例 #5
0
#!/usr/bin/env python3
import idGen

id = idGen.id()
print("\nYour generated ID is:\n{}".format(id))