Exemplo n.º 1
0
    transcript_sizes = []
    with open(GENOME) as ercc_genome:
        for line in ercc_genome:
            parsed_line = line.split()
            transcript_names.append(parsed_line[0])
            transcript_sizes.append(parsed_line[1])
    # write counts file and filtered sam file, return stats tuple
    counts, all_ercc_counts, total_counts, mean_mapqs = write_output_counts_file(
        RAW_SAM_FILE, FILTERED_SAM_FILE, COUNTS_FILE, transcript_names,
        ONLY_FWD_READS)
    if (total_counts > 0):
        percent_total_counts_ercc = '%.2f' % (100 *
                                              (all_ercc_counts / total_counts))
        percent_total_counts_non_ercc = 100 - float(percent_total_counts_ercc)

    coverage.parse_sam(FILTERED_SAM_FILE)

    ercc_conc = load_ercc_conc(filter=counts.keys(), pool=ERCC_POOL_NBR)
    ercc_conc.sort()

    dr = dose_response(coverage, ercc_conc, counts, MINIMUM_COUNTS)
    trendline_points = generate_trendline_points(dr)
else:
    msg_to_user = "******" + BARCODE_ENTERED + ", is not found.  This is most likely to result when the barcode is typed incorrectly, or the run was originally processed with a Torrent Suite version less than 3.4."
    data_to_display = False

if data_to_display:
    try:
        report_components = generate_reports(OUTPUT_DIR, coverage, dr, counts)
    except ValueError:
        msg_to_user = "******"
Exemplo n.º 2
0
  coverage = SamCoverage(GENOME)

  transcript_names = []
  transcript_sizes = []
  with open(GENOME) as ercc_genome:
      for line in ercc_genome:
          parsed_line = line.split()
          transcript_names.append(parsed_line[0])
          transcript_sizes.append(parsed_line[1])
  # write counts file and filtered sam file, return stats tuple
  counts, all_ercc_counts, total_counts, mean_mapqs = write_output_counts_file(RAW_SAM_FILE,FILTERED_SAM_FILE,COUNTS_FILE,transcript_names,ONLY_FWD_READS)
  if (total_counts > 0):
    percent_total_counts_ercc = '%.2f' % (100 * (all_ercc_counts / total_counts))
    percent_total_counts_non_ercc = 100 - float(percent_total_counts_ercc)
  
  coverage.parse_sam(FILTERED_SAM_FILE)
  
  ercc_conc = load_ercc_conc(filter = counts.keys(), pool = ERCC_POOL_NBR)
  ercc_conc.sort()
  
  
  dr = dose_response(coverage,ercc_conc,counts,MINIMUM_COUNTS)
  trendline_points = generate_trendline_points(dr)
else:
  msg_to_user = "******"+BARCODE_ENTERED+", is not found.  This is most likely to result when the barcode is typed incorrectly, or the run was originally processed with a Torrent Suite version less than 3.4."
  data_to_display = False

if data_to_display:
  try:
    report_components = generate_reports(OUTPUT_DIR, coverage, dr, counts)
  except ValueError:
Exemplo n.º 3
0
        template_vars["start_site_complexity"] = results[1]["start_site_complexity"]
        template_vars["contig_cv"] = results[1]["contig_cv"]
        results_divs += result_div % template_vars
        plot_coverage(contig[1], starts[1], path=image_name)

    results_divs += "</div>"
    report_components["results_divs"] = results_divs
    report_components["updates"] = proc_update
    return report_components


if __name__ == "__main__":

    coverage = SamCoverage(GENOME)

    if len(sys.argv) == 2:
        coverage.parse_sam(sys.argv[1])
    else:
        coverage.parse_sam(TEST_SAM)

    threshold = 1
    counts = {}
    for ercc, count in coverage.count_iter():
        if count >= threshold:
            counts[ercc] = count

    ercc_conc = load_ercc_conc(filter=counts.keys())

    dr = dose_response(coverage, ercc_conc)
    generate_reports(coverage, dr)
Exemplo n.º 4
0
    template_vars['start_site_coverage_pct'] = results[1]['start_site_coverage_pct']
    template_vars['unique_start_sites'] = results[1]['unique_start_sites']
    template_vars['start_site_complexity'] = results[1]['start_site_complexity']
    template_vars['contig_cv'] = results[1]['contig_cv']
    results_divs += (result_div % template_vars)
    plot_coverage(contig[1], starts[1], path = image_name)

  results_divs += '</div>'
  report_components['results_divs'] = results_divs
  report_components['updates'] = proc_update
  return report_components

if __name__=='__main__':

  coverage = SamCoverage(GENOME)

  if len(sys.argv) == 2: coverage.parse_sam(sys.argv[1])
  else:                  coverage.parse_sam(TEST_SAM)

  threshold = 1
  counts = {}
  for ercc, count in coverage.count_iter():
    if count >= threshold:
      counts[ercc] = count

  ercc_conc = load_ercc_conc(filter = counts.keys())

  dr = dose_response(coverage, ercc_conc)
  generate_reports(coverage, dr)
  
Exemplo n.º 5
0
    template_vars['start_site_coverage_pct'] = results[1]['start_site_coverage_pct']
    template_vars['unique_start_sites'] = results[1]['unique_start_sites']
    template_vars['start_site_complexity'] = results[1]['start_site_complexity']
    template_vars['contig_cv'] = results[1]['contig_cv']
    results_divs += (result_div % template_vars)
    plot_coverage(contig[1], starts[1], path = outdir+image_name)

  results_divs += '</div>'
  report_components['results_divs'] = results_divs
  report_components['updates'] = proc_update
  return report_components

if __name__=='__main__':

  coverage = SamCoverage(GENOME)

  if len(sys.argv) == 2: coverage.parse_sam(sys.argv[1])
  else:                  coverage.parse_sam(TEST_SAM)

  threshold = 1
  counts = {}
  for ercc, count in coverage.count_iter():
    if count >= threshold:
      counts[ercc] = count

  ercc_conc = load_ercc_conc(filter = counts.keys())

  dr = dose_response(coverage, ercc_conc)
  generate_reports(coverage, dr)