Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Tsinghua-A
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
2023 Competition
Software Tools
Tsinghua-A
Commits
7a7d5a9d
Commit
7a7d5a9d
authored
1 year ago
by
Ziqian
Browse files
Options
Downloads
Patches
Plain Diff
input and name_screen
parent
a8f06914
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
input_seq.txt
+4
-0
4 additions, 0 deletions
input_seq.txt
name_screen.py
+67
-0
67 additions, 0 deletions
name_screen.py
with
71 additions
and
0 deletions
input_seq.txt
0 → 100644
+
4
−
0
View file @
7a7d5a9d
EVMLVESGGGLVMPGGSLKLSCAASAMSWVRQIPEKRLEWVATITYFPDSVKGRFTISRDNAKNTLYLRMSSLRSEDTAMYYCVRWGQGTTLTVSS
GFTFSNY
SIGGHF
HEGYGRPYFDY
\ No newline at end of file
This diff is collapsed.
Click to expand it.
name_screen.py
0 → 100644
+
67
−
0
View file @
7a7d5a9d
import
pandas
as
pd
import
sys
sys
.
path
.
append
(
'
.
'
)
def
screen
(
specie_txt
):
with
open
(
specie_txt
,
"
r
"
)
as
f
:
tar_specie
=
f
.
read
()
csv_file
=
"
./heavy_safe85.csv
"
csv_data
=
pd
.
read_csv
(
csv_file
,
low_memory
=
False
)
csv_df
=
pd
.
DataFrame
(
csv_data
)
# 筛选物种
df1
=
csv_df
[
csv_df
[
"
species
"
].
map
(
lambda
x
:
x
==
tar_specie
)]
startnum
=
df1
[
"
Startnum
"
].
tolist
()
specie
=
df1
[
"
species
"
].
tolist
()
# 获取物种对应FR区片段 list中每个FR序列是str
seq_ori
=
(
df1
[
'
myFR1
'
]
+
df1
[
'
myFR2
'
]
+
df1
[
'
myFR3
'
]
+
df1
[
'
myFR4
'
]).
tolist
()
seq
=
[]
# 先补齐FR1的第一个氨基酸
for
i
in
range
(
len
(
seq_ori
)):
aa
=
seq_ori
[
i
]
if
startnum
[
i
]
==
'
H2
'
:
aa
=
'
#
'
+
seq_ori
[
i
]
seq
.
append
(
aa
)
# 创建新dataframe,每列对应一个氨基酸
df
=
pd
.
DataFrame
()
j
=
0
for
i
in
range
(
25
):
a_1
=
[
aa
[
j
]
for
aa
in
seq
]
j
=
j
+
1
df
[
f
'
X_
{
i
+
1
}
'
]
=
a_1
for
i
in
range
(
32
,
51
):
a_1
=
[
aa
[
j
]
for
aa
in
seq
]
j
=
j
+
1
df
[
f
'
X_
{
i
+
1
}
'
]
=
a_1
for
i
in
range
(
56
,
82
):
a_1
=
[
aa
[
j
]
for
aa
in
seq
]
j
=
j
+
1
df
[
f
'
X_
{
i
+
1
}
'
]
=
a_1
a_1
=
[
aa
[
j
]
for
aa
in
seq
]
df
[
f
'
X_82A
'
]
=
a_1
j
=
j
+
1
a_1
=
[
aa
[
j
]
for
aa
in
seq
]
df
[
f
'
X_82B
'
]
=
a_1
j
=
j
+
1
a_1
=
[
aa
[
j
]
for
aa
in
seq
]
df
[
f
'
X_82C
'
]
=
a_1
j
=
j
+
1
for
i
in
range
(
82
,
94
):
a_1
=
[
aa
[
j
]
for
aa
in
seq
]
j
=
j
+
1
df
[
f
'
X_
{
i
+
1
}
'
]
=
a_1
for
i
in
range
(
102
,
113
):
a_1
=
[
aa
[
j
]
for
aa
in
seq
]
j
=
j
+
1
df
[
f
'
X_
{
i
+
1
}
'
]
=
a_1
df
[
'
specie
'
]
=
specie
outputpath
=
specie
[
0
]
+
'
.csv
'
df
.
to_csv
(
outputpath
,
sep
=
'
,
'
,
index
=
False
,
header
=
True
)
if
__name__
==
"
__main__
"
:
specie_txt
=
'
./specie_target.txt
'
screen
(
specie_txt
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment