コード例 #1
0
    for fragment in fragments:
        inses = []
        for samplename, sample in samples.iterrows():
            if submit:
                fork_self(samplename, fragment, VERBOSE=VERBOSE, qual_min=qual_min)
                continue

            if VERBOSE >= 1:
                print fragment, samplename

            sample = SamplePat(sample)
            pname = sample.patient
            refseq = SeqIO.read(get_initial_reference_filename(pname, fragment), 'fasta')

            fn = sample.get_mapped_filtered_filename(fragment, PCR=PCR)
            if not os.path.isfile(fn):
                warn('No BAM file found', NoDataWarning)
                continue

            _, inse = gac(fn, len(refseq), qual_min=qual_min, VERBOSE=VERBOSE)
            inses.append(inse)

            if save_to_file:
                fn_out = sample.get_insertions_filename(fragment, PCR=PCR,
                                                        qual_min=qual_min)
                save_insertions(fn_out, inse)

                if VERBOSE >= 2:
                    print 'Insertions saved:', samplename, fragment
コード例 #2
0
    for samplename, sample in samples.iterrows():
        if VERBOSE >= 1:
            print samplename

        sample = SamplePat(sample)
        pname = sample.patient
        ref = sample.get_reference("genomewide", "gb")

        # Collect the insertions (where possible)
        ics = {}
        for fragment in ["F" + str(i) for i in xrange(1, 7)]:
            try:
                ic = sample.get_insertions(fragment, merge_read_types=False)
            except IOError:
                continue
            start = find_annotation(ref, fragment).location.nofuzzy_start
            ics[(fragment, start)] = ic

        if not len(ics):
            if VERBOSE >= 1:
                print "No data found: skipping"
            continue

        # Merge insertions
        ic = merge_insertions(ics, VERBOSE=VERBOSE)
        if save_to_file:
            fn_out = sample.get_insertions_filename("genomewide")
            save_insertions(fn_out, ic)
            if VERBOSE >= 1:
                print "Genomewide insertions saved to:", fn_out
コード例 #3
0
                fork_self(samplename,
                          fragment,
                          VERBOSE=VERBOSE,
                          qual_min=qual_min)
                continue

            if VERBOSE >= 1:
                print fragment, samplename

            sample = SamplePat(sample)
            pname = sample.patient
            refseq = SeqIO.read(
                get_initial_reference_filename(pname, fragment), 'fasta')

            fn = sample.get_mapped_filtered_filename(fragment, PCR=PCR)
            if not os.path.isfile(fn):
                warn('No BAM file found', NoDataWarning)
                continue

            _, inse = gac(fn, len(refseq), qual_min=qual_min, VERBOSE=VERBOSE)
            inses.append(inse)

            if save_to_file:
                fn_out = sample.get_insertions_filename(fragment,
                                                        PCR=PCR,
                                                        qual_min=qual_min)
                save_insertions(fn_out, inse)

                if VERBOSE >= 2:
                    print 'Insertions saved:', samplename, fragment
コード例 #4
0
    for samplename, sample in samples.iterrows():
        if VERBOSE >= 1:
            print samplename

        sample = SamplePat(sample)
        pname = sample.patient
        ref = sample.get_reference('genomewide', 'gb')

        # Collect the insertions (where possible)
        ics = {}
        for fragment in ['F' + str(i) for i in xrange(1, 7)]:
            try:
                ic = sample.get_insertions(fragment, merge_read_types=False)
            except IOError:
                continue
            start = find_annotation(ref, fragment).location.nofuzzy_start
            ics[(fragment, start)] = ic

        if not len(ics):
            if VERBOSE >= 1:
                print 'No data found: skipping'
            continue

        # Merge insertions
        ic = merge_insertions(ics, VERBOSE=VERBOSE)
        if save_to_file:
            fn_out = sample.get_insertions_filename('genomewide')
            save_insertions(fn_out, ic)
            if VERBOSE >= 1:
                print 'Genomewide insertions saved to:', fn_out