Esempio n. 1
0
def test_slice_up_scaff():
    """run the function slice_up_scaff"""
    intergenic_region = slice_up_scaff(Genome_seq_record.seq,
                                       "1",
                                       "5",
                                       "+")
    assert_equal(intergenic_region, "TTTT")
Esempio n. 2
0
def test_slice_up_scaff():
    """run the function slice_up_scaff NA start"""
    intergenic_region, final_start, \
           final_stop = slice_up_scaff(Genome_seq_record.seq,
                                       "NA",
                                       "5",
                                       "+")
    assert_equal(intergenic_region, "TTTT")
Esempio n. 3
0
def test_slice_up_scaff():
    """run the function slice_up_scaff reverse_complment"""
    intergenic_region, final_start, \
           final_stop = slice_up_scaff(Genome_seq_record.seq,
                                       "1",
                                       "5",
                                       "-")
    assert_equal(intergenic_region, "AAAA")
Esempio n. 4
0
def test_slice_up_scaff():
    """run the function slice_up_scaff NA stop revrse complement"""
    intergenic_region, final_start, \
           final_stop = slice_up_scaff(Genome_seq_record.seq,
                                       "100",
                                       "NA",
                                       "-")
    # note that the 100 is actually 101, and the end is len(seq) -1
    assert_equal(intergenic_region, "TCACC")
Esempio n. 5
0
            out = "upstream for gene %s falls off END of scaff %s" % (gene,
                                                                      scaff)
            logger.warning(out)
        if scaff in Genome_sequence:
            Genome_seq_record = Genome_sequence[scaff]
        else:
            warn = "could not find scaff: %s going to skip" % (scaff)
            logger.warning(warn)
        length_of_contig = len(Genome_seq_record.seq)
        # slice up the scaffold.
        # reverse complement for negative
        # this function gets the entire intergenic regions, regardless of
        # the desired length.
        intergenic_region, final_start, \
               final_stop = slice_up_scaff(Genome_seq_record.seq,
                                           final_start,
                                           final_stop,
                                           direction)
        # this function then get the desired upstream chunk
        upstream_ROI = get_len_upstream(intergenic_region, upstream, direction)
        if description.upper() == "YES":
            info = "Scaff: %s | start-stop: %s:%s %s coding direction" % (
                scaff, final_start, final_stop, direction)
        if len(upstream_ROI) >= min_len:
            write_out_to_file(outfile, gene, upstream, upstream_ROI, info)
        else:
            logger.warn

        write_out_gff(gff_outfile, scaff, final_start, final_stop, direction,
                      gene, upstream)
    logger.info("gff made, this contains all intergenic regions")
    outfile.close()