VERBOSE=VERBOSE, qual_min=qual_min) continue if VERBOSE >= 1: print protein, samplename sample = SamplePat(sample) # NOTE: How do we find what fragment covers the protein? Well, a # protein can happily cross fragments. Since each # codon is independent, we should iterate over codons. We do not # do that for efficiency reasons. Instead, we identify all potential # fragments and split the protein into full codon chunks covered by # a single fragment. fragment_rois = sample.get_fragments_covered( protein, include_coordinates=True) refseq = sample.get_reference(protein) fn_out = sample.get_allele_counts_filename(protein, PCR=PCR, qual_min=qual_min, type='aa') from hivwholeseq.utils.sequence import alphaa count = np.zeros((len(alphaa), len(refseq) // 3), int) for frroi in fragment_rois: fragment = frroi['name'] start_fr, end_fr = frroi['fragment'] start, end = frroi['roi'] # Check that we align with codons
if submit: fork_self(samplename, protein, VERBOSE=VERBOSE, qual_min=qual_min) continue if VERBOSE >= 1: print protein, samplename sample = SamplePat(sample) # NOTE: How do we find what fragment covers the protein? Well, a # protein can happily cross fragments. Since each # codon is independent, we should iterate over codons. We do not # do that for efficiency reasons. Instead, we identify all potential # fragments and split the protein into full codon chunks covered by # a single fragment. fragment_rois = sample.get_fragments_covered(protein, include_coordinates=True) refseq = sample.get_reference(protein) fn_out = sample.get_allele_counts_filename(protein, PCR=PCR, qual_min=qual_min, type='aa') from hivwholeseq.utils.sequence import alphaa count = np.zeros((len(alphaa), len(refseq) // 3), int) for frroi in fragment_rois: fragment = frroi['name'] start_fr, end_fr = frroi['fragment'] start, end = frroi['roi'] # Check that we align with codons rf = start % 3