コード例 #1
0
ファイル: main.py プロジェクト: yelabucsf/scito
def config_for_main(event: Dict) -> Dict:
    if len(event['Records']) > 1:
        raise ValueError(
            'main_handler(): trigger for this function should contain only a single record'
        )
    record = event['Records'][0]
    config_str = pipeline_config_s3(record)
    config_buf = config_ini_to_buf(config_str)
    config = init_config(config_buf)
    if len(config.keys()) > 3:
        raise ValueError(
            'main_handler(): current pipeline supports only technologies with up to 3 FASTQ files per sample'
        )
    return config
コード例 #2
0
from unittest import TestCase
from scito_count.BUSTools import *
from scito_count.ProcessSettings import *
from scito_count.SeqFile import *
from scito_lambdas.lambda_utils import init_config

conf = init_config(
    "/Users/antonogorodnikov/Documents/Work/Python/scito/tests/config_test.ini"
)

s3_set2 = S3Settings(conf, "ATAC ADT R2")
read_set2 = ReadSettings(conf, "ATAC ADT R2")
s3_set3 = S3Settings(conf, "ATAC ADT R3")
read_set3 = ReadSettings(conf, "ATAC ADT R3")

upl_test_s3 = S3Settings(conf, "ATAC ADT R2 UPLOAD TEST")
upl_test_read = ReadSettings(conf, "ATAC ADT R2 UPLOAD TEST")


class TestNativeBusTools(TestCase):
    def setUp(self) -> None:
        ground = FQFile(s3_settings=upl_test_s3,
                        read_settings=upl_test_read,
                        byte_range='0-1000',
                        qc_scale="phred")
        async_file = FQFile(s3_settings=s3_set3,
                            read_settings=read_set3,
                            byte_range='0-1000',
                            qc_scale="phred")
        self.sync_two_reads = FQSyncTwoReads((ground, async_file))
        self.sync_two_reads.two_read_sync()
コード例 #3
0
from unittest import TestCase
from scito_lambdas.architecture_utils import *
from scito_lambdas.lambda_utils import init_config
from ufixtures.UfixVcr import UfixVcr
from scito_lambdas.lambda_settings import settings_event_source_true_split_lambda
import os
import time

curr_dir = os.path.dirname(os.path.realpath(__file__))
conf = init_config(os.path.join(curr_dir, 'fixtures/test_config.ini'))


class Test(TestCase):
    def setUp(self) -> None:
        self.sqs_interface = SQSInterface(conf, 'unit_test')
        self.ufixtures = UfixVcr(os.path.join(curr_dir, 'fixtures/cassettes'))
        self.vcr = self.ufixtures.sanitize(
            attributes=['(?i)token', 'Author', 'User'],
            targets=[
                'arn:aws:sqs:us-west-2:\d+',
                'us-west-2.queue.amazonaws.com/\d+', '3A\d+', '2F\d+', ':\d+:',
                '\"sg-.*\"', '\"subnet-.*\"', '\"vpc-.*\"'
            ])

    def test_prep_queues(self):
        with self.vcr.use_cassette('architecture_utils_prep_queues.yml'):
            main_queue = prep_queues(conf, 'unit_test')
            main_sqs_exists = self.sqs_interface.queue_exists(
                dead_letter=False)
            dead_letter_sqs_exists = self.sqs_interface.queue_exists(
                dead_letter=True)