コード例 #1
0
    cmd = '{} -k19 -w19 -t{} {} {} ' \
          '> contigs_against_ref.paf 2> contigs_against_ref.paf.log'.format(minimap_path, t, reference_file, contigs_file)

    if not os.path.isfile('contigs_against_ref.paf'):
        run(cmd)

    # Read in the minimap2 alignments just generated
    log('Reading alignments')
    alns = read_paf_alignments('contigs_against_ref.paf')
    alns = clean_alignments(alns, l=1000, in_exclude_file=exclude_file)

    # Process the gff file
    if gff_file:
        log('Getting gff features')
        features = defaultdict(list)
        z = GFFReader(gff_file)
        for i in z.parse_gff():
            features[i.seqname].append(i)

    # Break chimeras if desired
    if break_chimeras:
        # Record how many contigs are broken
        total_inter_broken = 0
        total_intra_broken = 0

        alns = clean_alignments(alns,
                                l=10000,
                                in_exclude_file=exclude_file,
                                uniq_anchor_filter=True)
        # Process contigs
        log('Getting contigs')
コード例 #2
0
ファイル: ragoo.py プロジェクト: tw7649116/RaGOO
    cmd = '{} -k19 -w19 -t{} ../{} ../{} ' \
          '> contigs_against_ref.paf 2> contigs_against_ref.paf.log'.format(minimap_path, t, reference_file, contigs_file)

    if not os.path.isfile('contigs_against_ref.paf'):
        run(cmd)

    # Read in the minimap2 alignments just generated
    log('-- Reading alignments')
    alns = read_paf_alignments('contigs_against_ref.paf')
    alns = clean_alignments(alns, l=1000, in_exclude_file=exclude_file)

    # Process the gff file
    if gff_file:
        log('-- Getting gff features')
        features = defaultdict(list)
        z = GFFReader('../' + gff_file)
        for i in z.parse_gff():
            features[i.seqname].append(i)

    # Break chimeras if desired
    if break_chimeras:
        # Record how many contigs are broken
        total_inter_broken = 0
        total_intra_broken = 0

        alns = clean_alignments(alns, l=10000, in_exclude_file=exclude_file, uniq_anchor_filter=True)
        # Process contigs
        log('-- Getting contigs')
        contigs_dict = read_contigs('../' + contigs_file)

        log('-- Finding interchromosomally chimeric contigs')
コード例 #3
0
ファイル: ragoo.py プロジェクト: lucventurini/RaGOO
        run(cmd)

    # Read in the minimap2 alignments just generated
    if not os.path.exists(os.path.join("orderings", "done.txt")):
        log('Reading alignments')
        alns = read_paf_alignments('contigs_against_ref.paf')
        alns = clean_alignments(alns,
                                l=1000,
                                in_exclude_file=exclude_file,
                                quality=args.quality)

        # Process the gff file
        if gff_file:
            log('Getting gff features')
            features = defaultdict(list)
            z = GFFReader(os.path.relpath(gff_file))
            for i in z.parse_gff():
                features[i.seqname].append(i)

        # Break chimeras if desired
        if break_chimeras:
            # Record how many contigs are broken
            total_inter_broken = 0
            total_intra_broken = 0

            alns = clean_alignments(alns,
                                    l=10000,
                                    in_exclude_file=exclude_file,
                                    uniq_anchor_filter=True)
            # Process contigs
            log('Getting contigs')