Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
baptiste
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kai Karius
baptiste
Commits
cc705b35
Commit
cc705b35
authored
Aug 31, 2020
by
Kai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
h
parent
c2485eb7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
baptiste.py
baptiste.py
+24
-0
No files found.
baptiste.py
View file @
cc705b35
...
...
@@ -4,12 +4,31 @@ import csv
from
Bio.Seq
import
Seq
from
Bio.Alphabet
import
generic_dna
import
sys
from
collections
import
Counter
def
cond
(
hyb
,
start
,
stop
):
s
=
hyb
[:
180
]
i
=
ind
(
s
,
stop
)
if
i
>=
0
:
sub_s
=
s
[
i
:]
j
=
ind
(
sub_s
,
start
)
if
j
<
0
:
return
False
elif
180
-
j
<
30
:
return
False
elif
180
-
j
>=
30
:
return
True
return
False
if
__name__
==
"__main__"
:
reader
=
csv
.
reader
(
open
(
"./Pseudomonas_aeruginosa_UCBPP-PA14_109.csv"
,
"r"
))
web_gene
=
list
(
open
(
"./Pseudomonas_aeruginosa_UCBPP-PA14_109.fna"
,
"r"
))[
1
:]
web_gene
=
""
.
join
([
e
.
strip
()
for
e
in
web_gene
])
data
=
list
(
reader
)
web_ba_seqs
=
list
()
hybrids
=
list
()
for
e
in
data
[
3
:]:
if
len
(
e
)
>=
5
:
_from
=
int
(
e
[
3
])
-
1
...
...
@@ -18,4 +37,9 @@ if __name__ == "__main__":
_ba
=
e
[
-
2
]
_aa
=
e
[
-
1
]
seq
=
Seq
(
_ba
,
generic_dna
)
web_ba_seqs
.
append
(
seq
)
hybrid
=
Seq
(
web_gene
[
_from
-
180
:
_to
],
generic_dna
)
hybrids
.
append
(
hybrid
)
start_codons
=
Counter
([
seq
[:
3
]
for
seq
in
web_ba_seqs
])
stop_codons
=
Counter
([
seq
[
-
3
:]
for
seq
in
web_ba_seqs
])
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment