Skip to content

Commit

Permalink
Merge pull request #9 from rbutleriii/the_phantom_variant
Browse files Browse the repository at this point in the history
The phantom variant
  • Loading branch information
Robert Butler authored May 30, 2019
2 parents bff7c92 + 28f3769 commit ab06d1b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion clinotator/getncbi.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ def batch_local(file_type, query_type, id_list, **kwargs):

for start in range(0, count, g.elink_batch):
end = min(count, start + g.elink_batch)
time.sleep(0.37)
logging.info("Looking up VIDs for rsIDs {} to {}"
.format(start + 1, end))
webenv1, query_key1 = post_ncbi(
Expand All @@ -130,6 +129,7 @@ def batch_local(file_type, query_type, id_list, **kwargs):
pass
continue
logging.debug('length result list: {}'.format(len(result_list)))
time.sleep(0.37)
return result_list

# getting xml variation files for query_results list,
Expand Down
2 changes: 1 addition & 1 deletion clinotator/global_vars.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
See main, eventually tests will be added for this module
'''

__version__ = "1.3.0"
__version__ = "1.3.1"


### getncbi.py global variables
Expand Down
6 changes: 4 additions & 2 deletions clinotator/vcf.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,14 @@ def vcf_prep(file_object, outprefix):
def cat_info_column(info, rsid, alt, out_tbl):
rsid_match = rsid.lstrip('rs')
alt_list = alt.split(",")
info_tbl = pd.DataFrame()
info_columns = ['VID', 'CVVT', 'CVAL', 'CVCS', 'CVSZ', 'CVNA', 'CVDS',
'CVLE', 'CTRS', 'CTAA', 'CTPS', 'CTRR']
logging.debug('rsid: {} alt_list: {}'.format(rsid_match, alt_list))
# logging.debug('out_tbl shape -> {}'.format(out_tbl.shape))
info_tbl = out_tbl.loc[(out_tbl['rsID'].astype('str') == rsid_match)
& out_tbl['CVAL'].isin(alt_list)].copy()
if rsid_match != ".":
info_tbl = out_tbl.loc[(out_tbl['rsID'].astype('str') == rsid_match)
& out_tbl['CVAL'].isin(alt_list)].copy()

if len(info_tbl.index) > 0:
info_tbl.replace({'CVCS': {',': '%2C', ';': '%3B'},
Expand Down
2 changes: 2 additions & 0 deletions test/test.vcf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
##FORMAT=<ID=DP,Number=1,Type=Integer,Description="Read Depth">
##FORMAT=<ID=HQ,Number=2,Type=Integer,Description="Haplotype Quality">
#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT NA00001 NA00002
1 216371836 rs111033524 C A 47 PASS NS=3;DP=13;AA=C GT:GQ:DP:HQ 0|0:54:7:56,60 1|0:48:4:51,51
7 140754187 rs180177040 A C,G 50 PASS NS=3;DP=11;AF=0.017 GT:GQ:DP:HQ 0|2:48:1:51,51 1|0:48:8:51,51
7 140754187 rs180177040 A C 50 PASS NS=3;DP=11;AF=0.017 GT:GQ:DP:HQ 0|0:48:1:51,51 1|0:48:8:51,51
7 140754187 rs180177040 A G 50 PASS NS=3;DP=11;AF=0.017 GT:GQ:DP:HQ 0|0:48:1:51,51 1|0:48:8:51,51
Expand All @@ -25,6 +26,7 @@
20 765535 rs34376836 C A 3 q10 NS=3;DP=11;AF=0.017 GT:GQ:DP:HQ 0|0:49:3:58,50 0|1:3:5:65,3
20 1110696 rs6040355 A G,T 67 PASS NS=2;DP=10;AF=0.333,0.667;AA=T;DB GT:GQ:DP:HQ 1|2:21:6:23,27 2|1:2:0:18,2
20 1230237 . T . 47 PASS NS=3;DP=13;AA=T GT:GQ:DP:HQ 0|0:54:7:56,60 0|0:48:4:51,51
20 1230237 . T A 47 PASS NS=3;DP=13;AA=T GT:GQ:DP:HQ 0|1:54:7:56,60 0|0:48:4:51,51
20 1980505 rs766877230 G A 50 PASS NS=3;DP=9;AA=G GT:GQ:DP 0/1:35:4 0/2:17:2
20 1980505 rs766877230 G T 50 PASS NS=3;DP=9;AA=G GT:GQ:DP 0/1:35:4 0/2:17:2
20 1980505 rs766877230 G A,T 50 PASS NS=3;DP=9;AA=G GT:GQ:DP 0/1:35:4 0/2:17:2
Expand Down

0 comments on commit ab06d1b

Please sign in to comment.