示例#1
0
 def test_seed_new_experiments(self):
     pl = PipelineAdaptor(**{'session_class': self.session_class})
     pl.start_session()
     new_exps,_=\
       pl.seed_new_experiments(\
         pipeline_name='PrimaryAnalysis',
         species_name_list=['HG38'],
         fastq_type='demultiplexed_fastq',
       )
     self.assertEqual(len(new_exps), 1)
     self.assertEqual(new_exps[0], 'IGFQ000123_avik_10-4-2018_Miseq')
def find_new_analysis_seeds(dbconfig_path, pipeline_name, project_name_file,
                            species_name_list, fastq_type,
                            library_source_list):
    '''
  A utils method for finding and seeding new experiments for analysis
  
  :param dbconfig_path: A database configuration file
  :param slack_config: A slack configuration file
  :param pipeline_name:Pipeline name
  :param fastq_type: Fastq collection type
  :param project_name_file: A file containing the list of projects for seeding pipeline
  :param species_name_list: A list of species to consider for seeding analysis
  :param library_source_list: A list of library source info to consider for seeding analysis
  :returns: List of available experiments or None and a list of seeded experiments or None
  '''
    try:
        available_exps = None
        seeded_exps = None
        if not os.path.exists(project_name_file):
            raise IOError('File {0} not found'.format(project_name_file))

        with open(project_name_file, 'r') as fp:
            project_list = fp.readlines()  # read list of projects from file,
            project_list = [i.strip() for i in project_list]
            if len(project_list) == 0:
                project_list = None

        dbparam = read_dbconf_json(dbconfig_path)
        pl = PipelineAdaptor(**dbparam)
        pl.start_session()
        available_exps,seeded_exps=\
          pl.seed_new_experiments(\
            pipeline_name=pipeline_name,
            species_name_list=species_name_list,
            fastq_type=fastq_type,
            project_list=project_list,
            library_source_list=library_source_list
          )
        pl.close_session()
        return available_exps, seeded_exps
    except:
        raise
示例#3
0
 def test_seed_new_experiments1(self):
     pl = PipelineAdaptor(**{'session_class': self.session_class})
     pl.start_session()
     new_exps,_=\
       pl.seed_new_experiments(\
         pipeline_name='PrimaryAnalysis',
         species_name_list=['HG38'],
         fastq_type='demultiplexed_fastq',
         project_list=['IGFQ000123_avik_10-4-2018_Miseq'],
         library_source_list=['TRANSCRIPTOMIC_SINGLE_CELL']
       )
     self.assertFalse(new_exps)
     pl.close_session()
     pl = PipelineAdaptor(**{'session_class': self.session_class})
     pl.start_session()
     (_,exp_data)=pl.fetch_pipeline_seed_with_table_data(\
                               pipeline_name='PrimaryAnalysis',
                               table_name='experiment',
                               status='SEEDED')
     self.assertEqual(len(list(exp_data['experiment_igf_id'].values)), 1)
     self.assertEqual(exp_data['experiment_igf_id'].values[0],
                      'IGF103923_MISEQ')