diff --git a/.DS_Store b/.DS_Store index 06d317f..e3d7e80 100755 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/SCRIPTS/gwas2cojo.py b/SCRIPTS/gwas2cojo.py index 77bb6b5..a2e7e1b 100755 --- a/SCRIPTS/gwas2cojo.py +++ b/SCRIPTS/gwas2cojo.py @@ -399,7 +399,8 @@ def select(name, options, fail=True): wrong_column_count += 1 continue if postype_combined: - ch, bp, *_ = parts[hpos].split(':', 2) # Some append :/:, just ignore +# ch, bp, *_ = parts[hpos].split(':', 2) # Some append :/:, just ignore + ch, bp = parts[hpos].split(':', 2) # Some append :/:, just ignore if default_chr: print('Default chromosome specified but reading chr:bp column.') exit(1) @@ -517,13 +518,13 @@ def select(name, options, can_fail=False): with fopen(stats_filename) as f: lineno = 0 for line in f: - if line.startswith('#'): + if line.startswith('##'): # discard comments continue lineno += 1 if lineno == 1: header = line.split() - hrsid = select('ident', ['rsid', 'snp', 'variantid']) + hrsid = select('ident', ['rsid', 'SNP', 'variantid']) hch = select('chr', ['chr', 'chromosome']) hbp = select('bp', ['bp', 'position', 'pos']) heff = select('effect', []) @@ -619,7 +620,7 @@ def select(name, options, can_fail=False): continue rsids_seen.add(rsid) if output: - print(rsid, parts[heff], parts[hoth], freq, beta, + print(parts[hrsid], parts[heff], parts[hoth], freq, beta, gwas_row.se, gwas_row.p, gwas_row.n, file=output) if lineno % 100000 == 0: message = '#{0}+{1}'.format(converted,discarded)