Exemplo n.º 1
0
def analyse_contigs(contig_file,
                    read1,
                    read2,
                    outputdir,
                    fasta_ref_files=[],
                    verbose=False):
    #first prepare blast files for analysis

    renamedContigs = reNameContigs(contig_file, outputdir)

    blast_files = []
    for reference in fasta_ref_files:
        blast_files.append(
            run_blast(reference, renamedContigs, outputdir, verbose))

    #now align reads to contigs
    samfile = align_w_subread(read1, read2, renamedContigs, outputdir, verbose)

    #now convert to bam
    bamfile = convert_to_bam_create_index(renamedContigs, samfile, verbose)

    # bamfile="notused"
    #now compute analytics
    outfile = generate_summary(bamfile, outputdir, renamedContigs, blast_files)

    return outfile
Exemplo n.º 2
0
def analyse_contigs(contig_file, read1, read2, outputdir
   , fasta_ref_files=[], verbose=False):
    #first prepare blast files for analysis

    renamedContigs = reNameContigs(contig_file, outputdir)

    blast_files = []
    for reference in fasta_ref_files:
        blast_files.append(run_blast(reference, renamedContigs, outputdir
            , verbose))

    #now align reads to contigs
    samfile = align_w_subread(read1, read2, renamedContigs, outputdir, verbose)

    #now convert to bam
    bamfile = convert_to_bam_create_index(renamedContigs, samfile, verbose)

    # bamfile="notused"
    #now compute analytics
    outfile = generate_summary(bamfile, outputdir
        , renamedContigs, blast_files)

    return outfile
Exemplo n.º 3
0
            raise
        pass

    curr_dir = os.getcwd()
    os.chdir(outputdir)

    # print thrd.getScriptPath()
    read1, read2 = thrd.trim_galore(options.read1, options.read2, outputdir
        , options.verbose)

    if options.reference:

        alignment = thrd.align_w_subread(read1, read2, options.reference, outputdir
            , options.verbose, options.ref_index)

        bamfile = thrd.convert_to_bam_create_index(options.reference, alignment
            , options.verbose)

        single_reads, paired_reads = thrd.extract_possible_var_reads(bamfile
            , outputdir, options.var_files, options.verbose)

    else:
        single_reads, paired_reads = thrd.combine_paired(read1, read2, outputdir
            , options.verbose)

    if options.read2 != None:
        if options.pear:
            single_reads, paired_reads = thrd.merge_with_pear(single_reads
                , paired_reads, outputdir, options.verbose)

    #now digital normalisation on the single_reads and paired reads seperately
    if options.norm:
Exemplo n.º 4
0
        pass

    curr_dir = os.getcwd()
    os.chdir(outputdir)

    # print thrd.getScriptPath()
    read1, read2 = thrd.trim_galore(options.read1, options.read2, outputdir,
                                    options.verbose)

    if options.reference:

        alignment = thrd.align_w_subread(read1, read2, options.reference,
                                         outputdir, options.verbose,
                                         options.ref_index)

        bamfile = thrd.convert_to_bam_create_index(options.reference,
                                                   alignment, options.verbose)

        single_reads, paired_reads = thrd.extract_possible_var_reads(
            bamfile, outputdir, options.var_files, options.verbose)

    else:
        single_reads, paired_reads = thrd.combine_paired(
            read1, read2, outputdir, options.verbose)

    if options.read2 != None:
        if options.pear:
            single_reads, paired_reads = thrd.merge_with_pear(
                single_reads, paired_reads, outputdir, options.verbose)

    #now digital normalisation on the single_reads and paired reads seperately
    if options.norm: