Ejemplo n.º 1
0
 def test_gen_orig_params(self, mock_gen):
     mock_gen.return_value = [
         None, ['path/to/sra', 'path/to/sra.download.COMPLETE'],
         'mock_sample'
     ]
     mock_samples = ['mock_sample'] * 2
     self.assertEqual(download.gen_orig_params(mock_samples), [
         None, ['path/to/sra', 'path/to/sra.download.COMPLETE'],
         'mock_sample', None,
         ['path/to/sra', 'path/to/sra.download.COMPLETE'], 'mock_sample'
     ])
Ejemplo n.º 2
0
def originate_params():
    """
    Generate a list of sras to download for each sample

    This function gets called twice, once before entering the queue, once after
    """
    num_samples = len(samples)
    logger.info('preparing originate_params for {0} samples'.format(num_samples))
    orig_params_sets = gen_orig_params(samples)
    logger.info(
        '{0} sets of orig_params generated'.format(len(orig_params_sets)))
    for _ in orig_params_sets:
        yield _
Ejemplo n.º 3
0
def originate_params():
    """
    Generate a list of sras to download for each sample

    This function gets called twice, once before entering the queue, once after
    """
    num_samples = len(samples)
    logger.info(
        'preparing originate_params for {0} samples'.format(num_samples))
    orig_params_sets = gen_orig_params(samples)
    logger.info('{0} sets of orig_params generated'.format(
        len(orig_params_sets)))
    for _ in orig_params_sets:
        yield _
Ejemplo n.º 4
0
 def test_gen_orig_params(self, mock_gen):
     mock_gen.return_value = [None, ['path/to/sra', 'path/to/sra.download.COMPLETE'], 'mock_sample']
     mock_samples = ['mock_sample'] * 2
     self.assertEqual(download.gen_orig_params(mock_samples),
                      [None, ['path/to/sra', 'path/to/sra.download.COMPLETE'], 'mock_sample',
                       None, ['path/to/sra', 'path/to/sra.download.COMPLETE'], 'mock_sample'])