diff --git a/examples/gtc_final_report.py b/examples/gtc_final_report.py index dd4174f..0ad94d0 100644 --- a/examples/gtc_final_report.py +++ b/examples/gtc_final_report.py @@ -39,7 +39,7 @@ output_handle.write(delim.join(["Total Samples", str(len(samples))]) + "\n") output_handle.write("[Data]\n") - output_handle.write(delim.join(["SNP Name", "Sample ID", "Chr", "MapInfo", "Alleles - AB", "Alleles - Plus", "Alleles - Forward"]) + "\n") + output_handle.write(delim.join(["SNP Name", "Sample ID", "Chr", "MapInfo", "Alleles - AB", "Alleles - Plus", "Alleles - Forward", "X", "Y"]) + "\n") for gtc_file in samples: sys.stderr.write("Processing " + gtc_file + "\n") gtc_file = os.path.join(args.gtc_directory, gtc_file) @@ -47,7 +47,8 @@ genotypes = gtc.get_genotypes() plus_strand_genotypes = gtc.get_base_calls_plus_strand(manifest.snps, manifest.ref_strands) forward_strand_genotypes = gtc.get_base_calls_forward_strand(manifest.snps, manifest.source_strands) + normalized_intensities = gtc.get_normalized_intensities(manifest.normalization_lookups) assert len(genotypes) == len(manifest.names) - for (name, chrom, map_info, genotype, ref_strand_genotype, source_strand_genotype) in zip(manifest.names, manifest.chroms, manifest.map_infos, genotypes, plus_strand_genotypes, forward_strand_genotypes): - output_handle.write(delim.join([name, os.path.basename(gtc_file)[:-4], chrom, str(map_info), code2genotype[genotype], ref_strand_genotype, source_strand_genotype]) + "\n") + for (name, chrom, map_info, genotype, ref_strand_genotype, source_strand_genotype, (x_norm, y_norm)) in zip(manifest.names, manifest.chroms, manifest.map_infos, genotypes, plus_strand_genotypes, forward_strand_genotypes, normalized_intensities): + output_handle.write(delim.join([name, os.path.basename(gtc_file)[:-4], chrom, str(map_info), code2genotype[genotype], ref_strand_genotype, source_strand_genotype, str(x_norm), str(y_norm)]) + "\n") diff --git a/module/BeadPoolManifest.py b/module/BeadPoolManifest.py index dbf6bba..3e61413 100644 --- a/module/BeadPoolManifest.py +++ b/module/BeadPoolManifest.py @@ -118,6 +118,8 @@ def __parse_file(self, manifest_file): for locus_idx in xrange(self.num_loci): self.normalization_ids[locus_idx] += 100 * \ self.assay_types[locus_idx] + # To mimic the byte-wrapping behavior from GenomeStudio, AutoCall, IAAP take the mod of 256 + self.normalization_ids[locus_idx] %= 256 all_norm_ids.add(self.normalization_ids[locus_idx]) sorted_norm_ids = sorted(all_norm_ids) lookup_dictionary = {}