Retrieve a list of analyzed samples.

        :rtype:  list
        :return: List of objects referencing each analyzed file.
764125
def analyses(self):
        
        response = self._request("tasks/list")

        return json.loads(response.content.decode('utf-8'))['tasks']
67432
def GetAnalyzersInformation(cls):
    
    analyzer_information = []
    for _, analyzer_class in cls.GetAnalyzers():
      description = getattr(analyzer_class, 'DESCRIPTION', '')
      analyzer_information.append((analyzer_class.NAME, description))

    return analyzer_information
884410
def qc_to_rec(samples):
    
    samples = [utils.to_single_data(x) for x in samples]
    samples = cwlutils.assign_complex_to_samples(samples)
    to_analyze, extras = _split_samples_by_qc(samples)
    recs = cwlutils.samples_to_records([utils.to_single_data(x) for x in to_analyze + extras])
    return [[x] for x in recs]
661972
def spectra(
            self):
        
        specResultsList = []
        specResultsList[:] = [dict(l) for l in self.specResultsList]
        return specResultsList
1106607
def get_raw(self):
        
        return [self.name, self.size, self.last_modified, self.location]
1329757
def examples(self):
         
        examples = []
        for example in [variant.examples for variant in self._raw_synset.variants if len(variant.examples)]:
            examples.extend(example)
        return examples
820593
def files(
            self):
        
        relatedFilesResultsList = []
        relatedFilesResultsList[:] = [dict(l)
                                      for l in self.relatedFilesResultsList]
        return relatedFilesResultsList
1108009
def folderitems(self):
        
        items = super(AddAnalysesView, self).folderitems(classic=False)
        return items
783646
def load_file_to_list(self):
        
        lst = []
        try:
            with open(self.fullname, 'r') as f:
                for line in f:
                    lst.append(line) 
            return lst  
        except IOError:
            return lst
255926
def get_sampletype_data(self):
        
        for obj in self.get_sampletypes():
            info = self.get_base_info(obj)
            yield info
540122
def get_examples(examples_dir="examples/"):  # pragma: no cover
    """"""
    all_files = os.listdir(examples_dir)
    python_files = [f for f in all_files if is_python_file(f)]
    basenames = [remove_suffix(f) for f in python_files]
    modules = [import_module(module) for module in pathify(basenames)]
    return [
        module for module in modules
        if getattr(module, 'app', None) is not None
    ]
760632
def analyze(self, scratch, **kwargs):
        
        scripts_set = set()
        for script in self.iter_scripts(scratch):
            if script[0].type.text == 'define %s':
                continue  # Ignore user defined scripts
            blocks_list = []
            for name, _, _ in self.iter_blocks(script.blocks):
                blocks_list.append(name)
            blocks_tuple = tuple(blocks_list)
            if blocks_tuple in scripts_set:
                if len(blocks_list) > 3:
                    self.total_duplicate += 1
                    self.list_duplicate.append(blocks_list)
            else:
                scripts_set.add(blocks_tuple)
495592
def get_used_files():
    """"""
    import psutil
    loop_over_scanpy_processes = (proc for proc in psutil.process_iter()
                                  if proc.name() == 'scanpy')
    filenames = []
    for proc in loop_over_scanpy_processes:
        try:
            flist = proc.open_files()
            for nt in flist:
                filenames.append(nt.path)
        # This catches a race condition where a process ends
        # before we can examine its files
        except psutil.NoSuchProcess as err:
            pass
    return set(filenames)
1135527
def to_list(self):
        
        ret = []
        for instance in self.instances:
            ret.append(instance.to_dict())
        return ret
370111
def filer(self):
        
        # Get a list of all the .fastq files in the sequence path
        fastq = sorted(glob(os.path.join(self.sequencepath, '*fastq*')))
        # Initialise a list to store .fasta formatted files
        fasta = list()
        # Get all the files in the sequence path
        for sequencefile in glob(os.path.join(self.sequencepath, '*')):
            # Split the extension from the file
            extension = os.path.splitext(sequencefile)[1]
            # If the extension is one of the acceptable FASTA extensions, add it to the list of FASTA files
            if extension in self.extensions:
                fasta.append(sequencefile)
        # Use filer from accessoryFunctions to find the base file name of each .fastq file/pair
        fastqnames = filer(fastq)
        # Get all the .fastq files into metadata objects
        for fastqname in sorted(fastqnames):
            # Create the metadata object
            sample = MetadataObject()
            sample.name = os.path.basename(fastqname)
            # Create an attribute for the current analysis
            setattr(sample, self.analysistype, GenObject())
            # Set the destination folder
            sample[self.analysistype].outputdir = os.path.join(self.path, fastqname)
            # Make the destination folder
            make_path(sample[self.analysistype].outputdir)
            # Get the fastq files specific to the fastqname
            specificfastq = glob(os.path.join(self.sequencepath, '{fq}*.fastq*'.format(fq=fastqname)))
            # Set the file type for the downstream analysis
            sample[self.analysistype].filetype = 'fastq'
            # Link the files to the output folder
            for fastq in specificfastq:
                relative_symlink(src_file=fastq,
                                 output_dir=sample[self.analysistype].outputdir)
            # Initialise the general and run categories
            sample.general = GenObject()
            # Populate the .fastqfiles category of :self.metadata
            sample.general.fastqfiles = [fastq for fastq in
                                         glob(os.path.join(sample[self.analysistype].outputdir, '{fq}*.fastq*'
                                                           .format(fq=fastqname))) if 'trimmed' not in fastq]
            # Populate certain attributes in order to be compatible with other local software
            sample.general.bestassemblyfile = sample.general.fastqfiles
            sample.general.trimmedcorrectedfastqfiles = sample.general.fastqfiles
            sample.general.outputdirectory = sample[self.analysistype].outputdir
            sample[self.analysistype].baitedfastq = os.path.join(
                sample[self.analysistype].outputdir,
                '{at}_targetMatches.fastq.gz'.format(at=self.analysistype))
            # Append the metadata to the list of samples
            self.metadata.append(sample)
        # Add any .fasta formatted files to the metadata object
        for fastafile in sorted(fasta):
            sample = MetadataObject()
            sample.name = os.path.splitext(os.path.split(fastafile)[-1])[0]
            setattr(sample, self.analysistype, GenObject())
            # Set the destination folder
            sample[self.analysistype].outputdir = os.path.join(self.path, 'detailed_reports', sample.name)
            # Make the destination folder
            make_path(sample[self.analysistype].outputdir)
            # Set the file type for the downstream analysis
            sample[self.analysistype].filetype = 'fasta'
            # Link the .fasta files to :self.path/:filename
            relative_symlink(src_file=fastafile,
                             output_dir=sample[self.analysistype].outputdir)
            # Initialise the general and run categories
            sample.general = GenObject()
            # Populate the .fastqfiles category of :self.metadata
            sample.general.fastqfiles = [fastq for fastq in glob(os.path.join(sample[self.analysistype].outputdir,
                                                                              '{sn}*{ext}*'
                                                                              .format(
                                                                                  sn=sample.name,
                                                                                  ext=os.path.splitext(fastafile)[1])))]
            sample.general.bestassemblyfile = sample.general.fastqfiles
            sample.general.trimmedcorrectedfastqfiles = sample.general.fastqfiles
            sample.general.outputdirectory = sample[self.analysistype].outputdir
            sample[self.analysistype].baitedfastq = os.path.join(
                sample[self.analysistype].outputdir,
                '{at}_targetMatches.fastq.gz'.format(at=self.analysistype))
            sample[self.analysistype].assemblyfile = fastafile
            # Append the metadata to the list of samples
            self.metadata.append(sample)
544474
def getAnalysisRequests(self, **kwargs):
        
        brains = self.getAnalysisRequestsBrains(**kwargs)
        return [b.getObject() for b in brains]
800105
def get_samples():
    
    samples = {}
    module_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "modules")
    for file in sorted(os.listdir(module_dir)):
        if file.endswith(".py") and file != "__init__.py":
            #  remove .py
            module_name = file[:-3]
            with open(os.path.join(module_dir, file), "r") as f:
                try:
                    module = ast.parse(f.read())
                except SyntaxError:
                    continue
                raw_docstring = ast.get_docstring(module)
                if raw_docstring is None:
                    continue
                parts = re.split("^SAMPLE OUTPUT$", raw_docstring, flags=re.M)
                if len(parts) == 1:
                    continue
                sample_data = parts[1]
                samples.update(parse_sample_data(sample_data, module_name))
    return samples