Extract_Files.py
def mount_seqid_files(self, sequence_pair):
        """
        Put the sequence pair referenced in the sequence_files onto the drive - with specific path 
        "drivepath/Data/Intensities/BaseCalls"
        :param sequence_pair: All information for a pair of SEQ-IDs
        """
        # Figure out if which file is forward/reverse reads.
        if len(sequence_pair.seqid_paths) != 2:
            self.missing.append(sequence_pair.seqid_info.sample_name)
            return
        if '_R1' in sequence_pair.seqid_paths[0]:
            forward_reads = sequence_pair.seqid_paths[0]
            reverse_reads = sequence_pair.seqid_paths[1]
        else:
            forward_reads = sequence_pair.seqid_paths[1]
            reverse_reads = sequence_pair.seqid_paths[0]

        forward_out = os.path.join(self.seqid_mounted_path.replace(' ', '\\ '), sequence_pair.seqid_info.sample_id + '_S1_L001_R1_001.fastq.gz')
        reverse_out = os.path.join(self.seqid_mounted_path.replace(' ', '\\ '), sequence_pair.seqid_info.sample_id + '_S1_L001_R2_001.fastq.gz')
        if not os.path.isfile(forward_out):
            knowndepth = check_depth(forward_reads)
            if knowndepth > 200:
                # Check genome size - used to downsample extremely high coverage stuff to 200x coverage.
                genome_size = check_genome_size(forward_reads, reverse_reads)
                # Now call reformat.sh, set samplebasestarget to 200X coverage. If reads have less than that, this just
                # acts as a copy, otherwise, will downsample to 200X.
                # Very occasionally genome_size will get set to None. If that's the case, just assume a 5MB genome.
                if genome_size is None:
                    genome_size = 5000000
                samplebasestarget = genome_size * 200
                cmd = 'reformat.sh in={forward_reads} in2={reverse_reads} out=\'{forward_out}\' out2=\'{reverse_out}\' ' \
                  'samplebasestarget={samplebasestarget}'.format(forward_reads=forward_reads,
                                                                 reverse_reads=reverse_reads,
                                                                 forward_out=forward_out,
                                                                 reverse_out=reverse_out,
                                                                 samplebasestarget=samplebasestarget)
            else:
                cmd = 'cp {forward_reads} {forward_out} && cp {reverse_reads} {reverse_out}'.format(forward_reads=forward_reads, forward_out=forward_out, reverse_reads=reverse_reads, reverse_out=reverse_out)
            print(cmd)
            os.system(cmd)
        average_forward_score, average_reverse_score = find_average_qscore(forward_reads, reverse_reads)
        if average_forward_score < 30.0:
            self.low_quality.append(sequence_pair.seqid_info.sample_id)
            # os.remove(forward_out)
            # os.remove(reverse_out)

        Put the sequence pair referenced in the sequence_files onto the drive - with specific path 
        "drivepath/Data/Intensities/BaseCalls"
        :param sequence_pair: All information for a pair of SEQ-IDs
        
Put the sequence pair referenced in the sequence_files onto the drive - with specific path
"drivepath/Data/Intensities/BaseCalls"
Put the sequence pair referenced in the sequence_files onto the drive - with specific path " drivepath / Data / Intensities / BaseCalls "
def mount_seqid_files(self, sequence_pair):
        if len(sequence_pair.seqid_paths) != 2:
            self.missing.append(sequence_pair.seqid_info.sample_name)
            return
        if '_R1' in sequence_pair.seqid_paths[0]:
            forward_reads = sequence_pair.seqid_paths[0]
            reverse_reads = sequence_pair.seqid_paths[1]
        else:
            forward_reads = sequence_pair.seqid_paths[1]
            reverse_reads = sequence_pair.seqid_paths[0]
        forward_out = os.path.join(self.seqid_mounted_path.replace(' ', '\\ '), sequence_pair.seqid_info.sample_id + '_S1_L001_R1_001.fastq.gz')
        reverse_out = os.path.join(self.seqid_mounted_path.replace(' ', '\\ '), sequence_pair.seqid_info.sample_id + '_S1_L001_R2_001.fastq.gz')
        if not os.path.isfile(forward_out):
            knowndepth = check_depth(forward_reads)
            if knowndepth > 200:
                genome_size = check_genome_size(forward_reads, reverse_reads)
                if genome_size is None:
                    genome_size = 5000000
                samplebasestarget = genome_size * 200
                cmd = 'reformat.sh in={forward_reads} in2={reverse_reads} out=\'{forward_out}\' out2=\'{reverse_out}\' ' \
                  'samplebasestarget={samplebasestarget}'.format(forward_reads=forward_reads,
                                                                 reverse_reads=reverse_reads,
                                                                 forward_out=forward_out,
                                                                 reverse_out=reverse_out,
                                                                 samplebasestarget=samplebasestarget)
            else:
                cmd = 'cp {forward_reads} {forward_out} && cp {reverse_reads} {reverse_out}'.format(forward_reads=forward_reads, forward_out=forward_out, reverse_reads=reverse_reads, reverse_out=reverse_out)
            print(cmd)
            os.system(cmd)
        average_forward_score, average_reverse_score = find_average_qscore(forward_reads, reverse_reads)
        if average_forward_score < 30.0:
            self.low_quality.append(sequence_pair.seqid_info.sample_id)
def mount_seqid_files ( self , sequence_pair ) : if len ( sequence_pair . seqid_paths ) != 2 : self . missing . append ( sequence_pair . seqid_info . sample_name ) return if '_R1' in sequence_pair . seqid_paths [ 0 ] : forward_reads = sequence_pair . seqid_paths [ 0 ] reverse_reads = sequence_pair . seqid_paths [ 1 ] else : forward_reads = sequence_pair . seqid_paths [ 1 ] reverse_reads = sequence_pair . seqid_paths [ 0 ] forward_out = os . path . join ( self . seqid_mounted_path . replace ( ' ' , '\\ ' ) , sequence_pair . seqid_info . sample_id + '_S1_L001_R1_001.fastq.gz' ) reverse_out = os . path . join ( self . seqid_mounted_path . replace ( ' ' , '\\ ' ) , sequence_pair . seqid_info . sample_id + '_S1_L001_R2_001.fastq.gz' ) if not os . path . isfile ( forward_out ) : knowndepth = check_depth ( forward_reads ) if knowndepth > 200 : genome_size = check_genome_size ( forward_reads , reverse_reads ) if genome_size is None : genome_size = 5000000 samplebasestarget = genome_size * 200 cmd = 'reformat.sh in={forward_reads} in2={reverse_reads} out=\'{forward_out}\' out2=\'{reverse_out}\' ' 'samplebasestarget={samplebasestarget}' . format ( forward_reads = forward_reads , reverse_reads = reverse_reads , forward_out = forward_out , reverse_out = reverse_out , samplebasestarget = samplebasestarget ) else : cmd = 'cp {forward_reads} {forward_out} && cp {reverse_reads} {reverse_out}' . format ( forward_reads = forward_reads , forward_out = forward_out , reverse_reads = reverse_reads , reverse_out = reverse_out ) print ( cmd ) os . system ( cmd ) average_forward_score , average_reverse_score = find_average_qscore ( forward_reads , reverse_reads ) if average_forward_score < 30.0 : self . low_quality . append ( sequence_pair . seqid_info . sample_id )
Put the sequence pair referenced in the sequence_files onto the drive - with specific path
"drivepath/Data/Intensities/BaseCalls"
Put the sequence pair referenced in the sequence_files onto the drive - with specific path " drivepath / Data / Intensities / BaseCalls "
"""
        Put the sequence pair referenced in the sequence_files onto the drive - with specific path 
        "drivepath/Data/Intensities/BaseCalls"
        :param sequence_pair: All information for a pair of SEQ-IDs
        """ # Figure out if which file is forward/reverse reads. # Check genome size - used to downsample extremely high coverage stuff to 200x coverage. # Now call reformat.sh, set samplebasestarget to 200X coverage. If reads have less than that, this just # acts as a copy, otherwise, will downsample to 200X. # Very occasionally genome_size will get set to None. If that's the case, just assume a 5MB genome. # os.remove(forward_out) # os.remove(reverse_out)
self
sequence_pair
All information for a pair of SEQ-IDs
All information for a pair of SEQ - IDs