Skip to content

Commit

Permalink
moved ENS[GT] checks to parser function, also added set to remove dup…
Browse files Browse the repository at this point in the history
…licates
  • Loading branch information
talavis committed Feb 26, 2019
1 parent 777a1f2 commit 5d37674
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/importer/data_importer/raw_data_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,8 @@ def _insert_variants(self):
if not self.settings.beacon_only:
data['vep_annotations'] = vep_annotations

genes.append(list({annotation['Gene'] for annotation in vep_annotations if annotation['Gene'][:4] == 'ENSG'}))
transcripts.append(list({annotation['Feature'] for annotation in vep_annotations}))
genes.append(list(set({annotation['Gene'] for annotation in vep_annotations if annotation['Gene'][:4] == 'ENSG'})))
transcripts.append(list(set({annotation['Feature'] for annotation in vep_annotations if annotation['Feature'][:4] == 'ENST'})))

data['orig_alt_alleles'] = [
'{}-{}-{}-{}'.format(data['chrom'], *get_minimal_representation(base['pos'], base['ref'], x)) for x in alt_alleles
Expand Down Expand Up @@ -489,7 +489,7 @@ def add_variant_transcripts(self, variant_indexes:list, transcripts_to_add:list,
batch = []
for i in range(len(variant_indexes)):
connected_transcripts = [{'variant':variant_indexes[i], 'transcript':reftranscripts[transcript]}
for transcript in transcripts_to_add[i] if transcript and transcript[:4] == 'ENST']
for transcript in transcripts_to_add[i]]
batch += connected_transcripts
if not self.settings.dry_run:
db.VariantTranscripts.insert_many(batch).execute()

0 comments on commit 5d37674

Please sign in to comment.