Example #1
0
File: run.py Project: specht/uap
 def get_output_files_for_annotation_and_tags(self, annotation, tags):
     '''
     Retrieve a set of output files of the given annotation, assigned to
     the same number of specified tags. If you have two 'alignment' output
     files and they are called *out-a.txt* and *out-b.txt*, you can use this
     function like this:
     
     - *tags*: ['a', 'b']
     - result: {'a': 'out-a.txt', 'b': 'out-b.txt'}
     '''
     temp = self.get_output_files_abspath()
     return misc.assign_strings(temp[annotation].keys(), tags)
Example #2
0
    def get_output_files_for_annotation_and_tags(self, annotation, tags):
        '''
        Retrieve a set of output files of the given annotation, assigned to
        the same number of specified tags. If you have two 'alignment' output
        files and they are called *out-a.txt* and *out-b.txt*, you can use this
        function like this:

        - *tags*: ['a', 'b']
        - result: {'a': 'out-a.txt', 'b': 'out-b.txt'}
        '''
        temp = self.get_output_files_abspath()
        return misc.assign_strings(temp[annotation].keys(), tags)
Example #3
0
    def declare_runs(self):

        for run_id, input_paths in self.get_run_ids_and_input_files_for_connection('in/reads'):
            with self.declare_run(run_id) as run:
                run.new_exec_group()
                is_paired_end = self.find_upstream_info_for_input_paths(input_paths, 'paired_end')
                if is_paired_end:
                    run.add_output_file('reads', "%s-subsample-R1.fastq.gz" % run_id, input_paths)
                    run.add_output_file('reads', "%s-subsample-R2.fastq.gz" % run_id, input_paths)
                else:
                    raise StandardError("At the moment, random_sample_fastq only supports paired end in this step config")
            

                # in-R1, in-R2, out-R1, out-R2
                if not len(input_paths) == 2:
                    raise StandardError("At the moment, exactly two input files are required.")

                input_files = misc.assign_strings(input_paths, ['R1', 'R2'])
                run.add_private_info('in-R1', input_files['R1'])
                run.add_private_info('in-R2', input_files['R2'])