Skip to content

Commit

Permalink
Merge 91fed50 into c5ab8db
Browse files Browse the repository at this point in the history
  • Loading branch information
MalinAhlberg committed May 22, 2019
2 parents c5ab8db + 91fed50 commit e58bb6b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions scripts/importer/data_importer/raw_data_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,12 @@ def _parse_manta(self):
if data['mate_chrom'].startswith('GL') or data['mate_chrom'].startswith('MT'):
continue
if 'MATEID' in info:
data['mate_id'] = info['MATEID']
data['mate_id'] = info.get('MATEID', '')
data['variant_id'] = '{}-{}-{}-{}'.format(data['chrom'], data['pos'], data['ref'], alt)
data['allele_count'] = data.get('allele_count', 0)
data['allele_num'] = data.get('allele_num', 0)

batch += [data]
if self.settings.count_calls:
self.get_callcount(data) # count calls (one per reference)
self.counter['beaconvariants'] += 1 # count variants (one per alternate)

counter += 1 # count variants (one per vcf row)

Expand Down Expand Up @@ -491,7 +490,7 @@ def start_import(self):
if self.settings.add_mates:
self._parse_manta()
if self.settings.count_calls:
self._create_beacon_counts()
logging.warning('Do not know how to count calls in the manta file. Skipping this...')
elif self.settings.variant_file:
self._insert_variants()
if self.settings.count_calls:
Expand Down
4 changes: 2 additions & 2 deletions sql/beacon_schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ CREATE OR REPLACE VIEW beacon.beacon_mate_table AS
d.short_name,
av.dataset_version) AS datasetId,
substr(dm.chrom, 1, 2) AS chromosome,
dm.pos - 1 AS "chromosomeStart",
dm.pos - 1 AS chromosomeStart,
dm.chrom_id as chromosomePos,
dm.mate_chrom as mate,
dm.mate_start as mateStart,
Expand All @@ -101,7 +101,7 @@ CREATE OR REPLACE VIEW beacon.beacon_mate_table AS
dm.allele_count as alleleCount,
dm.allele_num as callCount,
dm.allele_freq as frequency,
dm.mate_start as "end",
dm.mate_start - 1 as "end",
'BND' as variantType
FROM data.mate AS dm
JOIN beacon.available_datasets as av
Expand Down

0 comments on commit e58bb6b

Please sign in to comment.