我是python的初学者,目前正在执行一段代码,但它会引发以下错误。我尽力解决但无法解决。请帮我。代码如下。
continue
num_snps_skipped += 1
samp_id = sline[id_index]
ref_allele = sline[ref_allele_index]
tum_allele = sline[tum_allele_index]
snp = ref_allele + tum_allele
if not snp in transitions:
snp = nucleotide_complement[ref_allele] + nucleotide_complement[tum_allele]
ref_trinuc = sline[ref_tri_index]
if ref_trinuc == "NA":
print "Warning: Reference allele not available on "+\
"line %d; skipping line"%line_number
continue
if not ref_trinuc[1] == snp[0]:
print "Warning: Reference allele does not match reference "+\
"trinucleotide; skipping line %d"%line_number**
continue
snp_with_ctx = ref_trinuc[0] + snp + ref_trinuc[2]
if not samp_id in signatures:
signatures[samp_id] = [0 for i in substitution_order]
if snp_with_ctx not in substitution_order:
print "Warning: substitution on line " + \
"%d is %s, not "%(line_number,snp_with_ctx) + \
"found among possible substitutions. Skipping line."
我收到如下错误
Traceback (most recent call last):
File "main.py", line 59, in <module>
signatures = signature.make(args.in_file, substitution_order=stratton['substitution_order'], out_path = args.spectrum_output)
File "/home/ateeqanees/Mutation/centos/mutation-signatures-master/signature.py", line 73, in make
if not ref_trinuc[1] == snp[0]:
IndexError: string index out of range
请帮我。这会有很大帮助。
非常感谢 !!!达夫