original_docstring: Calculate TETRA for files in input directory.
  
      - infiles - paths to each input file
      - org_lengths - dictionary of input sequence lengths, keyed by sequence
  
      Calculates TETRA correlation scores, as described in:
  
      Richter M, Rossello-Mora R (2009) Shifting the genomic gold standard for the
      prokaryotic species definition. Proc Natl Acad Sci USA 106: 19126-19131.
      doi:10.1073/pnas.0906412106.
  
      and
  
      Teeling et al. (2004) Application of tetranucleotide frequencies for the
      assignment of genomic fragments. Env. Microbiol. 6(9): 938-947.
      doi:10.1111/j.1462-2920.2004.00624.x
      
docstring: Calculate TETRA for files in input directory.
  infiles - paths to each input file
  org_lengths - dictionary of input sequence lengths, keyed by sequence
  
  Calculates TETRA correlation scores, as described in.
  
  Richter M, Rossello-Mora R (2009) Shifting the genomic gold standard for the
  prokaryotic species definition.
  
  and
  
  Teeling et al. (2004) Application of tetranucleotide frequencies for the
  assignment of genomic fragments. Env. Microbiol.
docstring_tokens: Calculate TETRA for files in input directory . infiles - paths to each input file org_lengths - dictionary of input sequence lengths keyed by sequence Calculates TETRA correlation scores as described in . Richter M Rossello - Mora R ( 2009 ) Shifting the genomic gold standard for the prokaryotic species definition . and Teeling et al . ( 2004 ) Application of tetranucleotide frequencies for the assignment of genomic fragments . Env . Microbiol .
code: def calculate_tetra(infiles, org_lengths):
      """Calculate TETRA for files in input directory.
  
      - infiles - paths to each input file
      - org_lengths - dictionary of input sequence lengths, keyed by sequence
  
      Calculates TETRA correlation scores, as described in:
  
      Richter M, Rossello-Mora R (2009) Shifting the genomic gold standard for the
      prokaryotic species definition. Proc Natl Acad Sci USA 106: 19126-19131.
      doi:10.1073/pnas.0906412106.
  
      and
  
      Teeling et al. (2004) Application of tetranucleotide frequencies for the
      assignment of genomic fragments. Env. Microbiol. 6(9): 938-947.
      doi:10.1111/j.1462-2920.2004.00624.x
      """
      logger.info("Running TETRA.")
      # First, find Z-scores
      logger.info("Calculating TETRA Z-scores for each sequence.")
      tetra_zscores = {}
      for filename in infiles:
          logger.info("Calculating TETRA Z-scores for %s" % filename)
          org = os.path.splitext(os.path.split(filename)[-1])[0]
          tetra_zscores[org] = tetra.calculate_tetra_zscore(filename)
      # Then calculate Pearson correlation between Z-scores for each sequence
      logger.info("Calculating TETRA correlation scores.")
      tetra_correlations = tetra.calculate_correlations(tetra_zscores)
      return (tetra_correlations, )
code_tokens: def calculate_tetra ( infiles , org_lengths ) : logger . info ( "Running TETRA." ) logger . info ( "Calculating TETRA Z-scores for each sequence." ) tetra_zscores = { } for filename in infiles : logger . info ( "Calculating TETRA Z-scores for %s" % filename ) org = os . path . splitext ( os . path . split ( filename ) [ - 1 ] ) [ 0 ] tetra_zscores [ org ] = tetra . calculate_tetra_zscore ( filename ) logger . info ( "Calculating TETRA correlation scores." ) tetra_correlations = tetra . calculate_correlations ( tetra_zscores ) return ( tetra_correlations , )
short_docstring: Calculate TETRA for files in input directory.
short_docstring_tokens: Calculate TETRA for files in input directory .
comment: """Calculate TETRA for files in input directory.
  
      - infiles - paths to each input file
      - org_lengths - dictionary of input sequence lengths, keyed by sequence
  
      Calculates TETRA correlation scores, as described in:
  
      Richter M, Rossello-Mora R (2009) Shifting the genomic gold standard for the
      prokaryotic species definition. Proc Natl Acad Sci USA 106: 19126-19131.
      doi:10.1073/pnas.0906412106.
  
      and
  
      Teeling et al. (2004) Application of tetranucleotide frequencies for the
      assignment of genomic fragments. Env. Microbiol. 6(9): 938-947.
      doi:10.1111/j.1462-2920.2004.00624.x
      """$SEP$# First, find Z-scores$SEP$# Then calculate Pearson correlation between Z-scores for each sequence