code: def fastqmover(self):
          
          # Create the project path variable
          self.projectpath = self.fastqdestination + "/Project_" + self.projectname
          # Iterate through all the sample names
          for sample in self.metadata.samples:
              # Glob all the .gz files in the subfolders - projectpath/Sample_:sample.name/*.gz
              for fastq in sorted(glob('{}/Sample_{}/*.gz'.format(self.projectpath, sample.name))):
                  # Try/except loop link .gz files to self.path
                  try:
                      # Move fastq file to the path, but renames them first using the sample number.
                      move(
                          fastq, '{}{}'.format(self.path, os.path.basename(
                              sub('\w{8}-\w{8}', 'S{}'.format(
                                  sample.run.SampleNumber), fastq))))
                  # Except os errors
                  except OSError as exception:
                      # If there is an exception other than the file exists, raise it
                      if exception.errno != errno.EEXIST:
                          raise
              # Repopulate .strainfastqfiles with the freshly-linked files
              fastqfiles = glob('{}/{}*.fastq*'.format(self.fastqdestination, sample.name))
              fastqfiles = [fastq for fastq in fastqfiles if 'trimmed' not in fastq]
              # Populate the metadata object with the name/path of the fastq files
              sample.general.fastqfiles = fastqfiles
              # Save the outputdir to the metadata object
              sample.run.outputdirectory = self.fastqdestination
          # Copy the sample sheet and the run info files to the path
          copyfile(self.assertions.samplesheet, os.path.join(self.path, 'SampleSheet.csv'))
          copyfile(os.path.join(self.miseqfolder, 'RunInfo.xml'), os.path.join(self.path, 'RunInfo.xml'))
docs: Links .fastq files created above to :self.path/:sample.name/