Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
pdbparser
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
8
Issues
8
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
NOEL Philippe
pdbparser
Commits
3d86a8d9
Commit
3d86a8d9
authored
Apr 17, 2019
by
Emmanuel Bresso
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove H
parent
a13767d7
Pipeline
#74479
passed with stages
in 54 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
1 deletion
+38
-1
src/pdb/protein.rs
src/pdb/protein.rs
+38
-1
No files found.
src/pdb/protein.rs
View file @
3d86a8d9
...
@@ -297,7 +297,7 @@ impl<'a> Protein {
...
@@ -297,7 +297,7 @@ impl<'a> Protein {
Some
(
x
)
=>
x
,
Some
(
x
)
=>
x
,
None
=>
{
None
=>
{
println!
(
"Can't parse the protein with these attributes"
);
println!
(
"Can't parse the protein with these attributes"
);
return
None
;
return
None
;
let
mut
n_prot
=
Protein
::
new
(
self
.name
.clone
());
}
}
};
};
for
chain
in
&
self
.lst_chain
{
for
chain
in
&
self
.lst_chain
{
...
@@ -351,4 +351,41 @@ impl<'a> Protein {
...
@@ -351,4 +351,41 @@ impl<'a> Protein {
}
}
}
}
}
}
/// Used to remove Hydrogens in the proteins
///
///
/// # Examples
/// ```
/// use pdbparser;
///
/// let my_prot = pdbparser::parse_pdb("tests/tests_file/f2.pdb", "f2");
/// let ss_h = my_prot.remove_h().unwrap();
/// assert_eq!(541, ss_h.get_number_atom());
/// ```
pub
fn
remove_h
(
&
self
)
->
Option
<
Protein
>
{
let
mut
new_prot
=
Protein
::
new
(
self
.name
.clone
());
for
chain
in
&
self
.lst_chain
{
let
c_chain
=
chain
.name
;
for
residue
in
&
chain
.lst_res
{
let
c_res
=
residue
.res_num
;
for
atom
in
&
residue
.lst_atom
{
if
!
(
atom
.name
()
.starts_with
(
"H"
)){
new_prot
.update_protein
(
c_chain
,
residue
.name
.clone
(),
c_res
,
atom
.name
.clone
(),
atom
.number
,
atom
.coord
,
);
}
}
}
}
new_prot
.refine_dialing
();
Some
(
new_prot
)
}
}
}
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