質問編集履歴
2
言語へ移動
test
CHANGED
File without changes
|
test
CHANGED
@@ -24,6 +24,92 @@
|
|
24
24
|
|
25
25
|
python
|
26
26
|
|
27
|
+
|
28
|
+
|
29
|
+
S = SeqIO.read("vv.fasta", "fasta")
|
30
|
+
|
31
|
+
S_S = S[20000:22000]
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
def yield_S_t():
|
36
|
+
|
37
|
+
for var in S_S:
|
38
|
+
|
39
|
+
var.seq = S_S.seq.translate()
|
40
|
+
|
41
|
+
var.id = S_S.id
|
42
|
+
|
43
|
+
var.description = S_S.description
|
44
|
+
|
45
|
+
yield var
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
S_t = yield_S_t()
|
50
|
+
|
51
|
+
S_tt = S_t[10:1000]
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
def generation():
|
58
|
+
|
59
|
+
with open('bb.fasta') as file:
|
60
|
+
|
61
|
+
for list_record in list(SeqIO.parse(file, "fasta")):
|
62
|
+
|
63
|
+
list_record.seq = list_record.seq[20000:22000]
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
list_record.seq.translate()
|
68
|
+
|
69
|
+
list_record.id = list_record.id
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
yield list_record
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
g_t = generation()
|
78
|
+
|
79
|
+
g_tt = g_t[10:1000]
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
seq1 = S_tt
|
84
|
+
|
85
|
+
seq2 = g_tt
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
All_Seq = [seq1, seq2]
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
SeqIO.write(seq1,"EE.fasta", "fasta")
|
94
|
+
|
95
|
+
SeqIO.write(seq2, "FF.fasta", "fasta")
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
SeqIO.write(All_Seq,"GG.fasta","fasta")
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
EE.fasta.close()
|
106
|
+
|
107
|
+
FF.fasta.close()
|
108
|
+
|
109
|
+
GG.fasta.close()
|
110
|
+
|
111
|
+
|
112
|
+
|
27
113
|
```
|
28
114
|
|
29
115
|
コード
|
1
インデント挿入。生成する場所を指定しているか(初心者でわかりません)
test
CHANGED
File without changes
|
test
CHANGED
@@ -13,6 +13,20 @@
|
|
13
13
|
よろしくお願いいたします。
|
14
14
|
|
15
15
|
|
16
|
+
|
17
|
+
補足:初心者で、どこに生成するとか指定がわかりません。
|
18
|
+
|
19
|
+
インデントは、入力段階で入力してますが、質問欄で反映されてると良いのですが。
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
``````ここに言語を入力
|
24
|
+
|
25
|
+
python
|
26
|
+
|
27
|
+
```
|
28
|
+
|
29
|
+
コード
|
16
30
|
|
17
31
|
|
18
32
|
|
@@ -30,7 +44,7 @@
|
|
30
44
|
|
31
45
|
def yield_S_t():
|
32
46
|
|
33
|
-
|
47
|
+
for var in S_S:
|
34
48
|
|
35
49
|
var.seq = S_S.seq.translate()
|
36
50
|
|