Exemplo n.º 1
0
except:
    FASTQ_FILE_CREATED = 'N'
try:
    BARCODE_ENTERED = sys.argv[10]
except:
    BARCODE_ENTERED = 'none found'
try:
    ONLY_FWD_READS = (sys.argv[11] == 'Y')
except:
    ONLY_FWD_READS = False

data_to_display = True
msg_to_user = ""

if FASTQ_FILE_CREATED != 'N':
    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))
Exemplo n.º 2
0
  FASTQ_FILE_CREATED = 'N'
try:
  BARCODE_ENTERED = sys.argv[10]
except:
  BARCODE_ENTERED = 'none found'
try:
  ONLY_FWD_READS = (sys.argv[11] == 'Y')
except:
  ONLY_FWD_READS = False

  
data_to_display = True
msg_to_user = ""  
  
if FASTQ_FILE_CREATED != 'N':
  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)
Exemplo n.º 3
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)
Exemplo n.º 4
0
    template_vars['start_site_coverage'] = results[1]['start_site_coverage']
    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'] = results[1]['start_site_coverage']
    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)