varsim 1.0.4__py3-none-any.whl → 1.0.6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
varsim/__init__.py CHANGED
@@ -2,11 +2,29 @@ import os
2
2
 
3
3
  from Bio import Entrez, SeqIO
4
4
  from Bio.Data.CodonTable import standard_dna_table
5
- from Bio.Data.IUPACData import (unambiguous_dna_letters, protein_letters, protein_letters_1to3, protein_letters_3to1, )
5
+ from Bio.Data.IUPACData import (
6
+ unambiguous_dna_letters,
7
+ protein_letters,
8
+ protein_letters_1to3,
9
+ protein_letters_3to1,
10
+ )
6
11
  from Bio.Seq import Seq
7
12
  from Bio.SeqFeature import SimpleLocation
8
13
  from Bio.SeqUtils import seq3
9
14
 
15
+ __all__ = [
16
+ "frameshift_dup",
17
+ "frameshift_del",
18
+ "cds",
19
+ "inframe_dup",
20
+ "inframe_del",
21
+ "splicing",
22
+ "utr5",
23
+ "utr3",
24
+ "aa_sub",
25
+ "missense",
26
+ ]
27
+
10
28
  Entrez.email = os.environ["EMAIL"]
11
29
  Entrez.api_key = os.environ["API_KEY"]
12
30
  codons = standard_dna_table.forward_table.keys()
@@ -14,9 +32,14 @@ codons = standard_dna_table.forward_table.keys()
14
32
 
15
33
  def cds(gene: str) -> list:
16
34
  variants = []
17
- stream = Entrez.esearch(db="nucleotide", term=f'{gene}[Gene Name] "mane select"[Keyword]', )
35
+ stream = Entrez.esearch(
36
+ db="nucleotide",
37
+ term=f'{gene}[Gene Name] "mane select"[Keyword]',
38
+ )
18
39
  record = Entrez.read(stream)
19
- stream = Entrez.efetch(db="nucleotide", id=record["IdList"], rettype="gb", retmode="text")
40
+ stream = Entrez.efetch(
41
+ db="nucleotide", id=record["IdList"], rettype="gb", retmode="text"
42
+ )
20
43
  seqrecord = SeqIO.read(stream, "genbank")
21
44
  for feature in seqrecord.features:
22
45
  if feature.type == "CDS":
@@ -26,43 +49,72 @@ def cds(gene: str) -> list:
26
49
  for index, codon in enumerate(range(0, len(cds) - 3, 3)):
27
50
  for base in unambiguous_dna_letters:
28
51
  if base != cds[codon]:
29
- seq = Seq(base) + cds[codon + 1: codon + 3]
52
+ seq = Seq(base) + cds[codon + 1 : codon + 3]
30
53
  if protein[index] != seq.translate():
31
- variants.append((f"{seqrecord.id}:c.{codon + 1}{cds[codon]}>{base}",
32
- f"{protein_id}:p.{protein[index]}{index + 1}{seq.translate()}",
33
- f"{protein_id}:p.{seq3(protein[index])}{index + 1}{seq3(seq.translate())}",))
54
+ variants.append(
55
+ (
56
+ f"{seqrecord.id}:c.{codon + 1}{cds[codon]}>{base}",
57
+ f"{protein_id}:p.{protein[index]}{index + 1}{seq.translate()}",
58
+ f"{protein_id}:p.{seq3(protein[index])}{index + 1}{seq3(seq.translate())}",
59
+ )
60
+ )
34
61
  else:
35
- variants.append((f"{seqrecord.id}:c.{codon + 1}{cds[codon]}>{base}",
36
- f"{protein_id}:p.{protein[index]}{index + 1}=",
37
- f"{protein_id}:p.{seq3(protein[index])}{index + 1}=",))
62
+ variants.append(
63
+ (
64
+ f"{seqrecord.id}:c.{codon + 1}{cds[codon]}>{base}",
65
+ f"{protein_id}:p.{protein[index]}{index + 1}=",
66
+ f"{protein_id}:p.{seq3(protein[index])}{index + 1}=",
67
+ )
68
+ )
38
69
  if base != cds[codon + 1]:
39
70
  seq = cds[codon] + Seq(base) + cds[codon + 2]
40
71
  if protein[index] != seq.translate():
41
- variants.append((f"{seqrecord.id}:c.{codon + 2}{cds[codon + 1]}>{base}",
42
- f"{protein_id}:p.{protein[index]}{index + 1}{seq.translate()}",
43
- f"{protein_id}:p.{seq3(protein[index])}{index + 1}{seq3(seq.translate())}",))
72
+ variants.append(
73
+ (
74
+ f"{seqrecord.id}:c.{codon + 2}{cds[codon + 1]}>{base}",
75
+ f"{protein_id}:p.{protein[index]}{index + 1}{seq.translate()}",
76
+ f"{protein_id}:p.{seq3(protein[index])}{index + 1}{seq3(seq.translate())}",
77
+ )
78
+ )
44
79
  else:
45
- variants.append((f"{seqrecord.id}:c.{codon + 2}{cds[codon + 1]}>{base}",
46
- f"{protein_id}:p.{protein[index]}{index + 1}=",
47
- f"{protein_id}:p.{seq3(protein[index])}{index + 1}=",))
80
+ variants.append(
81
+ (
82
+ f"{seqrecord.id}:c.{codon + 2}{cds[codon + 1]}>{base}",
83
+ f"{protein_id}:p.{protein[index]}{index + 1}=",
84
+ f"{protein_id}:p.{seq3(protein[index])}{index + 1}=",
85
+ )
86
+ )
48
87
  if base != cds[codon + 2]:
49
- seq = cds[codon: codon + 2] + Seq(base)
88
+ seq = cds[codon : codon + 2] + Seq(base)
50
89
  if protein[index] != seq.translate():
51
- variants.append((f"{seqrecord.id}:c.{codon + 3}{cds[codon + 2]}>{base}",
52
- f"{protein_id}:p.{protein[index]}{index + 1}{seq.translate()}",
53
- f"{protein_id}:p.{seq3(protein[index])}{index + 1}{seq3(seq.translate())}",))
90
+ variants.append(
91
+ (
92
+ f"{seqrecord.id}:c.{codon + 3}{cds[codon + 2]}>{base}",
93
+ f"{protein_id}:p.{protein[index]}{index + 1}{seq.translate()}",
94
+ f"{protein_id}:p.{seq3(protein[index])}{index + 1}{seq3(seq.translate())}",
95
+ )
96
+ )
54
97
  else:
55
- variants.append((f"{seqrecord.id}:c.{codon + 3}{cds[codon + 2]}>{base}",
56
- f"{protein_id}:p.{protein[index]}{index + 1}=",
57
- f"{protein_id}:p.{seq3(protein[index])}{index + 1}=",))
98
+ variants.append(
99
+ (
100
+ f"{seqrecord.id}:c.{codon + 3}{cds[codon + 2]}>{base}",
101
+ f"{protein_id}:p.{protein[index]}{index + 1}=",
102
+ f"{protein_id}:p.{seq3(protein[index])}{index + 1}=",
103
+ )
104
+ )
58
105
  return variants
59
106
 
60
107
 
61
108
  def utr5(gene: str) -> list:
62
109
  variants = []
63
- stream = Entrez.esearch(db="nucleotide", term=f'{gene}[Gene Name] "mane select"[Keyword]', )
110
+ stream = Entrez.esearch(
111
+ db="nucleotide",
112
+ term=f'{gene}[Gene Name] "mane select"[Keyword]',
113
+ )
64
114
  record = Entrez.read(stream)
65
- stream = Entrez.efetch(db="nucleotide", id=record["IdList"], rettype="gb", retmode="text")
115
+ stream = Entrez.efetch(
116
+ db="nucleotide", id=record["IdList"], rettype="gb", retmode="text"
117
+ )
66
118
  seqrecord = SeqIO.read(stream, "genbank")
67
119
  for feature in seqrecord.features:
68
120
  if feature.type == "CDS":
@@ -70,33 +122,58 @@ def utr5(gene: str) -> list:
70
122
  for index in range(len(utr5)):
71
123
  for base in unambiguous_dna_letters:
72
124
  if base != utr5[index]:
73
- variants.append((f"{seqrecord.id}:c.{index - len(utr5)}{utr5[index]}>{base}", "", "",))
125
+ variants.append(
126
+ (
127
+ f"{seqrecord.id}:c.{index - len(utr5)}{utr5[index]}>{base}",
128
+ "",
129
+ "",
130
+ )
131
+ )
74
132
  return variants
75
133
 
76
134
 
77
135
  def utr3(gene: str) -> list:
78
136
  variants = []
79
- stream = Entrez.esearch(db="nucleotide", term=f'{gene}[Gene Name] "mane select"[Keyword]', )
137
+ stream = Entrez.esearch(
138
+ db="nucleotide",
139
+ term=f'{gene}[Gene Name] "mane select"[Keyword]',
140
+ )
80
141
  record = Entrez.read(stream)
81
- stream = Entrez.efetch(db="nucleotide", id=record["IdList"], rettype="gb", retmode="text")
142
+ stream = Entrez.efetch(
143
+ db="nucleotide", id=record["IdList"], rettype="gb", retmode="text"
144
+ )
82
145
  seqrecord = SeqIO.read(stream, "genbank")
83
146
  for feature in seqrecord.features:
84
147
  if feature.type == "CDS":
85
- utr3 = (SimpleLocation(feature.location.end, len(seqrecord)).extract(seqrecord).seq)
148
+ utr3 = (
149
+ SimpleLocation(feature.location.end, len(seqrecord))
150
+ .extract(seqrecord)
151
+ .seq
152
+ )
86
153
  for index in range(len(utr3)):
87
154
  for base in unambiguous_dna_letters:
88
155
  if base != utr3[index]:
89
- variants.append((f"{seqrecord.id}:c.*{index + 1}{utr3[index]}>{base}", "", "",))
156
+ variants.append(
157
+ (
158
+ f"{seqrecord.id}:c.*{index + 1}{utr3[index]}>{base}",
159
+ "",
160
+ "",
161
+ )
162
+ )
90
163
  return variants
91
164
 
92
165
 
93
166
  def splicing(gene: str) -> list:
94
167
  variants = []
95
168
  exon = []
96
- stream = Entrez.esearch(db="nucleotide", term=f'{gene}[Gene Name] "mane select"[Keyword]')
169
+ stream = Entrez.esearch(
170
+ db="nucleotide", term=f'{gene}[Gene Name] "mane select"[Keyword]'
171
+ )
97
172
  record = Entrez.read(stream)
98
173
 
99
- stream = Entrez.efetch(db="nucleotide", id=record["IdList"], rettype="gb", retmode="text")
174
+ stream = Entrez.efetch(
175
+ db="nucleotide", id=record["IdList"], rettype="gb", retmode="text"
176
+ )
100
177
  seqrecord = SeqIO.read(stream, "genbank")
101
178
  splicing = []
102
179
  variants = []
@@ -109,11 +186,20 @@ def splicing(gene: str) -> list:
109
186
  for feature in seqrecord.features:
110
187
  if feature.type == "exon":
111
188
  if feature.location.start < start and feature.location.end < start:
112
- splicing.extend((feature.location.start - start - 1, feature.location.end - start - 1,))
189
+ splicing.extend(
190
+ (
191
+ feature.location.start - start - 1,
192
+ feature.location.end - start - 1,
193
+ )
194
+ )
113
195
  elif feature.location.start < start and feature.location.end > start:
114
- splicing.extend((feature.location.start - start - 1, feature.location.end - start))
196
+ splicing.extend(
197
+ (feature.location.start - start - 1, feature.location.end - start)
198
+ )
115
199
  else:
116
- splicing.extend((feature.location.start - start, feature.location.end - start))
200
+ splicing.extend(
201
+ (feature.location.start - start, feature.location.end - start)
202
+ )
117
203
 
118
204
  for coordinate in range(1, len(splicing) - 1, 2):
119
205
  site = splicing[coordinate], splicing[coordinate] + 1
@@ -135,13 +221,19 @@ def aa_sub(gene: str) -> list:
135
221
  stream = Entrez.esearch(db="protein", term=term)
136
222
  record = Entrez.read(stream)
137
223
 
138
- stream = Entrez.efetch(db="protein", rettype="gp", retmode="text", id=record["IdList"])
224
+ stream = Entrez.efetch(
225
+ db="protein", rettype="gp", retmode="text", id=record["IdList"]
226
+ )
139
227
  seqrecord = SeqIO.read(stream, "genbank")
140
228
  for index, residue in enumerate(seqrecord.seq, 1):
141
229
  for aa in protein_letters:
142
230
  if aa != residue:
143
- variants.append((f"{seqrecord.id}:p.{residue}{index}{aa}",
144
- f"{seqrecord.id}:p.{protein_letters_1to3[residue]}{index}{protein_letters_1to3[aa]}",))
231
+ variants.append(
232
+ (
233
+ f"{seqrecord.id}:p.{residue}{index}{aa}",
234
+ f"{seqrecord.id}:p.{protein_letters_1to3[residue]}{index}{protein_letters_1to3[aa]}",
235
+ )
236
+ )
145
237
  return variants
146
238
 
147
239
 
@@ -150,7 +242,9 @@ def missense(gene: str) -> list:
150
242
  term = f'{gene}[Gene Name] "mane select"[keyword]'
151
243
  stream = Entrez.esearch(db="nucleotide", term=term)
152
244
  record = Entrez.read(stream)
153
- stream = Entrez.efetch(db="nucleotide", id=record["IdList"], rettype="gb", retmode="text")
245
+ stream = Entrez.efetch(
246
+ db="nucleotide", id=record["IdList"], rettype="gb", retmode="text"
247
+ )
154
248
  seqrecord = SeqIO.read(stream, "genbank")
155
249
  for feature in seqrecord.features:
156
250
  if feature.type == "CDS":
@@ -159,42 +253,98 @@ def missense(gene: str) -> list:
159
253
  cds = feature.location.extract(seqrecord).seq
160
254
  for index, codon in enumerate(range(0, len(cds) - 3, 3)):
161
255
  for base in codons:
162
- if base != cds[codon: codon + 3]:
256
+ if base != cds[codon : codon + 3]:
163
257
  seq = Seq(base)
164
258
  if protein[index] != seq.translate():
165
- if (base[0] == cds[codon] and base[1] == cds[codon + 1] and base[2] != cds[codon + 2]):
166
- variants.append((f"{seqrecord.id}:c.{codon + 3}{cds[codon + 2]}>{base[2]}",
167
- f"{protein_id}:p.{protein[index]}{index + 1}{seq.translate()}",
168
- f"{protein_id}:p.{seq3(protein[index])}{index + 1}{seq3(seq.translate())}",))
169
- elif (base[0] == cds[codon] and base[1] != cds[codon + 1] and base[2] == cds[codon + 2]):
170
- variants.append((f"{seqrecord.id}:c.{codon + 2}{cds[codon + 1]}>{base[1]}",
171
- f"{protein_id}:p.{protein[index]}{index + 1}{seq.translate()}",
172
- f"{protein_id}:p.{seq3(protein[index])}{index + 1}{seq3(seq.translate())}",))
173
- elif (base[0] != cds[codon] and base[1] == cds[codon + 1] and base[2] == cds[codon + 2]):
174
- variants.append((f"{seqrecord.id}:c.{codon + 1}{cds[codon]}>{base[0]}",
175
- f"{protein_id}:p.{protein[index]}{index + 1}{seq.translate()}",
176
- f"{protein_id}:p.{seq3(protein[index])}{index + 1}{seq3(seq.translate())}",))
259
+ if (
260
+ base[0] == cds[codon]
261
+ and base[1] == cds[codon + 1]
262
+ and base[2] != cds[codon + 2]
263
+ ):
264
+ variants.append(
265
+ (
266
+ f"{seqrecord.id}:c.{codon + 3}{cds[codon + 2]}>{base[2]}",
267
+ f"{protein_id}:p.{protein[index]}{index + 1}{seq.translate()}",
268
+ f"{protein_id}:p.{seq3(protein[index])}{index + 1}{seq3(seq.translate())}",
269
+ )
270
+ )
271
+ elif (
272
+ base[0] == cds[codon]
273
+ and base[1] != cds[codon + 1]
274
+ and base[2] == cds[codon + 2]
275
+ ):
276
+ variants.append(
277
+ (
278
+ f"{seqrecord.id}:c.{codon + 2}{cds[codon + 1]}>{base[1]}",
279
+ f"{protein_id}:p.{protein[index]}{index + 1}{seq.translate()}",
280
+ f"{protein_id}:p.{seq3(protein[index])}{index + 1}{seq3(seq.translate())}",
281
+ )
282
+ )
283
+ elif (
284
+ base[0] != cds[codon]
285
+ and base[1] == cds[codon + 1]
286
+ and base[2] == cds[codon + 2]
287
+ ):
288
+ variants.append(
289
+ (
290
+ f"{seqrecord.id}:c.{codon + 1}{cds[codon]}>{base[0]}",
291
+ f"{protein_id}:p.{protein[index]}{index + 1}{seq.translate()}",
292
+ f"{protein_id}:p.{seq3(protein[index])}{index + 1}{seq3(seq.translate())}",
293
+ )
294
+ )
177
295
  else:
178
- variants.append((f"{seqrecord.id}:c.{codon + 1}_{codon + 3}{cds[codon:codon + 3]}>{base}",
179
- f"{protein_id}:p.{protein[index]}{index + 1}{seq.translate()}",
180
- f"{protein_id}:p.{seq3(protein[index])}{index + 1}{seq3(seq.translate())}",))
296
+ variants.append(
297
+ (
298
+ f"{seqrecord.id}:c.{codon + 1}_{codon + 3}{cds[codon:codon + 3]}>{base}",
299
+ f"{protein_id}:p.{protein[index]}{index + 1}{seq.translate()}",
300
+ f"{protein_id}:p.{seq3(protein[index])}{index + 1}{seq3(seq.translate())}",
301
+ )
302
+ )
181
303
  else:
182
- if (base[0] == cds[codon] and base[1] == cds[codon + 1] and base[2] != cds[codon + 2]):
183
- variants.append((f"{seqrecord.id}:c.{codon + 3}{cds[codon + 2]}>{base[2]}",
184
- f"{protein_id}:p.{protein[index]}{index + 1}=",
185
- f"{protein_id}:p.{seq3(protein[index])}{index + 1}=",))
186
- elif (base[0] == cds[codon] and base[1] != cds[codon + 1] and base[2] == cds[codon + 2]):
187
- variants.append((f"{seqrecord.id}:c.{codon + 2}{cds[codon + 1]}>{base[1]}",
188
- f"{protein_id}:p.{protein[index]}{index + 1}=",
189
- f"{protein_id}:p.{seq3(protein[index])}{index + 1}=",))
190
- elif (base[0] != cds[codon] and base[1] == cds[codon + 1] and base[2] == cds[codon + 2]):
191
- variants.append((f"{seqrecord.id}:c.{codon + 1}{cds[codon]}>{base[0]}",
192
- f"{protein_id}:p.{protein[index]}{index + 1}=",
193
- f"{protein_id}:p.{seq3(protein[index])}{index + 1}=",))
304
+ if (
305
+ base[0] == cds[codon]
306
+ and base[1] == cds[codon + 1]
307
+ and base[2] != cds[codon + 2]
308
+ ):
309
+ variants.append(
310
+ (
311
+ f"{seqrecord.id}:c.{codon + 3}{cds[codon + 2]}>{base[2]}",
312
+ f"{protein_id}:p.{protein[index]}{index + 1}=",
313
+ f"{protein_id}:p.{seq3(protein[index])}{index + 1}=",
314
+ )
315
+ )
316
+ elif (
317
+ base[0] == cds[codon]
318
+ and base[1] != cds[codon + 1]
319
+ and base[2] == cds[codon + 2]
320
+ ):
321
+ variants.append(
322
+ (
323
+ f"{seqrecord.id}:c.{codon + 2}{cds[codon + 1]}>{base[1]}",
324
+ f"{protein_id}:p.{protein[index]}{index + 1}=",
325
+ f"{protein_id}:p.{seq3(protein[index])}{index + 1}=",
326
+ )
327
+ )
328
+ elif (
329
+ base[0] != cds[codon]
330
+ and base[1] == cds[codon + 1]
331
+ and base[2] == cds[codon + 2]
332
+ ):
333
+ variants.append(
334
+ (
335
+ f"{seqrecord.id}:c.{codon + 1}{cds[codon]}>{base[0]}",
336
+ f"{protein_id}:p.{protein[index]}{index + 1}=",
337
+ f"{protein_id}:p.{seq3(protein[index])}{index + 1}=",
338
+ )
339
+ )
194
340
  else:
195
- variants.append((f"{seqrecord.id}:c.{codon + 1}_{codon + 3}{cds[codon:codon + 3]}>{base}",
196
- f"{protein_id}:p.{protein[index]}{index + 1}=",
197
- f"{protein_id}:p.{seq3(protein[index])}{index + 1}=",))
341
+ variants.append(
342
+ (
343
+ f"{seqrecord.id}:c.{codon + 1}_{codon + 3}{cds[codon:codon + 3]}>{base}",
344
+ f"{protein_id}:p.{protein[index]}{index + 1}=",
345
+ f"{protein_id}:p.{seq3(protein[index])}{index + 1}=",
346
+ )
347
+ )
198
348
  return variants
199
349
 
200
350
 
@@ -203,7 +353,9 @@ def inframe_del(gene: str) -> list:
203
353
  term = f'{gene}[Gene Name] "mane select"[keyword]'
204
354
  stream = Entrez.esearch(db="nucleotide", term=term)
205
355
  record = Entrez.read(stream)
206
- stream = Entrez.efetch(db="nucleotide", id=record["IdList"], rettype="gb", retmode="text")
356
+ stream = Entrez.efetch(
357
+ db="nucleotide", id=record["IdList"], rettype="gb", retmode="text"
358
+ )
207
359
  seqrecord = SeqIO.read(stream, "genbank")
208
360
  for feature in seqrecord.features:
209
361
  if feature.type == "CDS":
@@ -211,9 +363,13 @@ def inframe_del(gene: str) -> list:
211
363
  protein_id = "".join(feature.qualifiers.get("protein_id"))
212
364
  cds = feature.location.extract(seqrecord).seq
213
365
  for index, codon in enumerate(range(0, len(cds) - 3, 3)):
214
- variants.append((f"{seqrecord.id}:c.{codon + 1}_{codon + 3}{cds[codon:codon + 3]}del",
215
- f"{protein_id}:p.{protein[index]}{index + 1}del",
216
- f"{protein_id}:p.{seq3(protein[index])}{index + 1}del",))
366
+ variants.append(
367
+ (
368
+ f"{seqrecord.id}:c.{codon + 1}_{codon + 3}{cds[codon:codon + 3]}del",
369
+ f"{protein_id}:p.{protein[index]}{index + 1}del",
370
+ f"{protein_id}:p.{seq3(protein[index])}{index + 1}del",
371
+ )
372
+ )
217
373
  return variants
218
374
 
219
375
 
@@ -222,7 +378,9 @@ def inframe_dup(gene: str) -> list:
222
378
  term = f'{gene}[Gene Name] "mane select"[keyword]'
223
379
  stream = Entrez.esearch(db="nucleotide", term=term)
224
380
  record = Entrez.read(stream)
225
- stream = Entrez.efetch(db="nucleotide", id=record["IdList"], rettype="gb", retmode="text")
381
+ stream = Entrez.efetch(
382
+ db="nucleotide", id=record["IdList"], rettype="gb", retmode="text"
383
+ )
226
384
  seqrecord = SeqIO.read(stream, "genbank")
227
385
  for feature in seqrecord.features:
228
386
  if feature.type == "CDS":
@@ -230,9 +388,13 @@ def inframe_dup(gene: str) -> list:
230
388
  protein_id = "".join(feature.qualifiers.get("protein_id"))
231
389
  cds = feature.location.extract(seqrecord).seq
232
390
  for index, codon in enumerate(range(0, len(cds) - 3, 3)):
233
- variants.append((f"{seqrecord.id}:c.{codon + 1}_{codon + 3}{cds[codon:codon + 3]}dup",
234
- f"{protein_id}:p.{protein[index]}{index + 1}dup",
235
- f"{protein_id}:p.{seq3(protein[index])}{index + 1}dup",))
391
+ variants.append(
392
+ (
393
+ f"{seqrecord.id}:c.{codon + 1}_{codon + 3}{cds[codon:codon + 3]}dup",
394
+ f"{protein_id}:p.{protein[index]}{index + 1}dup",
395
+ f"{protein_id}:p.{seq3(protein[index])}{index + 1}dup",
396
+ )
397
+ )
236
398
  return variants
237
399
 
238
400
 
@@ -241,7 +403,9 @@ def frameshift_dup(gene: str) -> list:
241
403
  term = f'{gene}[Gene Name] "mane select"[keyword]'
242
404
  stream = Entrez.esearch(db="nucleotide", term=term)
243
405
  record = Entrez.read(stream)
244
- stream = Entrez.efetch(db="nucleotide", id=record["IdList"], rettype="gb", retmode="text")
406
+ stream = Entrez.efetch(
407
+ db="nucleotide", id=record["IdList"], rettype="gb", retmode="text"
408
+ )
245
409
  seqrecord = SeqIO.read(stream, "genbank")
246
410
  for feature in seqrecord.features:
247
411
  if feature.type == "CDS":
@@ -256,7 +420,9 @@ def frameshift_del(gene: str) -> list:
256
420
  term = f'{gene}[Gene Name] "mane select"[keyword]'
257
421
  stream = Entrez.esearch(db="nucleotide", term=term)
258
422
  record = Entrez.read(stream)
259
- stream = Entrez.efetch(db="nucleotide", id=record["IdList"], rettype="gb", retmode="text")
423
+ stream = Entrez.efetch(
424
+ db="nucleotide", id=record["IdList"], rettype="gb", retmode="text"
425
+ )
260
426
  seqrecord = SeqIO.read(stream, "genbank")
261
427
  for feature in seqrecord.features:
262
428
  if feature.type == "CDS":
@@ -264,7 +430,3 @@ def frameshift_del(gene: str) -> list:
264
430
  for index, base in enumerate(cds, start=1):
265
431
  variants.append((f"{seqrecord.id}:c.{str(index) + base}del",))
266
432
  return variants
267
-
268
-
269
- if __name__ == "__main__":
270
- print(frameshift_del("INS"))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: varsim
3
- Version: 1.0.4
3
+ Version: 1.0.6
4
4
  Summary: Variant Simulator
5
5
  Author-email: Liu Sun <sunliu@yxnu.edu.cn>, Jian Yang <yangjian@yxnu.edu.cn>
6
6
  Project-URL: Homepage, https://github.com/liu-sun/VarSim
@@ -0,0 +1,6 @@
1
+ varsim/__init__.py,sha256=ZIHKGBIp-8_seM6suoUCe2A8OgOL0gR8Oocu-IpCe_k,17712
2
+ varsim-1.0.6.dist-info/licenses/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
3
+ varsim-1.0.6.dist-info/METADATA,sha256=p205IC4VbHE2OXj7KexqchrFKTp0Ema67c37s4O3rFs,2464
4
+ varsim-1.0.6.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
5
+ varsim-1.0.6.dist-info/top_level.txt,sha256=2fLprhnBvkF-7VEOzGcpKoodqW08HjyNbVzM6emJrTI,7
6
+ varsim-1.0.6.dist-info/RECORD,,
@@ -1,6 +0,0 @@
1
- varsim/__init__.py,sha256=pZL4Wz3LJBoYvBdbNXByTx6qtCSkHqzBbR2dBWl7E60,14702
2
- varsim-1.0.4.dist-info/licenses/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
3
- varsim-1.0.4.dist-info/METADATA,sha256=4W43kr56JnS5Jpw-U6E_wDEpepZYSYnojsdV_YgI-1M,2464
4
- varsim-1.0.4.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
5
- varsim-1.0.4.dist-info/top_level.txt,sha256=2fLprhnBvkF-7VEOzGcpKoodqW08HjyNbVzM6emJrTI,7
6
- varsim-1.0.4.dist-info/RECORD,,
File without changes