コード例 #1
0
ファイル: target_enrichment.py プロジェクト: sagrudd/megrim
    def __init__(self,
                 reference_genome=None,
                 bed_file=None,
                 bam_file=None,
                 target_proximity=2000,
                 background_threshold=20,
                 tile_size=1000):
        Flounder.__init__(self)

        logging.info("Preparing reference genome")
        self.ref = ReferenceGenome(reference_genome)

        logging.info("Preparing BED coordinates")
        self.bed = BedHandler(bed_file)
        self.bed.set_reference(self.ref)
        self.bed.set_target_proximity(target_proximity)

        logging.info("setting BAM file")
        self.bam = BamHandler(bam_file)
        self.background_threshold = background_threshold
        self.target_proximity = target_proximity
        self.tile_size = tile_size
コード例 #2
0
    def __init__(self, fast5, bam, reference, modification="5mC", 
                 threshold=0.85, context = "CG", args=None):
        Flounder.__init__(self)
        if args is not None:
            if isinstance(args, argparse.Namespace):
                self.argparse(args)
            if isinstance(args, dict):
                self.dictparse(args)
            include_flounder(args)
            # functions in module but outside of class may require these info

        self.fast5 = fast5
        self.reference = reference
        self.bam = bam
        self.modification = modification
        self.threshold = threshold
        self.context = context
        self.index = hashlib.md5(
                    f" {self.fast5} {self.reference.fasta.filename} "
                    "{self.bam.bam} {self.modification} {self.context} "
                    "{self.threshold} ".encode()).hexdigest()[0:7]
        logging.info(f"workflow_index == [{self.index}]")
コード例 #3
0
def include_flounder(args):
    """
    Set a flounder context visible in module global space for data caching.

    Parameters
    ----------
    args : TYPE
        DESCRIPTION.

    Returns
    -------
    None.

    """
    # setup a Flounder for this workflow ...
    global flounder
    flounder = Flounder()
    if isinstance(args, argparse.Namespace):
        flounder.argparse(args)
    if isinstance(args, dict):
        flounder.dictparse(args)
コード例 #4
0
ファイル: conda_reader.py プロジェクト: sagrudd/megrim
 def __init__(self, spec):
     Flounder.__init__(self)
     self.spec = spec
     self.lines = None