original_docstring:  
          Performs some basic sanity checks on the input parameters
          
docstring: Performs some basic sanity checks on the input parameters
docstring_tokens: Performs some basic sanity checks on the input parameters
code: def sanityCheck(self):
          """ 
          Performs some basic sanity checks on the input parameters
          """
  
          if self.ref_annotation is not None and (not os.path.isfile(self.ref_annotation) or \
                                                  (not self.ref_annotation.endswith(".gtf") \
                                                   and not self.ref_annotation.endswith(".gff3") \
                                                   and not self.ref_annotation.endswith(".gff"))):
              error = "Error parsing parameters.\n" \
                      "Invalid annotation file {}".format(self.ref_annotation)
              self.logger.error(error)
              raise RuntimeError(error)
  
          if self.ref_annotation is None and not self.transcriptome:
              error = "Error, annotation file is missing but the transcriptome option is disabled\n"
              self.logger.error(error)
              raise RuntimeError(error)
  
          if self.ref_map is None and not self.disable_mapping:
              error = "Error, genome reference is missing but the disable_mapping option is disabled\n"
              self.logger.error(error)
              raise RuntimeError(error)
  
          if not os.path.isfile(self.fastq_fw) or not os.path.isfile(self.fastq_rv):
              error = "Error parsing parameters.\n" \
                      "Invalid input files {} {}".format(self.fastq_fw, self.fastq_rv)
              self.logger.error(error)
              raise RuntimeError(error)
  
          if (not self.fastq_fw.endswith(".fastq")
              and not self.fastq_fw.endswith(".fq")
              and not self.fastq_fw.endswith(".gz")
              and not self.fastq_rv.endswith(".bz2")) \
                  or (not self.fastq_rv.endswith(".fastq")
                      and not self.fastq_rv.endswith(".fq")
                      and not self.fastq_rv.endswith(".gz")
                      and not self.fastq_rv.endswith(".bz2")):
              error = "Error parsing parameters.\n" \
                      "Incorrect format for input files {} {}".format(self.fastq_fw, self.fastq_rv)
              self.logger.error(error)
              raise RuntimeError(error)
  
          if not self.disable_barcode and not os.path.isfile(self.ids):
              error = "Error parsing parameters.\n" \
                      "Invalid IDs file {}".format(self.ids)
              self.logger.error(error)
              raise RuntimeError(error)
  
          if not self.disable_barcode and self.ids is None:
              error = "Error IDs file is missing but the option to disable the " \
                      "demultiplexing step is not activated\n"
              self.logger.error(error)
              raise RuntimeError(error)
  
          if self.saturation_points is not None and not self.compute_saturation:
              self.logger.warning("Saturation points are provided but the option"
                                  "to compute saturation is disabled.")
  
          if not self.disable_umi and self.umi_filter:
              # Check template validity
              import re
              regex = "[^ACGTURYSWKMBDHVN]"
              if re.search(regex, self.umi_filter_template) is not None:
                  error = "Error invalid UMI template given {}.\n".format(self.umi_filter_template)
                  self.logger.error(error)
                  raise RuntimeError(error)
                  # Check template length
              if len(self.umi_filter_template) != (self.umi_end_position - self.umi_start_position):
                  error = "Error the UMI template given does not have the same " \
                          "length as the UMIs {}.\n".format(self.umi_filter_template)
                  self.logger.error(error)
                  raise RuntimeError(error)
                  # Convert the template into a reg-exp
              temp_reg_exp = ""
              for ele in self.umi_filter_template:
                  if ele == "W":
                      temp_reg_exp += "[AT]"
                  elif ele == "S":
                      temp_reg_exp += "[CG]"
                  elif ele == "N":
                      temp_reg_exp += "[ATCG]"
                  elif ele == "V":
                      temp_reg_exp += "[ACG]"
                  elif ele == "A":
                      temp_reg_exp += "[A]"
                  elif ele == "C":
                      temp_reg_exp += "[C]"
                  elif ele == "G":
                      temp_reg_exp += "[G]"
                  elif ele == "T":
                      temp_reg_exp += "[T]"
                  elif ele == "U":
                      temp_reg_exp += "[U]"
                  elif ele == "R":
                      temp_reg_exp += "[AG]"
                  elif ele == "Y":
                      temp_reg_exp += "[CT]"
                  elif ele == "K":
                      temp_reg_exp += "[GT]"
                  elif ele == "M":
                      temp_reg_exp += "[AC]"
                  elif ele == "B":
                      temp_reg_exp += "[CGT]"
                  elif ele == "D":
                      temp_reg_exp += "[AGT]"
                  elif ele == "H":
                      temp_reg_exp += "[ACT]"
              self.umi_filter_template = temp_reg_exp
  
          # Add checks for trimming parameters, demultiplex parameters and UMI parameters
          if self.allowed_missed > self.allowed_kmer and not self.disable_barcode:
              error = "Error starting the pipeline.\n" \
                      "Taggd allowed mismatches is bigger or equal than the Taggd k-mer size"
              self.logger.error(error)
              raise RuntimeError(error)
  
          if self.umi_start_position < self.barcode_start < self.umi_end_position \
                  and not self.disable_barcode and not self.disable_umi:
              error = "Error starting the pipeline.\n" \
                      "The start position of the barcodes is between the UMIs start-end position"
              self.logger.error(error)
              raise RuntimeError(error) 
  
          if self.umi_allowed_mismatches > (self.umi_end_position - self.umi_start_position) \
                  and not self.disable_umi:
              error = "Error starting the pipeline.\n" \
                      "The allowed UMI mismatches is bigger than the UMI size"
              self.logger.error(error)
              raise RuntimeError(error)
  
              # Test the presence of the scripts
          required_scripts = set(['STAR'])
          unavailable_scripts = set()
          for script in required_scripts:
              if which_program(script) is None:
                  unavailable_scripts.add(script)
          if len(unavailable_scripts) != 0:
              error = "Error starting the pipeline.\n" \
                      "Required software not found:\t".join(unavailable_scripts)
              self.logger.error(error)
              raise RuntimeError(error)
code_tokens: def sanityCheck ( self ) : if self . ref_annotation is not None and ( not os . path . isfile ( self . ref_annotation ) or ( not self . ref_annotation . endswith ( ".gtf" ) and not self . ref_annotation . endswith ( ".gff3" ) and not self . ref_annotation . endswith ( ".gff" ) ) ) : error = "Error parsing parameters.\n" "Invalid annotation file {}" . format ( self . ref_annotation ) self . logger . error ( error ) raise RuntimeError ( error ) if self . ref_annotation is None and not self . transcriptome : error = "Error, annotation file is missing but the transcriptome option is disabled\n" self . logger . error ( error ) raise RuntimeError ( error ) if self . ref_map is None and not self . disable_mapping : error = "Error, genome reference is missing but the disable_mapping option is disabled\n" self . logger . error ( error ) raise RuntimeError ( error ) if not os . path . isfile ( self . fastq_fw ) or not os . path . isfile ( self . fastq_rv ) : error = "Error parsing parameters.\n" "Invalid input files {} {}" . format ( self . fastq_fw , self . fastq_rv ) self . logger . error ( error ) raise RuntimeError ( error ) if ( not self . fastq_fw . endswith ( ".fastq" ) and not self . fastq_fw . endswith ( ".fq" ) and not self . fastq_fw . endswith ( ".gz" ) and not self . fastq_rv . endswith ( ".bz2" ) ) or ( not self . fastq_rv . endswith ( ".fastq" ) and not self . fastq_rv . endswith ( ".fq" ) and not self . fastq_rv . endswith ( ".gz" ) and not self . fastq_rv . endswith ( ".bz2" ) ) : error = "Error parsing parameters.\n" "Incorrect format for input files {} {}" . format ( self . fastq_fw , self . fastq_rv ) self . logger . error ( error ) raise RuntimeError ( error ) if not self . disable_barcode and not os . path . isfile ( self . ids ) : error = "Error parsing parameters.\n" "Invalid IDs file {}" . format ( self . ids ) self . logger . error ( error ) raise RuntimeError ( error ) if not self . disable_barcode and self . ids is None : error = "Error IDs file is missing but the option to disable the " "demultiplexing step is not activated\n" self . logger . error ( error ) raise RuntimeError ( error ) if self . saturation_points is not None and not self . compute_saturation : self . logger . warning ( "Saturation points are provided but the option" "to compute saturation is disabled." ) if not self . disable_umi and self . umi_filter : import re regex = "[^ACGTURYSWKMBDHVN]" if re . search ( regex , self . umi_filter_template ) is not None : error = "Error invalid UMI template given {}.\n" . format ( self . umi_filter_template ) self . logger . error ( error ) raise RuntimeError ( error ) if len ( self . umi_filter_template ) != ( self . umi_end_position - self . umi_start_position ) : error = "Error the UMI template given does not have the same " "length as the UMIs {}.\n" . format ( self . umi_filter_template ) self . logger . error ( error ) raise RuntimeError ( error ) temp_reg_exp = "" for ele in self . umi_filter_template : if ele == "W" : temp_reg_exp += "[AT]" elif ele == "S" : temp_reg_exp += "[CG]" elif ele == "N" : temp_reg_exp += "[ATCG]" elif ele == "V" : temp_reg_exp += "[ACG]" elif ele == "A" : temp_reg_exp += "[A]" elif ele == "C" : temp_reg_exp += "[C]" elif ele == "G" : temp_reg_exp += "[G]" elif ele == "T" : temp_reg_exp += "[T]" elif ele == "U" : temp_reg_exp += "[U]" elif ele == "R" : temp_reg_exp += "[AG]" elif ele == "Y" : temp_reg_exp += "[CT]" elif ele == "K" : temp_reg_exp += "[GT]" elif ele == "M" : temp_reg_exp += "[AC]" elif ele == "B" : temp_reg_exp += "[CGT]" elif ele == "D" : temp_reg_exp += "[AGT]" elif ele == "H" : temp_reg_exp += "[ACT]" self . umi_filter_template = temp_reg_exp if self . allowed_missed > self . allowed_kmer and not self . disable_barcode : error = "Error starting the pipeline.\n" "Taggd allowed mismatches is bigger or equal than the Taggd k-mer size" self . logger . error ( error ) raise RuntimeError ( error ) if self . umi_start_position < self . barcode_start < self . umi_end_position and not self . disable_barcode and not self . disable_umi : error = "Error starting the pipeline.\n" "The start position of the barcodes is between the UMIs start-end position" self . logger . error ( error ) raise RuntimeError ( error ) if self . umi_allowed_mismatches > ( self . umi_end_position - self . umi_start_position ) and not self . disable_umi : error = "Error starting the pipeline.\n" "The allowed UMI mismatches is bigger than the UMI size" self . logger . error ( error ) raise RuntimeError ( error ) required_scripts = set ( [ 'STAR' ] ) unavailable_scripts = set ( ) for script in required_scripts : if which_program ( script ) is None : unavailable_scripts . add ( script ) if len ( unavailable_scripts ) != 0 : error = "Error starting the pipeline.\n" "Required software not found:\t" . join ( unavailable_scripts ) self . logger . error ( error ) raise RuntimeError ( error )
short_docstring: Performs some basic sanity checks on the input parameters
short_docstring_tokens: Performs some basic sanity checks on the input parameters
comment: """ 
          Performs some basic sanity checks on the input parameters
          """$SEP$# Check template validity$SEP$# Check template length$SEP$# Convert the template into a reg-exp$SEP$# Add checks for trimming parameters, demultiplex parameters and UMI parameters$SEP$# Test the presence of the scripts