Mercurial > repos > mheinzl > variant_analyzer2
comparison mut2read.py @ 75:6ccff403db8a draft
planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
| author | mheinzl |
|---|---|
| date | Tue, 23 Mar 2021 15:18:17 +0000 |
| parents | d21960b45a6b |
| children | fdfe9a919ff7 |
comparison
equal
deleted
inserted
replaced
| 74:5023186c2061 | 75:6ccff403db8a |
|---|---|
| 70 cvrg_dict = {} | 70 cvrg_dict = {} |
| 71 | 71 |
| 72 for variant in VCF(file1): | 72 for variant in VCF(file1): |
| 73 chrom = variant.CHROM | 73 chrom = variant.CHROM |
| 74 stop_pos = variant.start | 74 stop_pos = variant.start |
| 75 #chrom_stop_pos = str(chrom) + "#" + str(stop_pos) | |
| 76 ref = variant.REF | 75 ref = variant.REF |
| 77 if len(variant.ALT) == 0: | 76 if len(variant.ALT) == 0: |
| 78 continue | 77 continue |
| 79 else: | 78 else: |
| 80 alt = variant.ALT[0] | 79 alt = variant.ALT[0] |
| 81 print(alt) | |
| 82 chrom_stop_pos = str(chrom) + "#" + str(stop_pos) + "#" + ref + "#" + alt | 80 chrom_stop_pos = str(chrom) + "#" + str(stop_pos) + "#" + ref + "#" + alt |
| 83 | |
| 84 | |
| 85 dcs_len = [] | 81 dcs_len = [] |
| 86 if len(ref) == len(alt): | 82 if len(ref) == len(alt): |
| 87 for pileupcolumn in bam.pileup(chrom, stop_pos - 1, stop_pos + 1, max_depth=100000000): | 83 for pileupcolumn in bam.pileup(chrom, stop_pos - 1, stop_pos + 1, max_depth=100000000): |
| 88 if pileupcolumn.reference_pos == stop_pos: | 84 if pileupcolumn.reference_pos == stop_pos: |
| 89 count_alt = 0 | 85 count_alt = 0 |
| 150 out.write(curr_qual + "\n") | 146 out.write(curr_qual + "\n") |
| 151 | 147 |
| 152 | 148 |
| 153 if __name__ == '__main__': | 149 if __name__ == '__main__': |
| 154 sys.exit(mut2read(sys.argv)) | 150 sys.exit(mut2read(sys.argv)) |
| 155 |
