diff --git a/codes/chemo.py b/codes/chemo.py index 4cbc0ad..1283851 100755 --- a/codes/chemo.py +++ b/codes/chemo.py @@ -108,7 +108,14 @@ class ChemoRun: record = records[(chrom, end)] ref = record.ref alt = record.alts[0] - gt = '/'.join(list(map(str, sorted(record.samples.get(record.samples.keys()[0]).get('GT'))))) + # gt = '/'.join(list(map(str, sorted(record.samples.get(record.samples.keys()[0]).get('GT'))))) + freq = record.samples.get(record.samples.keys()[-1]).get('AF')[0] + if freq > 0.9: + gt = '1/1' + elif 0.9 >= freq > 0.1: + gt = '0/1' + else: + gt = '0/0' fliter = pd.concat([fliter, drug_rsid_data[ (drug_rsid_data['chr'] == chrom) & (drug_rsid_data['end'] == end) & diff --git a/codes/filter_snpindel.pl b/codes/filter_snpindel.pl index 445910f..7850d22 100755 --- a/codes/filter_snpindel.pl +++ b/codes/filter_snpindel.pl @@ -58,6 +58,10 @@ while () { my $filters = split(";", $line[101]); my $gene = (split(";", $line[6]))[0]; + if ($pipeline eq 'germline') { + $freq = (split(";", $line[-1]))[6]; + } + my @reason; # 黑名单 if (exists $blacklist{join("_", @line[0 .. 4])}) { diff --git a/codes/postprocess.py b/codes/postprocess.py index 1f0b5cc..78a9a5e 100755 --- a/codes/postprocess.py +++ b/codes/postprocess.py @@ -241,7 +241,6 @@ class PostProcess: tmb_df = tmb_df.set_index(key_cols) # 在filter_sum_df中的process列中追加字符串";tmb",对应tmb_df中的行 并且 是非 1,2类突变 - print(tmb_df.index) filter_sum_df['process'] = filter_sum_df.index.map( lambda x: filter_sum_df.at[x, 'process'] + ';tmb' if x in tmb_df.index and filter_sum_df.at[ x, 'AMP_mut_level'] not in ['I', 'II'] else filter_sum_df.at[x, 'process'])