コード例 #1
0
def contig_collection_a5_repeat() -> cnt.ContigCollection:

    mink: int = 15
    maxk: int = 15

    contig_collection: cnt.ContigCollection = cnt.get_contig_collection(
        os.path.join('tests', 'data', 'test_contigs_a5_repeat.fasta'), maxk)

    overlap_collection: ovl.OverlapCollection = ovl.detect_adjacent_contigs(
        contig_collection, mink, maxk)

    return contig_collection, overlap_collection
コード例 #2
0
def contig_collection_spades_1() -> cnt.ContigCollection:

    mink: int = 8
    maxk: int = 17

    contig_collection: cnt.ContigCollection = cnt.get_contig_collection(
        os.path.join('tests', 'data', 'test_contigs_spades_1.fasta.gz'), maxk)

    overlap_collection: ovl.OverlapCollection = ovl.detect_adjacent_contigs(
        contig_collection, mink, maxk)

    return contig_collection, overlap_collection
コード例 #3
0
def contig_collection_spades_no_multplty_0() -> cnt.ContigCollection:

    mink: int = 16
    maxk: int = 25

    contig_collection: cnt.ContigCollection = cnt.get_contig_collection(
        os.path.join('tests', 'data',
                     'test_contigs_spades_no_multplty_0.fasta'), maxk)

    overlap_collection: ovl.OverlapCollection = ovl.detect_adjacent_contigs(
        contig_collection, mink, maxk)

    return contig_collection, overlap_collection
コード例 #4
0
ファイル: mock_contigs.py プロジェクト: masikol/combinator-FQ
def _do_combinator_work(infpath: str, mink: int,
                        maxk: int) -> MockContigsFixture:

    # Read contigs
    contig_collection: cnt.ContigCollection = cnt.get_contig_collection(
        infpath, maxk)

    # Detect adjacent contigs
    overlap_collection: ovl.OverlapCollection = ovl.detect_adjacent_contigs(
        contig_collection, mink, maxk)

    # Assign multiplicity to contigs
    amu.assign_multiplty(contig_collection, overlap_collection)

    return contig_collection, overlap_collection
コード例 #5
0
ファイル: main.py プロジェクト: masikol/combinator-FQ
def main(version: str, last_update_date: str) -> None:

    contigs_fpaths: Sequence[str]  # paths to input files
    params: Dict[str, Any]  # parameters of the program

    # Parse command line arguments
    contigs_fpaths, params = parse_args(version, last_update_date)

    # Report parameters of current run
    _report_parameters(params, version, last_update_date)

    # Iterate over input files and process them
    fpath: str
    for fpath in contigs_fpaths:
        print('Processing file `{}`'.format(fpath))

        # Create output dir
        make_outdir(params['o'])

        # Read contigs
        contig_collection: cnt.ContigCollection = cnt.get_contig_collection(
            fpath, params['a'])

        # Detect adjacent contigs
        overlap_collection: ovl.OverlapCollection = ovl.detect_adjacent_contigs(
            contig_collection, params['i'], params['a'])

        # Assign multiplicity to contigs
        amu.assign_multiplty(contig_collection, overlap_collection)

        # Make prefix for current input file
        prefix: str = conf_prefix(fpath, params['o'])

        # Write output files
        # Write adjacency table
        out.write_adjacency_table(contig_collection, overlap_collection,
                                  params['o'], prefix)
        # Write full log
        out.write_full_log(contig_collection, overlap_collection, params['o'],
                           prefix)
        # Write summary
        out.write_summary(contig_collection, overlap_collection, fpath,
                          params['o'], prefix)

        print('-' * 20)