Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Louis BECQUEY
/
RNANet
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Louis BECQUEY
2021-07-15 14:57:31 +0200
1
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
2259ea138d29ad8bb1f29e9013bf348341022a96
2259ea13
2 parents
1f779e7a
0f277add
Merge branch 'stage_aglae'
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
10 deletions
RNAnet.py
statistics.py
RNAnet.py
View file @
2259ea1
...
...
@@ -159,14 +159,14 @@ class SelectivePortionSelector(object):
_select
=
Select
()
def
save_mmcif
(
ioobj
,
out_file
,
select
=
_select
,
preserve_atom_numbering
=
False
):
# reuse and modification of the source code of Biopython
# to have the 2 columns of numbering of residues numbered with the index_chain of DSSR
if
isinstance
(
out_file
,
str
):
fp
=
open
(
out_file
,
"w"
)
close_file
=
True
else
:
fp
=
out_file
close_file
=
False
#fp = open(out_file, "w")
#close_file=True
atom_dict
=
defaultdict
(
list
)
for
model
in
ioobj
.
structure
.
get_list
():
...
...
@@ -188,7 +188,7 @@ def save_mmcif(ioobj, out_file, select=_select, preserve_atom_numbering=False):
chain_id
=
chain
.
get_id
()
if
chain_id
==
" "
:
chain_id
=
"."
# This is used to write label_seq_id
and increments from 1
,
# This is used to write label_seq_id,
# remaining blank for hetero residues
prev_residue_type
=
""
...
...
@@ -403,7 +403,8 @@ class Chain:
index_chain
=
nums
.
at
[
i
,
"index_chain"
]
nt
=
nums
.
at
[
i
,
"nt_name"
]
if
nt
==
'A'
or
nt
==
'G'
or
nt
==
'C'
or
nt
==
'U'
or
nt
in
[
'DG'
,
'DU'
,
'DC'
,
'DA'
,
'DI'
,
'DT'
]
or
nt
==
'N'
or
nt
==
'I'
:
# particular case 6n5s_1_A, residue 201 in the original cif file (resname = G and HETATM = H_G)
if
nt
==
'A'
or
(
nt
==
'G'
and
(
self
.
chain_label
!=
'6n5s_1_A'
or
resseq
!=
201
))
or
nt
==
'C'
or
nt
==
'U'
or
nt
in
[
'DG'
,
'DU'
,
'DC'
,
'DA'
,
'DI'
,
'DT'
]
or
nt
==
'N'
or
nt
==
'I'
:
res
=
chain
[(
' '
,
resseq
,
icode_res
)]
else
:
#modified nucleotides (e.g. chain 5l4o_1_A)
het
=
'H_'
+
nt
...
...
@@ -421,7 +422,15 @@ class Chain:
res_atoms
=
res
.
get_atoms
()
new_residu_t
=
pdb
.
Residue
.
Residue
(
res_id
,
res_name
,
res
.
get_segid
())
for
atom
in
list
(
res
.
get_atoms
()):
if
atom
.
get_name
()
in
[
'PA'
,
'O1A'
,
'O2A'
,
'O3A'
]:
# rename the remaining phosphate group to P, OP1, OP2, OP3
if
atom
.
get_name
()
in
[
'PA'
,
'O1A'
,
'O2A'
,
'O3A'
]
and
res_name
!=
'RIA'
:
# RIA is a residue made up of 2 riboses and 2 phosphates,
# so it has an O2A atom between the C2A and C1 'atoms,
# and it also has an OP2 atom attached to one of its phosphates
# (see chains 6fyx_1_1, 6zu9_1_1, 6fyy_1_1, 6gsm_1_1 , 3jaq_1_1 and 1yfg_1_A)
# we do not modify the atom names of RIA residue
if
atom
.
get_name
()
==
'PA'
:
atom_name
=
'P'
if
atom
.
get_name
()
==
'O1A'
:
...
...
@@ -1511,11 +1520,7 @@ class Pipeline:
if
self
.
HOMOLOGY
and
not
os
.
path
.
isdir
(
path_to_3D_data
+
"rna_mapped_to_Rfam"
):
# for the portions mapped to Rfam
os
.
makedirs
(
path_to_3D_data
+
"rna_mapped_to_Rfam"
)
'''
if (not self.HOMOLOGY) and not os.path.isdir(path_to_3D_data + "rna_only"):
# extract chains of pure RNA
os.makedirs(path_to_3D_data + "rna_only")
'''
if
(
not
self
.
HOMOLOGY
)
and
not
os
.
path
.
isdir
(
path_to_3D_data
+
"rna_only"
):
# extract chains of pure RNA
os
.
makedirs
(
path_to_3D_data
+
"rna_only"
)
...
...
statistics.py
View file @
2259ea1
This diff is collapsed. Click to expand it.
Louis BECQUEY
@lbecquey
2021-08-16 15:07:17 UTC
mentioned in commit
e4282475
Please
register
or
login
to post a comment