Пример #1
0
def py2c_gene(py_gene):
    """
    Convert a Python Gene object to a C gene object for use
    with C MISO.
    """
    # Description of exon lens
    CMISO_exon_lens = tuple([(part.start, part.end) for part in py_gene.parts])

    # Description of isoforms of gene
    isoforms_desc = []
    for isoform in py_gene.isoforms:
        curr_iso_desc = tuple([py_gene.parts.index(iso_part) for iso_part in isoform.parts])
        isoforms_desc.append(curr_iso_desc)

    CMISO_isoforms_desc = tuple(isoforms_desc)
    c_gene = pysplicing.createGene(CMISO_exon_lens, CMISO_isoforms_desc)
    return c_gene
Пример #2
0
def py2c_gene(py_gene):
    """
    Convert a Python Gene object to a C gene object for use
    with C MISO.
    """
    # Description of exon lens
    CMISO_exon_lens = tuple([(part.start, part.end) \
                             for part in py_gene.parts])

    # Description of isoforms of gene
    isoforms_desc = []
    for isoform in py_gene.isoforms:
        curr_iso_desc = tuple([py_gene.parts.index(iso_part) \
                               for iso_part in isoform.parts])
        isoforms_desc.append(curr_iso_desc)

    CMISO_isoforms_desc = tuple(isoforms_desc)
    c_gene = pysplicing.createGene(CMISO_exon_lens, CMISO_isoforms_desc)
    return c_gene
Пример #3
0
##
## Test Pysplicing (fastmiso)
##

import misopy
import misopy.gff_utils
import pysplicing

gene = pysplicing.createGene(((1, 100), (201, 300), (401, 500)),
                             ((0, 1), (0, 2), (0, 1, 2)))

pysplicing.noIso(gene)
pysplicing.isoLength(gene)

reads = pysplicing.simulateReads(gene, 0L, (0.2, 0.3, 0.5), 2000L, 33L)

print "Reads: ", reads[1]
print "Cigars: ", reads[2]

# Load BAM file

print reads[1], type(reads[1])
results = pysplicing.MISO(gene, 0L, reads[1], reads[2], 33L, 5000L, 500L, 10L,
                          (1.0, 1.0, 1.0))

print "Results:", results[0]

# est2 = pysplicing.solveIsoGene(gene, 0L, 33L, reads[1], reads[2])
########################
Пример #4
0
##
## Test Pysplicing (fastmiso)
##

import misopy
import misopy.gff_utils
import pysplicing

gene = pysplicing.createGene( ((1,100), (201,300), (401,500)),
                              ((0,1), (0,2), (0,1,2)) )

pysplicing.noIso(gene)
pysplicing.isoLength(gene)

reads = pysplicing.simulateReads(gene, 0L, (0.2,0.3,0.5), 2000L, 33L)

print "Reads: ", reads[1]
print "Cigars: ",reads[2]

# Load BAM file


print reads[1], type(reads[1])
results = pysplicing.MISO(gene, 0L, reads[1], reads[2], 33L, 5000L, 500L, 10L,
                          (1.0, 1.0, 1.0))

print "Results:" , results[0]

# est2 = pysplicing.solveIsoGene(gene, 0L, 33L, reads[1], reads[2])
########################