Beispiel #1
0
"""
Scanning functions for Orf objects with PSSMs
"""

# Module metadata
__authors__ = "Ate van der Burgt"
__license__ = "MIT"

# Python Imports
from sys import path as sysPath

# make shure imports from the parental gene package will work,
# even if it is not specified (yet) in sys.path
from os.path import dirname as osPathDirname, abspath as osPathAbspath, split as osPathSplit
gene_package_dir = osPathSplit(osPathDirname(osPathAbspath(__file__)))[0]
if gene_package_dir not in sysPath: sysPath.append(gene_package_dir)

# Gene Imports
from gene_exceptions import InproperlyAppliedArgument
from splicesite import scan_pssm_splice_site
from start import scan_pssm_tss

# Import Global variables
from settings.splicesites import (
    IC_DONOR_PATTERN_OFFSET,
    IC_ACCEPTOR_PATTERN_OFFSET,
    )
from settings.translationalstartsites import (
    IC_TSS_PATTERN_OFFSET
    )
Beispiel #2
0
from optparse import OptionValueError
from StringIO import StringIO

# Most likely Numeric is not installed; this is solved by having it installed
# within the ABFGP code tree
# The path to Numeric is obtained either from the settings dir (absolute)
# or the path is reconstructed (relative)

# absolute path acquisition
from settings.abgp import MAIN_ABGP_PATH as BASEPATH
sys.path.append(osPathJoin(BASEPATH, "requiredmodules"))
from Numeric import zeros, where, greater, greater_equal

# relative path acquisition
sys.path.append(
    osPathJoin(osPathDirname(osPathAbspath(__file__)), "requiredmodules"))
from Numeric import zeros, where, greater, greater_equal

from abgp_etc import abgpsysexit
from abgp_etc import _blastdb_cleanup
from abgp_etc import _blastdb_cleanup, _file_cleanup
from abgp_exceptions import InproperlyAppliedArgument
from abgp_exceptions import NoCrossdataApplied, NoInputApplied
from abgp_geneconfirmation import *
from abgp_geneconfirmation import geneconfirmation
from abgpgenelocusdirectory import AbgpGeneLocusDirectory
from abgpgenelocusdirectory import IsAbgpGeneLocusDirectory
from abgpgenelocusdirectory import make_abgpgenelocusdirectory_from_fasta
from abgp_logging import logf
from abgp_logging import Logger
from abgp_unigeneconfirmation import geneandunigeneconfirmation
Beispiel #3
0
"""
"""
# Module metadata
__authors__ = "Ate van der Burgt"
__license__ = "MIT"

# Python Imports
from os import popen as osPopen
from os import popen2 as osPopen2
from copy import deepcopy
from sys import path as sysPath

# make shure imports from the parental gene package will work,
# even if it is not specified (yet) in sys.path
from os.path import dirname as osPathDirname, abspath as osPathAbspath, split as osPathSplit
gene_package_dir = osPathSplit(osPathDirname(osPathAbspath(__file__)))[0]
if gene_package_dir not in sysPath: sysPath.append(gene_package_dir)

# Gene Imports
from gene_gff import BasicGFF, GffWithSequenceFunctionality
from splicesite import get_shared_nucleotides_at_splicesite
from donor import ProjectedSpliceDonor
from acceptor import ProjectedSpliceAcceptor
from polypyrimidinetract import PolyPirimidineTract
from branchpoint import BranchPoint 
from validators import *

# Other Imports
import dna2prot

Beispiel #4
0
from optparse import OptionValueError
from StringIO import StringIO

# Most likely Numeric is not installed; this is solved by having it installed
# within the ABFGP code tree
# The path to Numeric is obtained either from the settings dir (absolute)
# or the path is reconstructed (relative)

# absolute path acquisition
from settings.abgp import MAIN_ABGP_PATH as BASEPATH

sys.path.append(osPathJoin(BASEPATH, "requiredmodules"))
from Numeric import zeros, where, greater, greater_equal

# relative path acquisition
sys.path.append(osPathJoin(osPathDirname(osPathAbspath(__file__)), "requiredmodules"))
from Numeric import zeros, where, greater, greater_equal

from abgp_etc import abgpsysexit
from abgp_etc import _blastdb_cleanup
from abgp_etc import _blastdb_cleanup, _file_cleanup
from abgp_exceptions import InproperlyAppliedArgument
from abgp_exceptions import NoCrossdataApplied, NoInputApplied
from abgp_geneconfirmation import *
from abgp_geneconfirmation import geneconfirmation
from abgpgenelocusdirectory import AbgpGeneLocusDirectory
from abgpgenelocusdirectory import IsAbgpGeneLocusDirectory
from abgpgenelocusdirectory import make_abgpgenelocusdirectory_from_fasta
from abgp_logging import logf
from abgp_logging import Logger
from abgp_unigeneconfirmation import geneandunigeneconfirmation
Beispiel #5
0
# Module metadata
__authors__ = "Ate van der Burgt"
__license__ = "MIT"

# Python imports
import gzip
from subprocess import Popen, PIPE
from os.path import (
    join as osPathJoin,
    abspath as osPathAbspath,
    dirname as osPathDirname,
    )

# absolute paths to executables located within the same directory
EXECUTABLE_ISSINGLEFASTADNA     = osPathJoin(osPathDirname(osPathAbspath(__file__)),"issinglefastadna.sh")
EXECUTABLE_ISSINGLEFASTAPROTEIN = osPathJoin(osPathDirname(osPathAbspath(__file__)),"issinglefastaprotein.sh")

########################################################################
#### Exceptions
########################################################################

class NoSingleFastaFile(Exception):
    pass

########################################################################
#### Validation functions
########################################################################

def IsSingleFastaDna(fname,executable=EXECUTABLE_ISSINGLEFASTADNA):
    """