hexsha
stringlengths
40
40
repo
stringlengths
7
114
path
stringlengths
4
124
license
listlengths
1
9
language
stringclasses
1 value
identifier
stringlengths
1
71
return_type
stringlengths
1
749
⌀
original_string
stringlengths
76
22.7k
original_docstring
stringlengths
16
7.61k
docstring
stringlengths
16
2.47k
docstring_tokens
listlengths
6
477
code
stringlengths
14
10.2k
code_tokens
listlengths
6
996
short_docstring
stringlengths
2
644
short_docstring_tokens
listlengths
1
116
comment
listlengths
1
89
parameters
listlengths
0
64
docstring_params
dict
647c16028a51e048cc5db5f3318be7418504b889
Yu-Group/pcs-pipeline
vflow/subkey.py
[ "MIT" ]
Python
mismatches
<not_specific>
def mismatches(self, o: object): '''When Subkey matching is required, determines if this Subkey and another are a bad match, meaning either: 1. output_matching is True, origin is same, value is different 2. output_matching is False, _sep_dicts_id is same and not None, origin ...
When Subkey matching is required, determines if this Subkey and another are a bad match, meaning either: 1. output_matching is True, origin is same, value is different 2. output_matching is False, _sep_dicts_id is same and not None, origin is same, value is different
When Subkey matching is required, determines if this Subkey and another are a bad match, meaning either. 1.
[ "When", "Subkey", "matching", "is", "required", "determines", "if", "this", "Subkey", "and", "another", "are", "a", "bad", "match", "meaning", "either", ".", "1", "." ]
def mismatches(self, o: object): if isinstance(o, self.__class__): cond0 = self._output_matching or o._output_matching cond1 = not cond0 and self.matches_sep_dict_id(o) cond2 = self.origin == o.origin and self.value != o.value return (cond0 or cond1) and cond2 ...
[ "def", "mismatches", "(", "self", ",", "o", ":", "object", ")", ":", "if", "isinstance", "(", "o", ",", "self", ".", "__class__", ")", ":", "cond0", "=", "self", ".", "_output_matching", "or", "o", ".", "_output_matching", "cond1", "=", "not", "cond0",...
When Subkey matching is required, determines if this Subkey and another are a bad match, meaning either:
[ "When", "Subkey", "matching", "is", "required", "determines", "if", "this", "Subkey", "and", "another", "are", "a", "bad", "match", "meaning", "either", ":" ]
[ "'''When Subkey matching is required, determines if this Subkey and another are\n a bad match, meaning either:\n\n 1. output_matching is True, origin is same, value is different\n 2. output_matching is False, _sep_dicts_id is same and not None, origin\n is same, value is different\n\n...
[ { "param": "self", "type": null }, { "param": "o", "type": "object" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "o", "type": "object", "docstring": null, "docstring_tokens": ...
53aad1a92abe56575a9092335a834e9f45c83de4
NikonasSimou/TrainableYamnet
trainable_yamnet.py
[ "MIT" ]
Python
yamnet_model
<not_specific>
def yamnet_model(feature_params): """Creates the yamnet model, without seperating into frames. Takes as input one .wav file, performs feature extraction and produces a spectrogram which is the input to yamnet """ waveform = layers.Input((None,)) _,patches = features_lib.waveform_to_log_mel_sp...
Creates the yamnet model, without seperating into frames. Takes as input one .wav file, performs feature extraction and produces a spectrogram which is the input to yamnet
Creates the yamnet model, without seperating into frames. Takes as input one .wav file, performs feature extraction and produces a spectrogram which is the input to yamnet
[ "Creates", "the", "yamnet", "model", "without", "seperating", "into", "frames", ".", "Takes", "as", "input", "one", ".", "wav", "file", "performs", "feature", "extraction", "and", "produces", "a", "spectrogram", "which", "is", "the", "input", "to", "yamnet" ]
def yamnet_model(feature_params): waveform = layers.Input((None,)) _,patches = features_lib.waveform_to_log_mel_spectrogram_patches( tf.squeeze(waveform, axis=0), feature_params) predictions,_ = yamnet(patches,feature_params) single_spec_model = Model(name='yamnet_frames', i...
[ "def", "yamnet_model", "(", "feature_params", ")", ":", "waveform", "=", "layers", ".", "Input", "(", "(", "None", ",", ")", ")", "_", ",", "patches", "=", "features_lib", ".", "waveform_to_log_mel_spectrogram_patches", "(", "tf", ".", "squeeze", "(", "wavef...
Creates the yamnet model, without seperating into frames.
[ "Creates", "the", "yamnet", "model", "without", "seperating", "into", "frames", "." ]
[ "\"\"\"Creates the yamnet model, without seperating into frames. \n Takes as input one .wav file, performs feature extraction and\n produces a spectrogram which is the input to yamnet \"\"\"", "#yamnet returns predictions and embedings" ]
[ { "param": "feature_params", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "feature_params", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
1198458b16709a7ac9140e648a53c560c8eee9f1
sbhardwaj8717/PythonAlgorithms
LeetCode/0337_House_Robber_III.py
[ "MIT" ]
Python
rob_helper
<not_specific>
def rob_helper(root): # base cases if(root is None): return 0 # if we have the value for root in dp that we means we have calculated the value # previously so we can simply return the saved value if(root in dp.keys()): return dp[root] ''' I...
In this problem our constraints are:- 1. If we add/rob the profit of parent then we can't add/rob profit of children as the police will be alerted 2. If we don't rob the parent then we can rob its child nodes Example:- lvl 1 ...
In this problem our constraints are: 1. If we add/rob the profit of parent then we can't add/rob profit of children as the police will be alerted 2. If we don't rob the parent then we can rob its child nodes lvl 1 3 \ lvl 2 2 3 \ \ lvl 3 3 1 In this if we add the profit for 3 the...
[ "In", "this", "problem", "our", "constraints", "are", ":", "1", ".", "If", "we", "add", "/", "rob", "the", "profit", "of", "parent", "then", "we", "can", "'", "t", "add", "/", "rob", "profit", "of", "children", "as", "the", "police", "will", "be", ...
def rob_helper(root): if(root is None): return 0 if(root in dp.keys()): return dp[root] profit1 = rob_helper(root.left) + rob_helper(root.right) profit2 = root.val if(root.left is not None): profit2 += rob_helper(root.left.left) + rob_helper(ro...
[ "def", "rob_helper", "(", "root", ")", ":", "if", "(", "root", "is", "None", ")", ":", "return", "0", "if", "(", "root", "in", "dp", ".", "keys", "(", ")", ")", ":", "return", "dp", "[", "root", "]", "profit1", "=", "rob_helper", "(", "root", "...
In this problem our constraints are: 1.
[ "In", "this", "problem", "our", "constraints", "are", ":", "1", "." ]
[ "# base cases", "# if we have the value for root in dp that we means we have calculated the value", "# previously so we can simply return the saved value", "'''\n In this problem our constraints are:-\n 1. If we add/rob the profit of parent then we can't add/rob profit of children\n ...
[ { "param": "root", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "root", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
c5a93f9d735a1852f319e7461edf3c4ca2a095d4
sbhardwaj8717/PythonAlgorithms
LeetCode/0213_House_robber2.py
[ "MIT" ]
Python
rob
int
def rob(self, nums: List[int]) -> int: n = len( nums ) # base conditions # if there is no element in array if n==0: return 0 # if there is only one element in array return the element if n==1: return nums[0] # if there are 2 elements then r...
We exclude the last element in first case then find max profit we exculde the first element in second case then find max profit we can't take both first and last element as they are adjacent as last house is connected to first house
We exclude the last element in first case then find max profit we exculde the first element in second case then find max profit we can't take both first and last element as they are adjacent as last house is connected to first house
[ "We", "exclude", "the", "last", "element", "in", "first", "case", "then", "find", "max", "profit", "we", "exculde", "the", "first", "element", "in", "second", "case", "then", "find", "max", "profit", "we", "can", "'", "t", "take", "both", "first", "and",...
def rob(self, nums: List[int]) -> int: n = len( nums ) if n==0: return 0 if n==1: return nums[0] if n==2: return max(nums[0],nums[1]) def max_profit(dp): len_dp = len( dp ) dp[1] = max( dp[0], dp[1] ) for k i...
[ "def", "rob", "(", "self", ",", "nums", ":", "List", "[", "int", "]", ")", "->", "int", ":", "n", "=", "len", "(", "nums", ")", "if", "n", "==", "0", ":", "return", "0", "if", "n", "==", "1", ":", "return", "nums", "[", "0", "]", "if", "n...
We exclude the last element in first case then find max profit we exculde the first element in second case then find max profit we can't take both first and last element as they are adjacent as last house is connected to first house
[ "We", "exclude", "the", "last", "element", "in", "first", "case", "then", "find", "max", "profit", "we", "exculde", "the", "first", "element", "in", "second", "case", "then", "find", "max", "profit", "we", "can", "'", "t", "take", "both", "first", "and",...
[ "# base conditions", "# if there is no element in array", "# if there is only one element in array return the element", "# if there are 2 elements then return the max value out of both as we can't choose adjacent values together", "\"\"\"\n This function finds the max profit by robbing the adjace...
[ { "param": "self", "type": null }, { "param": "nums", "type": "List[int]" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "nums", "type": "List[int]", "docstring": null, "docstring_tok...
c5a93f9d735a1852f319e7461edf3c4ca2a095d4
sbhardwaj8717/PythonAlgorithms
LeetCode/0213_House_robber2.py
[ "MIT" ]
Python
max_profit
<not_specific>
def max_profit(dp): """ This function finds the max profit by robbing the adjacent houses using DP Input:- DP array of size n-1 Output:- Max profit from that DP array """ len_dp = len( dp ) dp[1] = max( dp[0], dp[1] ) for k ...
This function finds the max profit by robbing the adjacent houses using DP Input:- DP array of size n-1 Output:- Max profit from that DP array
This function finds the max profit by robbing the adjacent houses using DP Input:- DP array of size n-1 Output:- Max profit from that DP array
[ "This", "function", "finds", "the", "max", "profit", "by", "robbing", "the", "adjacent", "houses", "using", "DP", "Input", ":", "-", "DP", "array", "of", "size", "n", "-", "1", "Output", ":", "-", "Max", "profit", "from", "that", "DP", "array" ]
def max_profit(dp): len_dp = len( dp ) dp[1] = max( dp[0], dp[1] ) for k in range( 2, len_dp ): dp[k] = max( dp[k - 1], dp[k] + dp[k - 2] ) return dp[-1]
[ "def", "max_profit", "(", "dp", ")", ":", "len_dp", "=", "len", "(", "dp", ")", "dp", "[", "1", "]", "=", "max", "(", "dp", "[", "0", "]", ",", "dp", "[", "1", "]", ")", "for", "k", "in", "range", "(", "2", ",", "len_dp", ")", ":", "dp", ...
This function finds the max profit by robbing the adjacent houses using DP Input:- DP array of size n-1 Output:- Max profit from that DP array
[ "This", "function", "finds", "the", "max", "profit", "by", "robbing", "the", "adjacent", "houses", "using", "DP", "Input", ":", "-", "DP", "array", "of", "size", "n", "-", "1", "Output", ":", "-", "Max", "profit", "from", "that", "DP", "array" ]
[ "\"\"\"\n This function finds the max profit by robbing the adjacent houses using DP\n Input:- DP array of size n-1\n Output:- Max profit from that DP array\n \"\"\"" ]
[ { "param": "dp", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "dp", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
445b56f16814d3e36e01e3a28ffdb4cacf24e313
sbhardwaj8717/PythonAlgorithms
LeetCode/0973_ K_Closest_Points_to_Origin.py
[ "MIT" ]
Python
closest_points
List[Tuple[float, float]]
def closest_points(self, points: List[Tuple[float, float]], k: int) -> List[Tuple[float, float]]: """ Finds the K points closest to the origin. The implementation pushes the points on a Heap with their key being the distance to the origin, then removes K elements from the heap. I chose ...
Finds the K points closest to the origin. The implementation pushes the points on a Heap with their key being the distance to the origin, then removes K elements from the heap. I chose to go with a more verbose implementation to show how it can be done, but alternatively one could do: ...
Finds the K points closest to the origin. The implementation pushes the points on a Heap with their key being the distance to the origin, then removes K elements from the heap. I chose to go with a more verbose implementation to show how it can be done, but alternatively one could do.
[ "Finds", "the", "K", "points", "closest", "to", "the", "origin", ".", "The", "implementation", "pushes", "the", "points", "on", "a", "Heap", "with", "their", "key", "being", "the", "distance", "to", "the", "origin", "then", "removes", "K", "elements", "fro...
def closest_points(self, points: List[Tuple[float, float]], k: int) -> List[Tuple[float, float]]: heap = [] for point in points: heappush(heap, (self.distance(point), point)) return [heappop(heap)[1] for _ in range(k)]
[ "def", "closest_points", "(", "self", ",", "points", ":", "List", "[", "Tuple", "[", "float", ",", "float", "]", "]", ",", "k", ":", "int", ")", "->", "List", "[", "Tuple", "[", "float", ",", "float", "]", "]", ":", "heap", "=", "[", "]", "for"...
Finds the K points closest to the origin.
[ "Finds", "the", "K", "points", "closest", "to", "the", "origin", "." ]
[ "\"\"\"\n Finds the K points closest to the origin.\n\n The implementation pushes the points on a Heap with their key being the distance to the origin, then removes K elements from the heap.\n I chose to go with a more verbose implementation to show how it can be done, but alternatively one cou...
[ { "param": "self", "type": null }, { "param": "points", "type": "List[Tuple[float, float]]" }, { "param": "k", "type": "int" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "points", "type": "List[Tuple[float, float]]", "docstring": null, ...
445b56f16814d3e36e01e3a28ffdb4cacf24e313
sbhardwaj8717/PythonAlgorithms
LeetCode/0973_ K_Closest_Points_to_Origin.py
[ "MIT" ]
Python
distance
float
def distance(self, point: Tuple[float, float]) -> float: """ Pythagorean formula to get the distance to the origin. """ return (point[0] ** 2 + point[1] ** 2) ** 0.5
Pythagorean formula to get the distance to the origin.
Pythagorean formula to get the distance to the origin.
[ "Pythagorean", "formula", "to", "get", "the", "distance", "to", "the", "origin", "." ]
def distance(self, point: Tuple[float, float]) -> float: return (point[0] ** 2 + point[1] ** 2) ** 0.5
[ "def", "distance", "(", "self", ",", "point", ":", "Tuple", "[", "float", ",", "float", "]", ")", "->", "float", ":", "return", "(", "point", "[", "0", "]", "**", "2", "+", "point", "[", "1", "]", "**", "2", ")", "**", "0.5" ]
Pythagorean formula to get the distance to the origin.
[ "Pythagorean", "formula", "to", "get", "the", "distance", "to", "the", "origin", "." ]
[ "\"\"\"\n Pythagorean formula to get the distance to the origin.\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "point", "type": "Tuple[float, float]" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "point", "type": "Tuple[float, float]", "docstring": null, "do...
bf50573fc8c7f1473140c678218ca5ff24e7755c
charlieallatson/hello_world
hello.py
[ "MIT" ]
Python
hello
<not_specific>
def hello(name='world'): """ Return a greeting for the given name """ return 'Hello, {}'.format(name)
Return a greeting for the given name
Return a greeting for the given name
[ "Return", "a", "greeting", "for", "the", "given", "name" ]
def hello(name='world'): return 'Hello, {}'.format(name)
[ "def", "hello", "(", "name", "=", "'world'", ")", ":", "return", "'Hello, {}'", ".", "format", "(", "name", ")" ]
Return a greeting for the given name
[ "Return", "a", "greeting", "for", "the", "given", "name" ]
[ "\"\"\"\n Return a greeting for the given name\n \"\"\"" ]
[ { "param": "name", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "name", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
bf50573fc8c7f1473140c678218ca5ff24e7755c
charlieallatson/hello_world
hello.py
[ "MIT" ]
Python
main
null
def main(): """ Reads input from the args passed into the script and prints the output to stdout. """ args = sys.argv[1:] name = ' '.join(args) if name: print(hello(name)) else: print(hello())
Reads input from the args passed into the script and prints the output to stdout.
Reads input from the args passed into the script and prints the output to stdout.
[ "Reads", "input", "from", "the", "args", "passed", "into", "the", "script", "and", "prints", "the", "output", "to", "stdout", "." ]
def main(): args = sys.argv[1:] name = ' '.join(args) if name: print(hello(name)) else: print(hello())
[ "def", "main", "(", ")", ":", "args", "=", "sys", ".", "argv", "[", "1", ":", "]", "name", "=", "' '", ".", "join", "(", "args", ")", "if", "name", ":", "print", "(", "hello", "(", "name", ")", ")", "else", ":", "print", "(", "hello", "(", ...
Reads input from the args passed into the script and prints the output to stdout.
[ "Reads", "input", "from", "the", "args", "passed", "into", "the", "script", "and", "prints", "the", "output", "to", "stdout", "." ]
[ "\"\"\"\n Reads input from the args passed into the script and prints the\n output to stdout.\n \"\"\"" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
38e6299d8406e4a5e5315c217394b56f5ce029a1
bbrauser/human-rights-first-ds-e
project/app/api/update.py
[ "MIT" ]
Python
update
<not_specific>
async def update(): ''' Update backlog database with data from reddit. ''' # globalize these variables because I need to PRAW_CLIENT_ID = os.getenv('PRAW_CLIENT_ID') PRAW_CLIENT_SECRET = os.getenv('PRAW_CLIENT_SECRET') PRAW_USER_AGENT = os.getenv('PRAW_USER_AGENT') reddit = praw.Reddi...
Update backlog database with data from reddit.
Update backlog database with data from reddit.
[ "Update", "backlog", "database", "with", "data", "from", "reddit", "." ]
async def update(): PRAW_CLIENT_ID = os.getenv('PRAW_CLIENT_ID') PRAW_CLIENT_SECRET = os.getenv('PRAW_CLIENT_SECRET') PRAW_USER_AGENT = os.getenv('PRAW_USER_AGENT') reddit = praw.Reddit( client_id=PRAW_CLIENT_ID, client_secret=PRAW_CLIENT_SECRET, user_agent=PRAW_USER_AGENT )...
[ "async", "def", "update", "(", ")", ":", "PRAW_CLIENT_ID", "=", "os", ".", "getenv", "(", "'PRAW_CLIENT_ID'", ")", "PRAW_CLIENT_SECRET", "=", "os", ".", "getenv", "(", "'PRAW_CLIENT_SECRET'", ")", "PRAW_USER_AGENT", "=", "os", ".", "getenv", "(", "'PRAW_USER_A...
Update backlog database with data from reddit.
[ "Update", "backlog", "database", "with", "data", "from", "reddit", "." ]
[ "'''\n Update backlog database with data from reddit.\n '''", "# globalize these variables because I need to", "# Grab data from reddit", "# Pull from reddit using the format: reddit.subreddit(<subreddit name>).<sort posts by keyword>(limit=<number of posts that you want to pull>)", "# Append the post...
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
ac43d17bcd151a4af7b02ea5dab08f7e42385885
marianoiglesiasmarchese/stream-reading-and-writing-lambda
main/app.py
[ "MIT" ]
Python
lambda_handler
<not_specific>
def lambda_handler(event, context): # shared attributes s3_endpoint = os.environ.get('S3_ENDPOINT', 'http://s3.amazonaws.com/') s3_bucket = event.get("bucket") s3_key = event.get("key") """ stream reading and writing with boto3 """ read_and_persistence_with_boto3(s3_endpoint, s3_bucket,...
stream reading and writing with boto3
stream reading and writing with boto3
[ "stream", "reading", "and", "writing", "with", "boto3" ]
def lambda_handler(event, context): s3_endpoint = os.environ.get('S3_ENDPOINT', 'http://s3.amazonaws.com/') s3_bucket = event.get("bucket") s3_key = event.get("key") read_and_persistence_with_boto3(s3_endpoint, s3_bucket, s3_key) read_and_persistence_with_smart_open(s3_endpoint, s3_bucket, s3_key) ...
[ "def", "lambda_handler", "(", "event", ",", "context", ")", ":", "s3_endpoint", "=", "os", ".", "environ", ".", "get", "(", "'S3_ENDPOINT'", ",", "'http://s3.amazonaws.com/'", ")", "s3_bucket", "=", "event", ".", "get", "(", "\"bucket\"", ")", "s3_key", "=",...
stream reading and writing with boto3
[ "stream", "reading", "and", "writing", "with", "boto3" ]
[ "# shared attributes", "\"\"\"\n stream reading and writing with boto3\n \"\"\"", "\"\"\"\n stream reading and writing with smart_open\n \"\"\"" ]
[ { "param": "event", "type": null }, { "param": "context", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "event", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "context", "type": null, "docstring": null, "docstring_tokens...
adf3cd239d89e601fc2ecabc7ea214241b67b8e3
zmr/namsel
page_elements2.py
[ "MIT" ]
Python
save_margin_content
null
def save_margin_content(self, tree, content_box): '''Look at margin content and try to OCR it. Save results in a pickle file of a dictionary object: d = {'left':['margin info 1', ...], 'right':['right margin info 1', etc]} Margin content is tricky since letters are often not def...
Look at margin content and try to OCR it. Save results in a pickle file of a dictionary object: d = {'left':['margin info 1', ...], 'right':['right margin info 1', etc]} Margin content is tricky since letters are often not defined as well as the main page content. The current OC...
Look at margin content and try to OCR it. Margin content is tricky since letters are often not defined as well as the main page content. The current OCR implementation also stumbles on text with very few characters. Page numbers don't do well for some reason
[ "Look", "at", "margin", "content", "and", "try", "to", "OCR", "it", ".", "Margin", "content", "is", "tricky", "since", "letters", "are", "often", "not", "defined", "as", "well", "as", "the", "main", "page", "content", ".", "The", "current", "OCR", "imple...
def save_margin_content(self, tree, content_box): import cPickle as pickle import os content_box_right_edge = tree[content_box]['b'][0] + tree[content_box]['b'][2] inset = 20 right_content = [] left_content = [] for brnch in tree: if brnch != content_b...
[ "def", "save_margin_content", "(", "self", ",", "tree", ",", "content_box", ")", ":", "import", "cPickle", "as", "pickle", "import", "os", "content_box_right_edge", "=", "tree", "[", "content_box", "]", "[", "'b'", "]", "[", "0", "]", "+", "tree", "[", "...
Look at margin content and try to OCR it.
[ "Look", "at", "margin", "content", "and", "try", "to", "OCR", "it", "." ]
[ "'''Look at margin content and try to OCR it. Save results in a pickle\n file of a dictionary object:\n d = {'left':['margin info 1', ...], 'right':['right margin info 1', etc]}\n \n Margin content is tricky since letters are often not defined as well\n as the main page content. T...
[ { "param": "self", "type": null }, { "param": "tree", "type": null }, { "param": "content_box", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "tree", "type": null, "docstring": null, "docstring_tokens": [...
adf3cd239d89e601fc2ecabc7ea214241b67b8e3
zmr/namsel
page_elements2.py
[ "MIT" ]
Python
qualified_box
<not_specific>
def qualified_box(bx): '''Helper function that ignores boxes that contain other boxes. This is useful for finding the main content box which should be among the innermost boxes that have no box children ''' if tree[bx]['num_boxes'] == 0: retur...
Helper function that ignores boxes that contain other boxes. This is useful for finding the main content box which should be among the innermost boxes that have no box children
Helper function that ignores boxes that contain other boxes. This is useful for finding the main content box which should be among the innermost boxes that have no box children
[ "Helper", "function", "that", "ignores", "boxes", "that", "contain", "other", "boxes", ".", "This", "is", "useful", "for", "finding", "the", "main", "content", "box", "which", "should", "be", "among", "the", "innermost", "boxes", "that", "have", "no", "box",...
def qualified_box(bx): if tree[bx]['num_boxes'] == 0: return tree[bx]['num_chars'] else: return -1
[ "def", "qualified_box", "(", "bx", ")", ":", "if", "tree", "[", "bx", "]", "[", "'num_boxes'", "]", "==", "0", ":", "return", "tree", "[", "bx", "]", "[", "'num_chars'", "]", "else", ":", "return", "-", "1" ]
Helper function that ignores boxes that contain other boxes.
[ "Helper", "function", "that", "ignores", "boxes", "that", "contain", "other", "boxes", "." ]
[ "'''Helper function that ignores boxes that contain other boxes.\n This is useful for finding the main content box which should\n be among the innermost boxes that have no box children '''" ]
[ { "param": "bx", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "bx", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
d1b1017233d6a6b9c3a8826a3a51ea0cdfa1c453
ssmithTaylor/openpilot
selfdrive/controls/lib/longcontrol.py
[ "MIT" ]
Python
update
<not_specific>
def update(self, active, CS, v_target, v_target_future, a_target, CP, source): """Update longitudinal control. This updates the state machine and runs a PID loop""" # Actuation limits gm_bp = CP.gasMaxBP gm_v = CP.gasMaxV bm_bp = CP.brakeMaxBP bm_v = CP.brakeMaxV dz_bp = CP.longitudinalTunin...
Update longitudinal control. This updates the state machine and runs a PID loop
Update longitudinal control. This updates the state machine and runs a PID loop
[ "Update", "longitudinal", "control", ".", "This", "updates", "the", "state", "machine", "and", "runs", "a", "PID", "loop" ]
def update(self, active, CS, v_target, v_target_future, a_target, CP, source): gm_bp = CP.gasMaxBP gm_v = CP.gasMaxV bm_bp = CP.brakeMaxBP bm_v = CP.brakeMaxV dz_bp = CP.longitudinalTuning.deadzoneBP dz_v = CP.longitudinalTuning.deadzoneV if self.op_params.get(ENABLE_LONG_PARAMS): if s...
[ "def", "update", "(", "self", ",", "active", ",", "CS", ",", "v_target", ",", "v_target_future", ",", "a_target", ",", "CP", ",", "source", ")", ":", "gm_bp", "=", "CP", ".", "gasMaxBP", "gm_v", "=", "CP", ".", "gasMaxV", "bm_bp", "=", "CP", ".", "...
Update longitudinal control.
[ "Update", "longitudinal", "control", "." ]
[ "\"\"\"Update longitudinal control. This updates the state machine and runs a PID loop\"\"\"", "# Actuation limits", "# Update state machine", "# Without this we get jumps, CAN bus reports 0 when speed < 0.3", "# tracking objects and driving", "# Toyota starts braking more when it thinks you want to stop"...
[ { "param": "self", "type": null }, { "param": "active", "type": null }, { "param": "CS", "type": null }, { "param": "v_target", "type": null }, { "param": "v_target_future", "type": null }, { "param": "a_target", "type": null }, { "param": ...
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "active", "type": null, "docstring": null, "docstring_tokens":...
cd76a597c97a7c7b496ad1b08ae019a18ee227a9
ssmithTaylor/openpilot
selfdrive/controls/lib/planner.py
[ "MIT" ]
Python
update
null
def update(self, sm, pm, CP, VM, PP): """Gets called when new radarState is available""" cur_time = sec_since_boot() v_ego = sm['carState'].vEgo a_ego = sm['carState'].aEgo long_control_state = sm['controlsState'].longControlState v_cruise_kph = sm['controlsState'].vCruise force_slow_decel ...
Gets called when new radarState is available
Gets called when new radarState is available
[ "Gets", "called", "when", "new", "radarState", "is", "available" ]
def update(self, sm, pm, CP, VM, PP): cur_time = sec_since_boot() v_ego = sm['carState'].vEgo a_ego = sm['carState'].aEgo long_control_state = sm['controlsState'].longControlState v_cruise_kph = sm['controlsState'].vCruise force_slow_decel = sm['controlsState'].forceDecel v_cruise_kph = min(...
[ "def", "update", "(", "self", ",", "sm", ",", "pm", ",", "CP", ",", "VM", ",", "PP", ")", ":", "cur_time", "=", "sec_since_boot", "(", ")", "v_ego", "=", "sm", "[", "'carState'", "]", ".", "vEgo", "a_ego", "=", "sm", "[", "'carState'", "]", ".", ...
Gets called when new radarState is available
[ "Gets", "called", "when", "new", "radarState", "is", "available" ]
[ "\"\"\"Gets called when new radarState is available\"\"\"", "# Calculate speed for normal cruise control", "# TODO: make a separate lookup for jerk tuning", "# if required so, force a smooth deceleration", "# cruise speed can't be negative even is user is distracted", "# determine fcw", "# **** send the...
[ { "param": "self", "type": null }, { "param": "sm", "type": null }, { "param": "pm", "type": null }, { "param": "CP", "type": null }, { "param": "VM", "type": null }, { "param": "PP", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "sm", "type": null, "docstring": null, "docstring_tokens": [],...
35dbbfb2e5adb4f57f57db8d8bc2adacdff9fa35
adam-zheleznyak/DSGRN
src/DSGRN/SaveDatabaseJSON.py
[ "MIT" ]
Python
dsgrn_cell_to_cc_cell_map
<not_specific>
def dsgrn_cell_to_cc_cell_map(network): """Return a mapping from the top dimensional cells in the DSGRN complex to the top dimensional cells in the pychomp cubical complex. """ # Construct a cubical complex using pychomp. A cubical complex in pychomp # does not contain the rightmost boundary, s...
Return a mapping from the top dimensional cells in the DSGRN complex to the top dimensional cells in the pychomp cubical complex.
Return a mapping from the top dimensional cells in the DSGRN complex to the top dimensional cells in the pychomp cubical complex.
[ "Return", "a", "mapping", "from", "the", "top", "dimensional", "cells", "in", "the", "DSGRN", "complex", "to", "the", "top", "dimensional", "cells", "in", "the", "pychomp", "cubical", "complex", "." ]
def dsgrn_cell_to_cc_cell_map(network): cubical_complex = pychomp.CubicalComplex([x + 1 for x in network.domains()]) dimension = network.size() cell2cc_cell = {} dsgrn_index = 0 for cell_index in cubical_complex(dimension): if cubical_complex.rightfringe(cell_index): continue ...
[ "def", "dsgrn_cell_to_cc_cell_map", "(", "network", ")", ":", "cubical_complex", "=", "pychomp", ".", "CubicalComplex", "(", "[", "x", "+", "1", "for", "x", "in", "network", ".", "domains", "(", ")", "]", ")", "dimension", "=", "network", ".", "size", "(...
Return a mapping from the top dimensional cells in the DSGRN complex to the top dimensional cells in the pychomp cubical complex.
[ "Return", "a", "mapping", "from", "the", "top", "dimensional", "cells", "in", "the", "DSGRN", "complex", "to", "the", "top", "dimensional", "cells", "in", "the", "pychomp", "cubical", "complex", "." ]
[ "\"\"\"Return a mapping from the top dimensional cells\n in the DSGRN complex to the top dimensional\n cells in the pychomp cubical complex.\n \"\"\"", "# Construct a cubical complex using pychomp. A cubical complex in pychomp", "# does not contain the rightmost boundary, so make one extra layer of", ...
[ { "param": "network", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "network", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
35dbbfb2e5adb4f57f57db8d8bc2adacdff9fa35
adam-zheleznyak/DSGRN
src/DSGRN/SaveDatabaseJSON.py
[ "MIT" ]
Python
network_json
<not_specific>
def network_json(network): """Return json data for network.""" nodes = [] # Get network nodes for d in range(network.size()): node = {"id" : network.name(d)} nodes.append(node) # Get network edges edges = [(u, v) for u in range(network.size()) for v in network.outputs(u)] links =...
Return json data for network.
Return json data for network.
[ "Return", "json", "data", "for", "network", "." ]
def network_json(network): nodes = [] for d in range(network.size()): node = {"id" : network.name(d)} nodes.append(node) edges = [(u, v) for u in range(network.size()) for v in network.outputs(u)] links = [] for (u, v) in edges: edge_type = 1 if network.interaction(u, v) els...
[ "def", "network_json", "(", "network", ")", ":", "nodes", "=", "[", "]", "for", "d", "in", "range", "(", "network", ".", "size", "(", ")", ")", ":", "node", "=", "{", "\"id\"", ":", "network", ".", "name", "(", "d", ")", "}", "nodes", ".", "app...
Return json data for network.
[ "Return", "json", "data", "for", "network", "." ]
[ "\"\"\"Return json data for network.\"\"\"", "# Get network nodes", "# Get network edges" ]
[ { "param": "network", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "network", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
35dbbfb2e5adb4f57f57db8d8bc2adacdff9fa35
adam-zheleznyak/DSGRN
src/DSGRN/SaveDatabaseJSON.py
[ "MIT" ]
Python
parameter_graph_json
<not_specific>
def parameter_graph_json(parameter_graph, vertices=None): """Return json data for parameter graph.""" # Get list of vertices if none if vertices == None: vertices = list(range(parameter_graph.size())) all_edges = [(u, v) for u in vertices for v in parameter_graph.adjacencies(u, 'codim1') if v in...
Return json data for parameter graph.
Return json data for parameter graph.
[ "Return", "json", "data", "for", "parameter", "graph", "." ]
def parameter_graph_json(parameter_graph, vertices=None): if vertices == None: vertices = list(range(parameter_graph.size())) all_edges = [(u, v) for u in vertices for v in parameter_graph.adjacencies(u, 'codim1') if v in vertices] edges = [(u, v) for (u, v) in all_edges if u > v] nodes = [] ...
[ "def", "parameter_graph_json", "(", "parameter_graph", ",", "vertices", "=", "None", ")", ":", "if", "vertices", "==", "None", ":", "vertices", "=", "list", "(", "range", "(", "parameter_graph", ".", "size", "(", ")", ")", ")", "all_edges", "=", "[", "("...
Return json data for parameter graph.
[ "Return", "json", "data", "for", "parameter", "graph", "." ]
[ "\"\"\"Return json data for parameter graph.\"\"\"", "# Get list of vertices if none", "# Remove double edges (all edges are double)", "# node = {\"id\" : str(v)}", "# link = {\"source\" : str(u), \"target\" : str(v)}" ]
[ { "param": "parameter_graph", "type": null }, { "param": "vertices", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "parameter_graph", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "vertices", "type": null, "docstring": null, "docst...
35dbbfb2e5adb4f57f57db8d8bc2adacdff9fa35
adam-zheleznyak/DSGRN
src/DSGRN/SaveDatabaseJSON.py
[ "MIT" ]
Python
cubical_complex_json
<not_specific>
def cubical_complex_json(network): """Return json data for cubical complex.""" # Get complex dimension dimension = network.size() # Construct a cubical complex using pychomp. A cubical complex in pychomp # does not contain the rightmost boundary, so make one extra layer of # cubes and ignore the...
Return json data for cubical complex.
Return json data for cubical complex.
[ "Return", "json", "data", "for", "cubical", "complex", "." ]
def cubical_complex_json(network): dimension = network.size() cubical_complex = pychomp.CubicalComplex([x + 1 for x in network.domains()]) verts_coords = [] coords2idx = {} for cell_index in cubical_complex(0): coords = cubical_complex.coordinates(cell_index) coords2idx[tuple(coords)...
[ "def", "cubical_complex_json", "(", "network", ")", ":", "dimension", "=", "network", ".", "size", "(", ")", "cubical_complex", "=", "pychomp", ".", "CubicalComplex", "(", "[", "x", "+", "1", "for", "x", "in", "network", ".", "domains", "(", ")", "]", ...
Return json data for cubical complex.
[ "Return", "json", "data", "for", "cubical", "complex", "." ]
[ "\"\"\"Return json data for cubical complex.\"\"\"", "# Get complex dimension", "# Construct a cubical complex using pychomp. A cubical complex in pychomp", "# does not contain the rightmost boundary, so make one extra layer of", "# cubes and ignore the last layer (called rightfringe in pychomp).", "# Get...
[ { "param": "network", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "network", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
35dbbfb2e5adb4f57f57db8d8bc2adacdff9fa35
adam-zheleznyak/DSGRN
src/DSGRN/SaveDatabaseJSON.py
[ "MIT" ]
Python
morse_graph_json
<not_specific>
def morse_graph_json(morse_graph): """Return json data for Morse graph.""" def vertex_rank(u): """Return how many levels down of children u have.""" children = [v for v in morse_graph.poset().children(u)] if len(children) == 0: return 0 return 1 + max([vertex_rank(v)...
Return json data for Morse graph.
Return json data for Morse graph.
[ "Return", "json", "data", "for", "Morse", "graph", "." ]
def morse_graph_json(morse_graph): def vertex_rank(u): children = [v for v in morse_graph.poset().children(u)] if len(children) == 0: return 0 return 1 + max([vertex_rank(v) for v in children]) morse_nodes = range(morse_graph.poset().size()) morse_graph_data = [] for...
[ "def", "morse_graph_json", "(", "morse_graph", ")", ":", "def", "vertex_rank", "(", "u", ")", ":", "\"\"\"Return how many levels down of children u have.\"\"\"", "children", "=", "[", "v", "for", "v", "in", "morse_graph", ".", "poset", "(", ")", ".", "children", ...
Return json data for Morse graph.
[ "Return", "json", "data", "for", "Morse", "graph", "." ]
[ "\"\"\"Return json data for Morse graph.\"\"\"", "\"\"\"Return how many levels down of children u have.\"\"\"", "# Get list of Morse nodes", "# Morse graph data" ]
[ { "param": "morse_graph", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "morse_graph", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
35dbbfb2e5adb4f57f57db8d8bc2adacdff9fa35
adam-zheleznyak/DSGRN
src/DSGRN/SaveDatabaseJSON.py
[ "MIT" ]
Python
vertex_rank
<not_specific>
def vertex_rank(u): """Return how many levels down of children u have.""" children = [v for v in morse_graph.poset().children(u)] if len(children) == 0: return 0 return 1 + max([vertex_rank(v) for v in children])
Return how many levels down of children u have.
Return how many levels down of children u have.
[ "Return", "how", "many", "levels", "down", "of", "children", "u", "have", "." ]
def vertex_rank(u): children = [v for v in morse_graph.poset().children(u)] if len(children) == 0: return 0 return 1 + max([vertex_rank(v) for v in children])
[ "def", "vertex_rank", "(", "u", ")", ":", "children", "=", "[", "v", "for", "v", "in", "morse_graph", ".", "poset", "(", ")", ".", "children", "(", "u", ")", "]", "if", "len", "(", "children", ")", "==", "0", ":", "return", "0", "return", "1", ...
Return how many levels down of children u have.
[ "Return", "how", "many", "levels", "down", "of", "children", "u", "have", "." ]
[ "\"\"\"Return how many levels down of children u have.\"\"\"" ]
[ { "param": "u", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "u", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
35dbbfb2e5adb4f57f57db8d8bc2adacdff9fa35
adam-zheleznyak/DSGRN
src/DSGRN/SaveDatabaseJSON.py
[ "MIT" ]
Python
morse_sets_json
<not_specific>
def morse_sets_json(network, morse_graph, morse_decomposition): """Return json data for Morse sets.""" # Get a mapping from DSGRN top cells to cc top cells cell2cc_cell = dsgrn_cell_to_cc_cell_map(network) # Get list of Morse nodes morse_nodes = range(morse_decomposition.poset().size()) # Permut...
Return json data for Morse sets.
Return json data for Morse sets.
[ "Return", "json", "data", "for", "Morse", "sets", "." ]
def morse_sets_json(network, morse_graph, morse_decomposition): cell2cc_cell = dsgrn_cell_to_cc_cell_map(network) morse_nodes = range(morse_decomposition.poset().size()) permutation = morse_graph.permutation() morse_sets_data = [] for morse_node in morse_nodes: morse_cells = [cell2cc_cell[c...
[ "def", "morse_sets_json", "(", "network", ",", "morse_graph", ",", "morse_decomposition", ")", ":", "cell2cc_cell", "=", "dsgrn_cell_to_cc_cell_map", "(", "network", ")", "morse_nodes", "=", "range", "(", "morse_decomposition", ".", "poset", "(", ")", ".", "size",...
Return json data for Morse sets.
[ "Return", "json", "data", "for", "Morse", "sets", "." ]
[ "\"\"\"Return json data for Morse sets.\"\"\"", "# Get a mapping from DSGRN top cells to cc top cells", "# Get list of Morse nodes", "# Permutation that gives node index from Morse set index", "# Morse sets data", "# Get Morse graph node index" ]
[ { "param": "network", "type": null }, { "param": "morse_graph", "type": null }, { "param": "morse_decomposition", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "network", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "morse_graph", "type": null, "docstring": null, "docstring_...
35dbbfb2e5adb4f57f57db8d8bc2adacdff9fa35
adam-zheleznyak/DSGRN
src/DSGRN/SaveDatabaseJSON.py
[ "MIT" ]
Python
state_transition_graph_json
<not_specific>
def state_transition_graph_json(network, domain_graph): """Return json data for state transiton graph.""" # Get a mapping from DSGRN top cells to cc top cells cell2cc_cell = dsgrn_cell_to_cc_cell_map(network) # Get state transition graph vertices stg_vertices = range(domain_graph.digraph().size()) ...
Return json data for state transiton graph.
Return json data for state transiton graph.
[ "Return", "json", "data", "for", "state", "transiton", "graph", "." ]
def state_transition_graph_json(network, domain_graph): cell2cc_cell = dsgrn_cell_to_cc_cell_map(network) stg_vertices = range(domain_graph.digraph().size()) stg = [] for v in stg_vertices: adjacencies = [cell2cc_cell[u] for u in domain_graph.digraph().adjacencies(v)] node_adjacency_dat...
[ "def", "state_transition_graph_json", "(", "network", ",", "domain_graph", ")", ":", "cell2cc_cell", "=", "dsgrn_cell_to_cc_cell_map", "(", "network", ")", "stg_vertices", "=", "range", "(", "domain_graph", ".", "digraph", "(", ")", ".", "size", "(", ")", ")", ...
Return json data for state transiton graph.
[ "Return", "json", "data", "for", "state", "transiton", "graph", "." ]
[ "\"\"\"Return json data for state transiton graph.\"\"\"", "# Get a mapping from DSGRN top cells to cc top cells", "# Get state transition graph vertices", "# State transition graph" ]
[ { "param": "network", "type": null }, { "param": "domain_graph", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "network", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "domain_graph", "type": null, "docstring": null, "docstring...
63d1e648c07ea50bbe78568f68efbb6c5cf12e1d
danielSoler93/FrAG_PELE
frag_pele/Helpers/find_dihedrals.py
[ "MIT" ]
Python
calculate_cluster_angles
null
def calculate_cluster_angles(self, dihedral_list): """ Calculate dihedral angles from pdb Parameters ---------- pdb_file: str Path to the cluster representative conformation dihedral_list: list List of the tuples containing the atoms that form the ...
Calculate dihedral angles from pdb Parameters ---------- pdb_file: str Path to the cluster representative conformation dihedral_list: list List of the tuples containing the atoms that form the dihedrals match_indexes: bool Whether to u...
Calculate dihedral angles from pdb Parameters str Path to the cluster representative conformation dihedral_list: list List of the tuples containing the atoms that form the dihedrals match_indexes: bool Whether to use the atom indices from the dihedral list or match to the cluster structure before
[ "Calculate", "dihedral", "angles", "from", "pdb", "Parameters", "str", "Path", "to", "the", "cluster", "representative", "conformation", "dihedral_list", ":", "list", "List", "of", "the", "tuples", "containing", "the", "atoms", "that", "form", "the", "dihedrals", ...
def calculate_cluster_angles(self, dihedral_list): rdkit_wrapper = RDKitToolkitWrapper() pdb_dihedrals = [] mol = molecule.Molecule(self._pdb_file, connectivity_template=self._molecule.rdkit_molecule) for dihedral in dihedral_list: names = [self._topology.atoms[atom].PDB_name...
[ "def", "calculate_cluster_angles", "(", "self", ",", "dihedral_list", ")", ":", "rdkit_wrapper", "=", "RDKitToolkitWrapper", "(", ")", "pdb_dihedrals", "=", "[", "]", "mol", "=", "molecule", ".", "Molecule", "(", "self", ".", "_pdb_file", ",", "connectivity_temp...
Calculate dihedral angles from pdb Parameters
[ "Calculate", "dihedral", "angles", "from", "pdb", "Parameters" ]
[ "\"\"\"\n Calculate dihedral angles from pdb\n Parameters\n ----------\n pdb_file: str\n Path to the cluster representative conformation\n dihedral_list: list\n List of the tuples containing the atoms that form the dihedrals\n match_indexes: bool\n ...
[ { "param": "self", "type": null }, { "param": "dihedral_list", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "dihedral_list", "type": null, "docstring": null, "docstring_t...
63d1e648c07ea50bbe78568f68efbb6c5cf12e1d
danielSoler93/FrAG_PELE
frag_pele/Helpers/find_dihedrals.py
[ "MIT" ]
Python
calculate
null
def calculate(self): """ Calculate dihedrals library from the bce output """ logger = Logger() logger.info(' - Calculating dihedral library') self._calculate_all_dihedrals()
Calculate dihedrals library from the bce output
Calculate dihedrals library from the bce output
[ "Calculate", "dihedrals", "library", "from", "the", "bce", "output" ]
def calculate(self): logger = Logger() logger.info(' - Calculating dihedral library') self._calculate_all_dihedrals()
[ "def", "calculate", "(", "self", ")", ":", "logger", "=", "Logger", "(", ")", "logger", ".", "info", "(", "' - Calculating dihedral library'", ")", "self", ".", "_calculate_all_dihedrals", "(", ")" ]
Calculate dihedrals library from the bce output
[ "Calculate", "dihedrals", "library", "from", "the", "bce", "output" ]
[ "\"\"\"\n Calculate dihedrals library from the bce output\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
974cac42f48b2e2110fbb70d0dc929cf803df309
danielSoler93/FrAG_PELE
frag_pele/Helpers/checker.py
[ "MIT" ]
Python
check_duplicated_pdbatomnames
null
def check_duplicated_pdbatomnames(pdb_content): """ It checks if the content of a PDB file contains repeated PDB atom names. :param pdb_content: string with the content of a PDB file. :return: if repeated atom names: exit and complain. """ pdb_atom_names_list = [] for line in pdb_content: ...
It checks if the content of a PDB file contains repeated PDB atom names. :param pdb_content: string with the content of a PDB file. :return: if repeated atom names: exit and complain.
It checks if the content of a PDB file contains repeated PDB atom names.
[ "It", "checks", "if", "the", "content", "of", "a", "PDB", "file", "contains", "repeated", "PDB", "atom", "names", "." ]
def check_duplicated_pdbatomnames(pdb_content): pdb_atom_names_list = [] for line in pdb_content: if line.startswith("HETATM") and line[17:30] != "HOH" and line[21:22] == "L": pdb_atom_name = line[12:17] pdb_atom_names_list.append(pdb_atom_name) set_to_check = set(pdb_atom_na...
[ "def", "check_duplicated_pdbatomnames", "(", "pdb_content", ")", ":", "pdb_atom_names_list", "=", "[", "]", "for", "line", "in", "pdb_content", ":", "if", "line", ".", "startswith", "(", "\"HETATM\"", ")", "and", "line", "[", "17", ":", "30", "]", "!=", "\...
It checks if the content of a PDB file contains repeated PDB atom names.
[ "It", "checks", "if", "the", "content", "of", "a", "PDB", "file", "contains", "repeated", "PDB", "atom", "names", "." ]
[ "\"\"\"\n It checks if the content of a PDB file contains repeated PDB atom names.\n :param pdb_content: string with the content of a PDB file.\n :return: if repeated atom names: exit and complain.\n \"\"\"" ]
[ { "param": "pdb_content", "type": null } ]
{ "returns": [ { "docstring": "if repeated atom names: exit and complain.", "docstring_tokens": [ "if", "repeated", "atom", "names", ":", "exit", "and", "complain", "." ], "type": null } ], "raises": [], "par...
974cac42f48b2e2110fbb70d0dc929cf803df309
danielSoler93/FrAG_PELE
frag_pele/Helpers/checker.py
[ "MIT" ]
Python
check_and_fix_pdbatomnames
null
def check_and_fix_pdbatomnames(pdb_file): """ It checks if atoms of the ligand of a PDB file contains the character 'G' (usually added by FrAG to identify atoms that have been grown) and modify the name of these atoms adding it element symbol to the PDB atom name. :param pdb_file: PDB file. str :ret...
It checks if atoms of the ligand of a PDB file contains the character 'G' (usually added by FrAG to identify atoms that have been grown) and modify the name of these atoms adding it element symbol to the PDB atom name. :param pdb_file: PDB file. str :return: it rewrites the PDB file applying the modifi...
It checks if atoms of the ligand of a PDB file contains the character 'G' (usually added by FrAG to identify atoms that have been grown) and modify the name of these atoms adding it element symbol to the PDB atom name.
[ "It", "checks", "if", "atoms", "of", "the", "ligand", "of", "a", "PDB", "file", "contains", "the", "character", "'", "G", "'", "(", "usually", "added", "by", "FrAG", "to", "identify", "atoms", "that", "have", "been", "grown", ")", "and", "modify", "the...
def check_and_fix_pdbatomnames(pdb_file): with open(pdb_file) as pdb: content = pdb.readlines() check_duplicated_pdbatomnames(content) for i, line in enumerate(content): if line.startswith("HETATM") and line[21:22] == "L": atom_name = line[12:16] i...
[ "def", "check_and_fix_pdbatomnames", "(", "pdb_file", ")", ":", "with", "open", "(", "pdb_file", ")", "as", "pdb", ":", "content", "=", "pdb", ".", "readlines", "(", ")", "check_duplicated_pdbatomnames", "(", "content", ")", "for", "i", ",", "line", "in", ...
It checks if atoms of the ligand of a PDB file contains the character 'G' (usually added by FrAG to identify atoms that have been grown) and modify the name of these atoms adding it element symbol to the PDB atom name.
[ "It", "checks", "if", "atoms", "of", "the", "ligand", "of", "a", "PDB", "file", "contains", "the", "character", "'", "G", "'", "(", "usually", "added", "by", "FrAG", "to", "identify", "atoms", "that", "have", "been", "grown", ")", "and", "modify", "the...
[ "\"\"\"\n It checks if atoms of the ligand of a PDB file contains the character 'G' (usually added by FrAG to identify atoms\n that have been grown) and modify the name of these atoms adding it element symbol to the PDB atom name.\n :param pdb_file: PDB file. str\n :return: it rewrites the PDB file appl...
[ { "param": "pdb_file", "type": null } ]
{ "returns": [ { "docstring": "it rewrites the PDB file applying the modifications.", "docstring_tokens": [ "it", "rewrites", "the", "PDB", "file", "applying", "the", "modifications", "." ], "type": null } ], "...
974cac42f48b2e2110fbb70d0dc929cf803df309
danielSoler93/FrAG_PELE
frag_pele/Helpers/checker.py
[ "MIT" ]
Python
check_if_atom_exists_in_ligand
null
def check_if_atom_exists_in_ligand(pdb_file, atom_name, ligand_chain="L"): """ It checks if an atom is found in a certain PDB file. :param pdb_file: PDB file. str :param atom_name: PDB atom name. str(len <= 4) :return: if the atom is found it prints a text and if not raise an exception. """ ...
It checks if an atom is found in a certain PDB file. :param pdb_file: PDB file. str :param atom_name: PDB atom name. str(len <= 4) :return: if the atom is found it prints a text and if not raise an exception.
It checks if an atom is found in a certain PDB file.
[ "It", "checks", "if", "an", "atom", "is", "found", "in", "a", "certain", "PDB", "file", "." ]
def check_if_atom_exists_in_ligand(pdb_file, atom_name, ligand_chain="L"): try: ligand = addfr.extract_atoms_pdbs(pdb_file, create_file=False, chain=ligand_chain, get_atoms=True) except OSError: raise OSError("Check filepath {} exists".format(pdb_file)) atom = ligand.select("name {}".format(...
[ "def", "check_if_atom_exists_in_ligand", "(", "pdb_file", ",", "atom_name", ",", "ligand_chain", "=", "\"L\"", ")", ":", "try", ":", "ligand", "=", "addfr", ".", "extract_atoms_pdbs", "(", "pdb_file", ",", "create_file", "=", "False", ",", "chain", "=", "ligan...
It checks if an atom is found in a certain PDB file.
[ "It", "checks", "if", "an", "atom", "is", "found", "in", "a", "certain", "PDB", "file", "." ]
[ "\"\"\"\n It checks if an atom is found in a certain PDB file.\n :param pdb_file: PDB file. str\n :param atom_name: PDB atom name. str(len <= 4)\n :return: if the atom is found it prints a text and if not raise an exception.\n \"\"\"" ]
[ { "param": "pdb_file", "type": null }, { "param": "atom_name", "type": null }, { "param": "ligand_chain", "type": null } ]
{ "returns": [ { "docstring": "if the atom is found it prints a text and if not raise an exception.", "docstring_tokens": [ "if", "the", "atom", "is", "found", "it", "prints", "a", "text", "and", "if", "not...
a54553aeb2dc5d2f78ff2597686fc3a285937dce
danielSoler93/FrAG_PELE
frag_pele/serie_handler.py
[ "MIT" ]
Python
read_instructions_from_file
<not_specific>
def read_instructions_from_file(file): """ It reads an "instruction file". This file contains the information of all the growing's that the user wants to perform, each one separated by newlines. Each instruction must have at least 3 columns, separated by tabulations: (1) name of the fragment's PDB file,...
It reads an "instruction file". This file contains the information of all the growing's that the user wants to perform, each one separated by newlines. Each instruction must have at least 3 columns, separated by tabulations: (1) name of the fragment's PDB file, (2) atom name of the core (if the user wa...
It reads an "instruction file". This file contains the information of all the growing's that the user wants to perform, each one separated by newlines. Each instruction must have at least 3 columns, separated by tabulations: (1) name of the fragment's PDB file, (2) atom name of the core (if the user wants to add the H ...
[ "It", "reads", "an", "\"", "instruction", "file", "\"", ".", "This", "file", "contains", "the", "information", "of", "all", "the", "growing", "'", "s", "that", "the", "user", "wants", "to", "perform", "each", "one", "separated", "by", "newlines", ".", "E...
def read_instructions_from_file(file): list_of_instructions = [] with open(file) as sf: instructions = sf.readlines() for line in instructions: if 0 < len(line.split()) <= 3: try: fragment_pdb = line.split()[0] core_atom = line....
[ "def", "read_instructions_from_file", "(", "file", ")", ":", "list_of_instructions", "=", "[", "]", "with", "open", "(", "file", ")", "as", "sf", ":", "instructions", "=", "sf", ".", "readlines", "(", ")", "for", "line", "in", "instructions", ":", "if", ...
It reads an "instruction file".
[ "It", "reads", "an", "\"", "instruction", "file", "\"", "." ]
[ "\"\"\"\n It reads an \"instruction file\". This file contains the information of all the growing's that the user wants to\n perform, each one separated by newlines. Each instruction must have at least 3 columns, separated by tabulations:\n (1) name of the fragment's PDB file,\n (2) atom name of the cor...
[ { "param": "file", "type": null } ]
{ "returns": [ { "docstring": "list with all instructions processed.", "docstring_tokens": [ "list", "with", "all", "instructions", "processed", "." ], "type": null } ], "raises": [], "params": [ { "identifier": "file", ...
a54553aeb2dc5d2f78ff2597686fc3a285937dce
danielSoler93/FrAG_PELE
frag_pele/serie_handler.py
[ "MIT" ]
Python
check_instructions
null
def check_instructions(instructions, complex_pdb, c_chain = "L", f_chain="L"): """ It checks if the selected atoms exists in their correspondent PDB file and also checks if there are repeated PDB-atom-names in the PDB file. :param list_of_instructions: list with the instructions read from the instructio...
It checks if the selected atoms exists in their correspondent PDB file and also checks if there are repeated PDB-atom-names in the PDB file. :param list_of_instructions: list with the instructions read from the instructions file. list :param complex: PDB file with the complex that contains the core ...
It checks if the selected atoms exists in their correspondent PDB file and also checks if there are repeated PDB-atom-names in the PDB file.
[ "It", "checks", "if", "the", "selected", "atoms", "exists", "in", "their", "correspondent", "PDB", "file", "and", "also", "checks", "if", "there", "are", "repeated", "PDB", "-", "atom", "-", "names", "in", "the", "PDB", "file", "." ]
def check_instructions(instructions, complex_pdb, c_chain = "L", f_chain="L"): fragments_and_atoms = get_pdb_fragments_and_atoms_from_instructions([instructions]) for fragment, atom_core, atom_fr in fragments_and_atoms: atoms_if_bond = extract_hydrogens_from_instructions([fragment, atom_core, atom_fr]) ...
[ "def", "check_instructions", "(", "instructions", ",", "complex_pdb", ",", "c_chain", "=", "\"L\"", ",", "f_chain", "=", "\"L\"", ")", ":", "fragments_and_atoms", "=", "get_pdb_fragments_and_atoms_from_instructions", "(", "[", "instructions", "]", ")", "for", "fragm...
It checks if the selected atoms exists in their correspondent PDB file and also checks if there are repeated PDB-atom-names in the PDB file.
[ "It", "checks", "if", "the", "selected", "atoms", "exists", "in", "their", "correspondent", "PDB", "file", "and", "also", "checks", "if", "there", "are", "repeated", "PDB", "-", "atom", "-", "names", "in", "the", "PDB", "file", "." ]
[ "\"\"\"\n It checks if the selected atoms exists in their correspondent PDB file and also checks if there are repeated\n PDB-atom-names in the PDB file.\n :param list_of_instructions: list with the instructions read from the instructions file. list\n :param complex: PDB file with the complex that contai...
[ { "param": "instructions", "type": null }, { "param": "complex_pdb", "type": null }, { "param": "c_chain", "type": null }, { "param": "f_chain", "type": null } ]
{ "returns": [ { "docstring": "if something is wrong it raises an exception.", "docstring_tokens": [ "if", "something", "is", "wrong", "it", "raises", "an", "exception", "." ], "type": null } ], "raises": [], ...
a54553aeb2dc5d2f78ff2597686fc3a285937dce
danielSoler93/FrAG_PELE
frag_pele/serie_handler.py
[ "MIT" ]
Python
extract_hydrogens_from_instructions
<not_specific>
def extract_hydrogens_from_instructions(instruction): """ If the core or the fragment atom contains a "-" means that the user is selecting an specific H to be bonded with the heavy atom. For this reason, this detects if this option has been selected by the user and extract the PDB-atom-name of each elem...
If the core or the fragment atom contains a "-" means that the user is selecting an specific H to be bonded with the heavy atom. For this reason, this detects if this option has been selected by the user and extract the PDB-atom-name of each element. :param instruction: list that follow this structure:...
If the core or the fragment atom contains a "-" means that the user is selecting an specific H to be bonded with the heavy atom. For this reason, this detects if this option has been selected by the user and extract the PDB-atom-name of each element.
[ "If", "the", "core", "or", "the", "fragment", "atom", "contains", "a", "\"", "-", "\"", "means", "that", "the", "user", "is", "selecting", "an", "specific", "H", "to", "be", "bonded", "with", "the", "heavy", "atom", ".", "For", "this", "reason", "this"...
def extract_hydrogens_from_instructions(instruction): if "-" in instruction[1] or "-" in instruction[2]: try: heavy_core = instruction[1].split("-")[0] hydrogen_core = instruction[1].split("-")[1] heavy_fragment = instruction[2].split("-")[0] hydrogen_fragment...
[ "def", "extract_hydrogens_from_instructions", "(", "instruction", ")", ":", "if", "\"-\"", "in", "instruction", "[", "1", "]", "or", "\"-\"", "in", "instruction", "[", "2", "]", ":", "try", ":", "heavy_core", "=", "instruction", "[", "1", "]", ".", "split"...
If the core or the fragment atom contains a "-" means that the user is selecting an specific H to be bonded with the heavy atom.
[ "If", "the", "core", "or", "the", "fragment", "atom", "contains", "a", "\"", "-", "\"", "means", "that", "the", "user", "is", "selecting", "an", "specific", "H", "to", "be", "bonded", "with", "the", "heavy", "atom", "." ]
[ "\"\"\"\n If the core or the fragment atom contains a \"-\" means that the user is selecting an specific H to be bonded with\n the heavy atom. For this reason, this detects if this option has been selected by the user and extract the PDB-atom-name\n of each element.\n :param instruction: list that follo...
[ { "param": "instruction", "type": null } ]
{ "returns": [ { "docstring": "if the \"-\" is found in the pdb_atom_name_of_the_core or pdb_atom_name_of_the_fragment it returns a list with\nPDB-atom-names split following this order: heavy_atom_core, hydrogen_core, heavy_atom_fragment, hydrogen_fragment.\nOtherwise it returns False.", "docstring_to...
bf8546d0e740f0f75e53b13ec817e91891c82be7
danielSoler93/FrAG_PELE
frag_pele/PlopRotTemp_S_2017/template/templateBuilder.py
[ "MIT" ]
Python
build_triangular_matrix
null
def build_triangular_matrix(self, stretchings, tors, phis, atom_names): """ Build triangular interaction matrix. You can find more information in PELE's docs """ bonds = stretchings counts = [] connections = [] for i, atom_name in enumerate(atom_n...
Build triangular interaction matrix. You can find more information in PELE's docs
Build triangular interaction matrix. You can find more information in PELE's docs
[ "Build", "triangular", "interaction", "matrix", ".", "You", "can", "find", "more", "information", "in", "PELE", "'", "s", "docs" ]
def build_triangular_matrix(self, stretchings, tors, phis, atom_names): bonds = stretchings counts = [] connections = [] for i, atom_name in enumerate(atom_names): count = 0 connected = [] for stretching in bonds[:]: if i in stretching:...
[ "def", "build_triangular_matrix", "(", "self", ",", "stretchings", ",", "tors", ",", "phis", ",", "atom_names", ")", ":", "bonds", "=", "stretchings", "counts", "=", "[", "]", "connections", "=", "[", "]", "for", "i", ",", "atom_name", "in", "enumerate", ...
Build triangular interaction matrix.
[ "Build", "triangular", "interaction", "matrix", "." ]
[ "\"\"\"\n Build triangular interaction matrix.\n You can find more information in PELE's docs\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "stretchings", "type": null }, { "param": "tors", "type": null }, { "param": "phis", "type": null }, { "param": "atom_names", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "stretchings", "type": null, "docstring": null, "docstring_tok...
bf8546d0e740f0f75e53b13ec817e91891c82be7
danielSoler93/FrAG_PELE
frag_pele/PlopRotTemp_S_2017/template/templateBuilder.py
[ "MIT" ]
Python
fix_parents_rings
<not_specific>
def fix_parents_rings(self, parents, atom_names): """ For every ring in the structure assign as parent of each atom the previous. To close the ring assign as parent of the initial atom the last. """ str1 = next(structure.StructureReader(self.input_file)) ...
For every ring in the structure assign as parent of each atom the previous. To close the ring assign as parent of the initial atom the last.
For every ring in the structure assign as parent of each atom the previous. To close the ring assign as parent of the initial atom the last.
[ "For", "every", "ring", "in", "the", "structure", "assign", "as", "parent", "of", "each", "atom", "the", "previous", ".", "To", "close", "the", "ring", "assign", "as", "parent", "of", "the", "initial", "atom", "the", "last", "." ]
def fix_parents_rings(self, parents, atom_names): str1 = next(structure.StructureReader(self.input_file)) rings = str1.ring for ring in rings: ring_atoms = ring.getAtomList() initial_atom = ring_atoms[0]-1 last_atom= ring_atoms[-1]-1 start = True ...
[ "def", "fix_parents_rings", "(", "self", ",", "parents", ",", "atom_names", ")", ":", "str1", "=", "next", "(", "structure", ".", "StructureReader", "(", "self", ".", "input_file", ")", ")", "rings", "=", "str1", ".", "ring", "for", "ring", "in", "rings"...
For every ring in the structure assign as parent of each atom the previous.
[ "For", "every", "ring", "in", "the", "structure", "assign", "as", "parent", "of", "each", "atom", "the", "previous", "." ]
[ "\"\"\"\n For every ring in the structure assign as parent \n of each atom the previous. To close the ring assign\n as parent of the initial atom the last.\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "parents", "type": null }, { "param": "atom_names", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "parents", "type": null, "docstring": null, "docstring_tokens"...
bf8546d0e740f0f75e53b13ec817e91891c82be7
danielSoler93/FrAG_PELE
frag_pele/PlopRotTemp_S_2017/template/templateBuilder.py
[ "MIT" ]
Python
search_and_replace
null
def search_and_replace(file, to_search): """ Search and replace atom_names for numbers """ to_replace = range(1, len(to_search)+1) with open(file, "r+") as f: lines = f.readlines() for i, line in enumerate(lines): lines[i] = ' ' + line.strip('\n') with ...
Search and replace atom_names for numbers
Search and replace atom_names for numbers
[ "Search", "and", "replace", "atom_names", "for", "numbers" ]
def search_and_replace(file, to_search): to_replace = range(1, len(to_search)+1) with open(file, "r+") as f: lines = f.readlines() for i, line in enumerate(lines): lines[i] = ' ' + line.strip('\n') with open(file, "w") as f: f.write('\n'.join(lines)) with open(f...
[ "def", "search_and_replace", "(", "file", ",", "to_search", ")", ":", "to_replace", "=", "range", "(", "1", ",", "len", "(", "to_search", ")", "+", "1", ")", "with", "open", "(", "file", ",", "\"r+\"", ")", "as", "f", ":", "lines", "=", "f", ".", ...
Search and replace atom_names for numbers
[ "Search", "and", "replace", "atom_names", "for", "numbers" ]
[ "\"\"\"\n Search and replace atom_names for numbers\n \"\"\"", "#atom types are like _O1_ (strip)" ]
[ { "param": "file", "type": null }, { "param": "to_search", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "file", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "to_search", "type": null, "docstring": null, "docstring_token...
f83ece907f7197708758b7af3214f61467e7cef1
danielSoler93/FrAG_PELE
frag_pele/Growing/AddingFragHelpers/pdb_joiner.py
[ "MIT" ]
Python
select_atoms_from_list
<not_specific>
def select_atoms_from_list(PDB_atom_name, atoms_list): """ Given a pdb atom name string and a list of atoms (BioPython Atom) it returns the Bio.Atom correspondent to the atom name. :param PDB_atom_name: string with an atom name :param atoms_list: list of Bio.Atoms :return: Bio.Atom correspondent...
Given a pdb atom name string and a list of atoms (BioPython Atom) it returns the Bio.Atom correspondent to the atom name. :param PDB_atom_name: string with an atom name :param atoms_list: list of Bio.Atoms :return: Bio.Atom correspondent to the atom name
Given a pdb atom name string and a list of atoms (BioPython Atom) it returns the Bio.Atom correspondent to the atom name.
[ "Given", "a", "pdb", "atom", "name", "string", "and", "a", "list", "of", "atoms", "(", "BioPython", "Atom", ")", "it", "returns", "the", "Bio", ".", "Atom", "correspondent", "to", "the", "atom", "name", "." ]
def select_atoms_from_list(PDB_atom_name, atoms_list): for atom in atoms_list: if atom.name == PDB_atom_name: return atom
[ "def", "select_atoms_from_list", "(", "PDB_atom_name", ",", "atoms_list", ")", ":", "for", "atom", "in", "atoms_list", ":", "if", "atom", ".", "name", "==", "PDB_atom_name", ":", "return", "atom" ]
Given a pdb atom name string and a list of atoms (BioPython Atom) it returns the Bio.Atom correspondent to the atom name.
[ "Given", "a", "pdb", "atom", "name", "string", "and", "a", "list", "of", "atoms", "(", "BioPython", "Atom", ")", "it", "returns", "the", "Bio", ".", "Atom", "correspondent", "to", "the", "atom", "name", "." ]
[ "\"\"\"\n Given a pdb atom name string and a list of atoms (BioPython Atom) it returns the Bio.Atom correspondent to the atom\n name.\n :param PDB_atom_name: string with an atom name\n :param atoms_list: list of Bio.Atoms\n :return: Bio.Atom correspondent to the atom name\n \"\"\"" ]
[ { "param": "PDB_atom_name", "type": null }, { "param": "atoms_list", "type": null } ]
{ "returns": [ { "docstring": "Bio.Atom correspondent to the atom name", "docstring_tokens": [ "Bio", ".", "Atom", "correspondent", "to", "the", "atom", "name" ], "type": null } ], "raises": [], "params": [ { ...
f83ece907f7197708758b7af3214f61467e7cef1
danielSoler93/FrAG_PELE
frag_pele/Growing/AddingFragHelpers/pdb_joiner.py
[ "MIT" ]
Python
superimpose
<not_specific>
def superimpose(fixed_vector, moving_vector, moving_atom_list): """ Rotates and translates a list of moving atoms from a moving vector to a fixed vector. :param fixed_vector: vector used as reference. :param moving_vector: vector that will rotate and translate. :param moving_atom_list: list of atoms...
Rotates and translates a list of moving atoms from a moving vector to a fixed vector. :param fixed_vector: vector used as reference. :param moving_vector: vector that will rotate and translate. :param moving_atom_list: list of atoms that we want to do the rotation and translation of the moving vector. ...
Rotates and translates a list of moving atoms from a moving vector to a fixed vector.
[ "Rotates", "and", "translates", "a", "list", "of", "moving", "atoms", "from", "a", "moving", "vector", "to", "a", "fixed", "vector", "." ]
def superimpose(fixed_vector, moving_vector, moving_atom_list): sup = bio.Superimposer() sup.set_atoms(fixed_vector, moving_vector) return sup.apply(moving_atom_list)
[ "def", "superimpose", "(", "fixed_vector", ",", "moving_vector", ",", "moving_atom_list", ")", ":", "sup", "=", "bio", ".", "Superimposer", "(", ")", "sup", ".", "set_atoms", "(", "fixed_vector", ",", "moving_vector", ")", "return", "sup", ".", "apply", "(",...
Rotates and translates a list of moving atoms from a moving vector to a fixed vector.
[ "Rotates", "and", "translates", "a", "list", "of", "moving", "atoms", "from", "a", "moving", "vector", "to", "a", "fixed", "vector", "." ]
[ "\"\"\"\n Rotates and translates a list of moving atoms from a moving vector to a fixed vector.\n :param fixed_vector: vector used as reference.\n :param moving_vector: vector that will rotate and translate.\n :param moving_atom_list: list of atoms that we want to do the rotation and translation of the ...
[ { "param": "fixed_vector", "type": null }, { "param": "moving_vector", "type": null }, { "param": "moving_atom_list", "type": null } ]
{ "returns": [ { "docstring": "the input list of atoms is rotated an translated.", "docstring_tokens": [ "the", "input", "list", "of", "atoms", "is", "rotated", "an", "translated", "." ], "type": null } ]...
f83ece907f7197708758b7af3214f61467e7cef1
danielSoler93/FrAG_PELE
frag_pele/Growing/AddingFragHelpers/pdb_joiner.py
[ "MIT" ]
Python
transform_coords
<not_specific>
def transform_coords(atoms_with_coords): """ Transform the coords of a molecule (ProDy selection) into the coords from a list of atoms of Bio.PDB. :param atoms_with_coords: list of atoms (from a Bio.PDB) with the coordinates that we want to set. :return: perform the transformation of the coords. """...
Transform the coords of a molecule (ProDy selection) into the coords from a list of atoms of Bio.PDB. :param atoms_with_coords: list of atoms (from a Bio.PDB) with the coordinates that we want to set. :return: perform the transformation of the coords.
Transform the coords of a molecule (ProDy selection) into the coords from a list of atoms of Bio.PDB.
[ "Transform", "the", "coords", "of", "a", "molecule", "(", "ProDy", "selection", ")", "into", "the", "coords", "from", "a", "list", "of", "atoms", "of", "Bio", ".", "PDB", "." ]
def transform_coords(atoms_with_coords): coords = [] for atom in atoms_with_coords: coords.append(list(atom.get_coord())) return np.asarray(coords)
[ "def", "transform_coords", "(", "atoms_with_coords", ")", ":", "coords", "=", "[", "]", "for", "atom", "in", "atoms_with_coords", ":", "coords", ".", "append", "(", "list", "(", "atom", ".", "get_coord", "(", ")", ")", ")", "return", "np", ".", "asarray"...
Transform the coords of a molecule (ProDy selection) into the coords from a list of atoms of Bio.PDB.
[ "Transform", "the", "coords", "of", "a", "molecule", "(", "ProDy", "selection", ")", "into", "the", "coords", "from", "a", "list", "of", "atoms", "of", "Bio", ".", "PDB", "." ]
[ "\"\"\"\n Transform the coords of a molecule (ProDy selection) into the coords from a list of atoms of Bio.PDB.\n :param atoms_with_coords: list of atoms (from a Bio.PDB) with the coordinates that we want to set.\n :return: perform the transformation of the coords.\n \"\"\"" ]
[ { "param": "atoms_with_coords", "type": null } ]
{ "returns": [ { "docstring": "perform the transformation of the coords.", "docstring_tokens": [ "perform", "the", "transformation", "of", "the", "coords", "." ], "type": null } ], "raises": [], "params": [ { "iden...
f83ece907f7197708758b7af3214f61467e7cef1
danielSoler93/FrAG_PELE
frag_pele/Growing/AddingFragHelpers/pdb_joiner.py
[ "MIT" ]
Python
extract_and_change_atomnames
<not_specific>
def extract_and_change_atomnames(molecule, selected_resname, core_resname, rename=False): """ Given a ProDy molecule and a Resname this function will rename the PDB atom names for the selected residue following the next pattern: G1, G2, G3... :param molecule: ProDy molecule. :param selected_resname:...
Given a ProDy molecule and a Resname this function will rename the PDB atom names for the selected residue following the next pattern: G1, G2, G3... :param molecule: ProDy molecule. :param selected_resname: Residue name whose atoms you would like to rename. :return: ProDy molecule with atoms rename...
Given a ProDy molecule and a Resname this function will rename the PDB atom names for the selected residue following the next pattern: G1, G2, G3
[ "Given", "a", "ProDy", "molecule", "and", "a", "Resname", "this", "function", "will", "rename", "the", "PDB", "atom", "names", "for", "the", "selected", "residue", "following", "the", "next", "pattern", ":", "G1", "G2", "G3" ]
def extract_and_change_atomnames(molecule, selected_resname, core_resname, rename=False): assert selected_resname != core_resname, "core and fragment residue name must be different" fragment = molecule.select("resname {}".format(selected_resname)) core = molecule.select("resname {}".format(core_resname)) ...
[ "def", "extract_and_change_atomnames", "(", "molecule", ",", "selected_resname", ",", "core_resname", ",", "rename", "=", "False", ")", ":", "assert", "selected_resname", "!=", "core_resname", ",", "\"core and fragment residue name must be different\"", "fragment", "=", "...
Given a ProDy molecule and a Resname this function will rename the PDB atom names for the selected residue following the next pattern: G1, G2, G3...
[ "Given", "a", "ProDy", "molecule", "and", "a", "Resname", "this", "function", "will", "rename", "the", "PDB", "atom", "names", "for", "the", "selected", "residue", "following", "the", "next", "pattern", ":", "G1", "G2", "G3", "..." ]
[ "\"\"\"\n Given a ProDy molecule and a Resname this function will rename the PDB atom names for the selected residue following\n the next pattern: G1, G2, G3...\n :param molecule: ProDy molecule.\n :param selected_resname: Residue name whose atoms you would like to rename.\n :return: ProDy molecule w...
[ { "param": "molecule", "type": null }, { "param": "selected_resname", "type": null }, { "param": "core_resname", "type": null }, { "param": "rename", "type": null } ]
{ "returns": [ { "docstring": "ProDy molecule with atoms renamed and dictionary {\"original atom name\" : \"new atom name\"}", "docstring_tokens": [ "ProDy", "molecule", "with", "atoms", "renamed", "and", "dictionary", "{", "\"", ...
f83ece907f7197708758b7af3214f61467e7cef1
danielSoler93/FrAG_PELE
frag_pele/Growing/AddingFragHelpers/pdb_joiner.py
[ "MIT" ]
Python
check_overlapping_names
<not_specific>
def check_overlapping_names(structures_to_bond): """ Checking that there is not duplications in the names of the structure. If not, it will return None, else, it will return the repeated elements. :param structures_to_bond: ProDy molecule :return: set object with the repeated elements if they are fo...
Checking that there is not duplications in the names of the structure. If not, it will return None, else, it will return the repeated elements. :param structures_to_bond: ProDy molecule :return: set object with the repeated elements if they are found. Else, None object.
Checking that there is not duplications in the names of the structure. If not, it will return None, else, it will return the repeated elements.
[ "Checking", "that", "there", "is", "not", "duplications", "in", "the", "names", "of", "the", "structure", ".", "If", "not", "it", "will", "return", "None", "else", "it", "will", "return", "the", "repeated", "elements", "." ]
def check_overlapping_names(structures_to_bond): all_atom_names = list(structures_to_bond.getNames()) return set([name for name in all_atom_names if all_atom_names.count(name) > 1])
[ "def", "check_overlapping_names", "(", "structures_to_bond", ")", ":", "all_atom_names", "=", "list", "(", "structures_to_bond", ".", "getNames", "(", ")", ")", "return", "set", "(", "[", "name", "for", "name", "in", "all_atom_names", "if", "all_atom_names", "."...
Checking that there is not duplications in the names of the structure.
[ "Checking", "that", "there", "is", "not", "duplications", "in", "the", "names", "of", "the", "structure", "." ]
[ "\"\"\"\n Checking that there is not duplications in the names of the structure. If not, it will return None, else, it will\n return the repeated elements.\n :param structures_to_bond: ProDy molecule\n :return: set object with the repeated elements if they are found. Else, None object.\n \"\"\"" ]
[ { "param": "structures_to_bond", "type": null } ]
{ "returns": [ { "docstring": "set object with the repeated elements if they are found. Else, None object.", "docstring_tokens": [ "set", "object", "with", "the", "repeated", "elements", "if", "they", "are", "found", ...
193d01ff30903df4f2afd4b3ce98d31a99546ac1
danielSoler93/FrAG_PELE
frag_pele/Growing/AddingFragHelpers/complex_to_prody.py
[ "MIT" ]
Python
check_protonation
null
def check_protonation(selection): """ Check if the structure is protonated or not. In case that is not protonated we will rise a critical logger. :param selection: prody molecule :return: if not hydrogens detected, prints a message. """ try: if not selection.select("hydrogen"): ...
Check if the structure is protonated or not. In case that is not protonated we will rise a critical logger. :param selection: prody molecule :return: if not hydrogens detected, prints a message.
Check if the structure is protonated or not. In case that is not protonated we will rise a critical logger.
[ "Check", "if", "the", "structure", "is", "protonated", "or", "not", ".", "In", "case", "that", "is", "not", "protonated", "we", "will", "rise", "a", "critical", "logger", "." ]
def check_protonation(selection): try: if not selection.select("hydrogen"): logger.critical("We have not detected Hydrogens in your ligand. Please, add them before starting.") except AttributeError: raise AttributeError("Check ligand and core are in the L chain. Otherwise specify the...
[ "def", "check_protonation", "(", "selection", ")", ":", "try", ":", "if", "not", "selection", ".", "select", "(", "\"hydrogen\"", ")", ":", "logger", ".", "critical", "(", "\"We have not detected Hydrogens in your ligand. Please, add them before starting.\"", ")", "exce...
Check if the structure is protonated or not.
[ "Check", "if", "the", "structure", "is", "protonated", "or", "not", "." ]
[ "\"\"\"\n Check if the structure is protonated or not. In case that is not protonated we will rise a critical logger.\n :param selection: prody molecule\n :return: if not hydrogens detected, prints a message.\n \"\"\"" ]
[ { "param": "selection", "type": null } ]
{ "returns": [ { "docstring": "if not hydrogens detected, prints a message.", "docstring_tokens": [ "if", "not", "hydrogens", "detected", "prints", "a", "message", "." ], "type": null } ], "raises": [], "params": [ ...
0be60fda1e0606185406ce9ce4a97880a2618052
danielSoler93/FrAG_PELE
frag_pele/Analysis/sidecahins_analyser.py
[ "MIT" ]
Python
parse_arguments
<not_specific>
def parse_arguments(): """ Parse user arguments Output: list with all the user arguments """ # All the docstrings are very provisional and some of them are old, they would be changed in further steps!! parser = argparse.ArgumentParser(description="""""") required_named =...
Parse user arguments Output: list with all the user arguments
Parse user arguments Output: list with all the user arguments
[ "Parse", "user", "arguments", "Output", ":", "list", "with", "all", "the", "user", "arguments" ]
def parse_arguments(): parser = argparse.ArgumentParser(description="""""") required_named = parser.add_argument_group('required named arguments') required_named.add_argument("-t", "--type", required=True, choices=['sidechains', 'atom_distances'], help="""Computation type tha...
[ "def", "parse_arguments", "(", ")", ":", "parser", "=", "argparse", ".", "ArgumentParser", "(", "description", "=", "\"\"\"\"\"\"", ")", "required_named", "=", "parser", ".", "add_argument_group", "(", "'required named arguments'", ")", "required_named", ".", "add_a...
Parse user arguments Output: list with all the user arguments
[ "Parse", "user", "arguments", "Output", ":", "list", "with", "all", "the", "user", "arguments" ]
[ "\"\"\"\n Parse user arguments\n\n Output: list with all the user arguments\n \"\"\"", "# All the docstrings are very provisional and some of them are old, they would be changed in further steps!!", "# Growing related arguments" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
0be60fda1e0606185406ce9ce4a97880a2618052
danielSoler93/FrAG_PELE
frag_pele/Analysis/sidecahins_analyser.py
[ "MIT" ]
Python
compute_atom_distances
<not_specific>
def compute_atom_distances(pdb_target, res_file, output_report, chain="L"): """ This function calculate atom-atom distances for ligand and residue atoms. The residue number and atom names (for both, ligand and residue) must be specified in a file ('res_file'). :param pdb_target: input PDB file path ...
This function calculate atom-atom distances for ligand and residue atoms. The residue number and atom names (for both, ligand and residue) must be specified in a file ('res_file'). :param pdb_target: input PDB file path :param res_file: file with instructions. This file must have n rows with three form...
This function calculate atom-atom distances for ligand and residue atoms. The residue number and atom names (for both, ligand and residue) must be specified in a file ('res_file').
[ "This", "function", "calculate", "atom", "-", "atom", "distances", "for", "ligand", "and", "residue", "atoms", ".", "The", "residue", "number", "and", "atom", "names", "(", "for", "both", "ligand", "and", "residue", ")", "must", "be", "specified", "in", "a...
def compute_atom_distances(pdb_target, res_file, output_report, chain="L"): target = pdb2prody(pdb_target) ligand = target.select("chain {}".format(chain)) print(ligand.getNames()) list_of_instructions = read_selecteds_from_file(res_file) report = [] for line in list_of_instructions: res...
[ "def", "compute_atom_distances", "(", "pdb_target", ",", "res_file", ",", "output_report", ",", "chain", "=", "\"L\"", ")", ":", "target", "=", "pdb2prody", "(", "pdb_target", ")", "ligand", "=", "target", ".", "select", "(", "\"chain {}\"", ".", "format", "...
This function calculate atom-atom distances for ligand and residue atoms.
[ "This", "function", "calculate", "atom", "-", "atom", "distances", "for", "ligand", "and", "residue", "atoms", "." ]
[ "\"\"\"\n This function calculate atom-atom distances for ligand and residue atoms. The residue number and atom names\n (for both, ligand and residue) must be specified in a file ('res_file').\n :param pdb_target: input PDB file path\n :param res_file: file with instructions. This file must have n rows ...
[ { "param": "pdb_target", "type": null }, { "param": "res_file", "type": null }, { "param": "output_report", "type": null }, { "param": "chain", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "pdb_target", "type": null, "docstring": "input PDB file path", "docstring_tokens": [ "input", "PDB"...
a2b1605f9b9bdf60890a9916fcf32bedbd3db037
danielSoler93/FrAG_PELE
frag_pele/PlopRotTemp_S_2017/ligand_prep.py
[ "MIT" ]
Python
convert_mae
<not_specific>
def convert_mae(ligands): """ Desciption: From each structure retrieve a .mae file of the ligand in the receptor. Output: structure_mae: ligand res = residue """ for structure in st.StructureReader(ligands): for residue in structure.residue: ...
Desciption: From each structure retrieve a .mae file of the ligand in the receptor. Output: structure_mae: ligand res = residue
From each structure retrieve a .mae file of the ligand in the receptor. Output: structure_mae: ligand res = residue
[ "From", "each", "structure", "retrieve", "a", ".", "mae", "file", "of", "the", "ligand", "in", "the", "receptor", ".", "Output", ":", "structure_mae", ":", "ligand", "res", "=", "residue" ]
def convert_mae(ligands): for structure in st.StructureReader(ligands): for residue in structure.residue: res = residue.pdbres.strip() str_name = "{}".format(res) try: structure.write(str_name + ".mae") except ValueError: str_name = "{}".format(res...
[ "def", "convert_mae", "(", "ligands", ")", ":", "for", "structure", "in", "st", ".", "StructureReader", "(", "ligands", ")", ":", "for", "residue", "in", "structure", ".", "residue", ":", "res", "=", "residue", ".", "pdbres", ".", "strip", "(", ")", "s...
Desciption: From each structure retrieve a .mae file of the ligand in the receptor.
[ "Desciption", ":", "From", "each", "structure", "retrieve", "a", ".", "mae", "file", "of", "the", "ligand", "in", "the", "receptor", "." ]
[ "\"\"\"\n Desciption: From each structure retrieve\n a .mae file of the ligand in the receptor.\n Output:\n structure_mae: ligand\n res = residue\n \"\"\"" ]
[ { "param": "ligands", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "ligands", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
6a56c669d8f84e72b33f572c74814a7a9aa693f8
danielSoler93/FrAG_PELE
frag_pele/Analysis/analyser.py
[ "MIT" ]
Python
parse_arguments
<not_specific>
def parse_arguments(): """ Parse user arguments Output: list with all the user arguments """ # All the docstrings are very provisional and some of them are old, they would be changed in further steps!! parser = argparse.ArgumentParser(description="""Computes the mean of the ...
Parse user arguments Output: list with all the user arguments
Parse user arguments Output: list with all the user arguments
[ "Parse", "user", "arguments", "Output", ":", "list", "with", "all", "the", "user", "arguments" ]
def parse_arguments(): parser = argparse.ArgumentParser(description="""Computes the mean of the 25% lowest values of the sampling simulation for each fragment grown. """) required_named = parser.add_argument_group('required named arguments') required_named.add_argument("path_to_analyze", ...
[ "def", "parse_arguments", "(", ")", ":", "parser", "=", "argparse", ".", "ArgumentParser", "(", "description", "=", "\"\"\"Computes the mean of the 25% lowest values of the sampling simulation\n for each fragment grown. \"\"\"", ")", "required_named", "=", "parser", ".", "ad...
Parse user arguments Output: list with all the user arguments
[ "Parse", "user", "arguments", "Output", ":", "list", "with", "all", "the", "user", "arguments" ]
[ "\"\"\"\n Parse user arguments\n\n Output: list with all the user arguments\n \"\"\"", "# All the docstrings are very provisional and some of them are old, they would be changed in further steps!!", "# Growing related arguments" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
6a56c669d8f84e72b33f572c74814a7a9aa693f8
danielSoler93/FrAG_PELE
frag_pele/Analysis/analyser.py
[ "MIT" ]
Python
pele_report2pandas
<not_specific>
def pele_report2pandas(path, export=True): """ This function merge the content of different report for PELE simulations in a single file pandas Data Frame. """ data = [] report_list = glob.glob('{}*'.format(path)) for report in report_list: tmp_data = pd.read_csv(report, sep=' ', ...
This function merge the content of different report for PELE simulations in a single file pandas Data Frame.
This function merge the content of different report for PELE simulations in a single file pandas Data Frame.
[ "This", "function", "merge", "the", "content", "of", "different", "report", "for", "PELE", "simulations", "in", "a", "single", "file", "pandas", "Data", "Frame", "." ]
def pele_report2pandas(path, export=True): data = [] report_list = glob.glob('{}*'.format(path)) for report in report_list: tmp_data = pd.read_csv(report, sep=' ', engine='python') tmp_data = tmp_data.iloc[1:] processor = re.findall('\d+$'.format(path), report) tmp_data[...
[ "def", "pele_report2pandas", "(", "path", ",", "export", "=", "True", ")", ":", "data", "=", "[", "]", "report_list", "=", "glob", ".", "glob", "(", "'{}*'", ".", "format", "(", "path", ")", ")", "for", "report", "in", "report_list", ":", "tmp_data", ...
This function merge the content of different report for PELE simulations in a single file pandas Data Frame.
[ "This", "function", "merge", "the", "content", "of", "different", "report", "for", "PELE", "simulations", "in", "a", "single", "file", "pandas", "Data", "Frame", "." ]
[ "\"\"\"\n This function merge the content of different report for PELE simulations in a single file pandas Data Frame.\n \"\"\"", "# We must discard the first row" ]
[ { "param": "path", "type": null }, { "param": "export", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "path", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "export", "type": null, "docstring": null, "docstring_tokens":...
6a56c669d8f84e72b33f572c74814a7a9aa693f8
danielSoler93/FrAG_PELE
frag_pele/Analysis/analyser.py
[ "MIT" ]
Python
select_subset_by_steps
<not_specific>
def select_subset_by_steps(dataframe, steps): """ Given a pandas dataframe from PELE's result it returns a subset of n PELE steps. :param dataframe: pandas object :param steps: int :return: dataframe """ subset = dataframe[dataframe['Step'] <= int(steps)] return subset
Given a pandas dataframe from PELE's result it returns a subset of n PELE steps. :param dataframe: pandas object :param steps: int :return: dataframe
Given a pandas dataframe from PELE's result it returns a subset of n PELE steps.
[ "Given", "a", "pandas", "dataframe", "from", "PELE", "'", "s", "result", "it", "returns", "a", "subset", "of", "n", "PELE", "steps", "." ]
def select_subset_by_steps(dataframe, steps): subset = dataframe[dataframe['Step'] <= int(steps)] return subset
[ "def", "select_subset_by_steps", "(", "dataframe", ",", "steps", ")", ":", "subset", "=", "dataframe", "[", "dataframe", "[", "'Step'", "]", "<=", "int", "(", "steps", ")", "]", "return", "subset" ]
Given a pandas dataframe from PELE's result it returns a subset of n PELE steps.
[ "Given", "a", "pandas", "dataframe", "from", "PELE", "'", "s", "result", "it", "returns", "a", "subset", "of", "n", "PELE", "steps", "." ]
[ "\"\"\"\n Given a pandas dataframe from PELE's result it returns a subset of n PELE steps.\n :param dataframe: pandas object\n :param steps: int\n :return: dataframe\n \"\"\"" ]
[ { "param": "dataframe", "type": null }, { "param": "steps", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "dataframe", "type": null, "docstring": null, "docstring_tokens": [ "None" ], "default": null, ...
b630df9c5ff922ae04c19d48ca782484cd342686
danielSoler93/FrAG_PELE
frag_pele/Analysis/backtrackConnectivity.py
[ "MIT" ]
Python
parse_arguments
<not_specific>
def parse_arguments(): """ Parse the command-line options :returns: str, str, str -- path to file to backtrack, output path where to write the files, name of the files """ desc = "Adds the connectivity information to a trajectory file that does not have it.\n" parser = argp...
Parse the command-line options :returns: str, str, str -- path to file to backtrack, output path where to write the files, name of the files
Parse the command-line options
[ "Parse", "the", "command", "-", "line", "options" ]
def parse_arguments(): desc = "Adds the connectivity information to a trajectory file that does not have it.\n" parser = argparse.ArgumentParser(description=desc) parser.add_argument("pathway", type=str, help="Trajectory file with the backtracked pathway.") parser.add_argument("pdb_with_connects", type=...
[ "def", "parse_arguments", "(", ")", ":", "desc", "=", "\"Adds the connectivity information to a trajectory file that does not have it.\\n\"", "parser", "=", "argparse", ".", "ArgumentParser", "(", "description", "=", "desc", ")", "parser", ".", "add_argument", "(", "\"pat...
Parse the command-line options
[ "Parse", "the", "command", "-", "line", "options" ]
[ "\"\"\"\n Parse the command-line options\n\n :returns: str, str, str -- path to file to backtrack,\n output path where to write the files, name of the files\n \"\"\"" ]
[]
{ "returns": [ { "docstring": "str, str, str -- path to file to backtrack,\noutput path where to write the files, name of the files", "docstring_tokens": [ "str", "str", "str", "--", "path", "to", "file", "to", "backtrack", ...
3e123b03d484cc398bba008aa6c2307dbc6a5cbb
danielSoler93/FrAG_PELE
frag_pele/Growing/add_fragment_from_pdbs.py
[ "MIT" ]
Python
extract_atoms_pdbs
<not_specific>
def extract_atoms_pdbs(pdb, create_file=True, chain="L", resnum=None, get_atoms=False, output_folder="."): """ From a pdb file, it extracts the chain L and checks if the structure has hydrogens. After that, the chain L is written in a new PDB file which will have the following format: "{residue name}.pdb". ...
From a pdb file, it extracts the chain L and checks if the structure has hydrogens. After that, the chain L is written in a new PDB file which will have the following format: "{residue name}.pdb". :param pdb: pdb file (with a ligand in the chain L). :return: Writes a new pdb file "{residue name}.pdb" w...
From a pdb file, it extracts the chain L and checks if the structure has hydrogens. After that, the chain L is written in a new PDB file which will have the following format: "{residue name}.pdb".
[ "From", "a", "pdb", "file", "it", "extracts", "the", "chain", "L", "and", "checks", "if", "the", "structure", "has", "hydrogens", ".", "After", "that", "the", "chain", "L", "is", "written", "in", "a", "new", "PDB", "file", "which", "will", "have", "the...
def extract_atoms_pdbs(pdb, create_file=True, chain="L", resnum=None, get_atoms=False, output_folder="."): if not resnum: selection = complex_to_prody.pdb_parser_ligand(pdb, chain) else: selection = complex_to_prody.pdb_parser_residue(pdb, chain, resnum) if selection is None: raise T...
[ "def", "extract_atoms_pdbs", "(", "pdb", ",", "create_file", "=", "True", ",", "chain", "=", "\"L\"", ",", "resnum", "=", "None", ",", "get_atoms", "=", "False", ",", "output_folder", "=", "\".\"", ")", ":", "if", "not", "resnum", ":", "selection", "=", ...
From a pdb file, it extracts the chain L and checks if the structure has hydrogens.
[ "From", "a", "pdb", "file", "it", "extracts", "the", "chain", "L", "and", "checks", "if", "the", "structure", "has", "hydrogens", "." ]
[ "\"\"\"\n From a pdb file, it extracts the chain L and checks if the structure has hydrogens. After that, the chain L is\n written in a new PDB file which will have the following format: \"{residue name}.pdb\".\n :param pdb: pdb file (with a ligand in the chain L).\n :return: Writes a new pdb file \"{re...
[ { "param": "pdb", "type": null }, { "param": "create_file", "type": null }, { "param": "chain", "type": null }, { "param": "resnum", "type": null }, { "param": "get_atoms", "type": null }, { "param": "output_folder", "type": null } ]
{ "returns": [ { "docstring": "Writes a new pdb file \"{residue name}.pdb\" with the chain L isolated an returns the residue name (string).", "docstring_tokens": [ "Writes", "a", "new", "pdb", "file", "\"", "{", "residue", "name",...
3e123b03d484cc398bba008aa6c2307dbc6a5cbb
danielSoler93/FrAG_PELE
frag_pele/Growing/add_fragment_from_pdbs.py
[ "MIT" ]
Python
from_pdb_to_bioatomlist
<not_specific>
def from_pdb_to_bioatomlist(list_of_pdb_names): """ Given a pdb name string (without the extension ".pdb") the function reads it as a Bio.PDB structure and extract the atoms found as a list of Bio.PDB.Atom objects. :param list_of_pdb_names: list of strings with pdb names. :return: list of lists with...
Given a pdb name string (without the extension ".pdb") the function reads it as a Bio.PDB structure and extract the atoms found as a list of Bio.PDB.Atom objects. :param list_of_pdb_names: list of strings with pdb names. :return: list of lists with the Bio.PDB.Atom objects found in each pdb file.
Given a pdb name string (without the extension ".pdb") the function reads it as a Bio.PDB structure and extract the atoms found as a list of Bio.PDB.Atom objects.
[ "Given", "a", "pdb", "name", "string", "(", "without", "the", "extension", "\"", ".", "pdb", "\"", ")", "the", "function", "reads", "it", "as", "a", "Bio", ".", "PDB", "structure", "and", "extract", "the", "atoms", "found", "as", "a", "list", "of", "...
def from_pdb_to_bioatomlist(list_of_pdb_names): list_of_lists = [] for pdb in list_of_pdb_names: bio_structure = pdb_joiner.get_ligand_from_PDB("{}.pdb".format(pdb)) bioatomlist = pdb_joiner.get_atoms_from_structure(bio_structure) list_of_lists.append(bioatomlist) return list_of_list...
[ "def", "from_pdb_to_bioatomlist", "(", "list_of_pdb_names", ")", ":", "list_of_lists", "=", "[", "]", "for", "pdb", "in", "list_of_pdb_names", ":", "bio_structure", "=", "pdb_joiner", ".", "get_ligand_from_PDB", "(", "\"{}.pdb\"", ".", "format", "(", "pdb", ")", ...
Given a pdb name string (without the extension ".pdb") the function reads it as a Bio.PDB structure and extract the atoms found as a list of Bio.PDB.Atom objects.
[ "Given", "a", "pdb", "name", "string", "(", "without", "the", "extension", "\"", ".", "pdb", "\"", ")", "the", "function", "reads", "it", "as", "a", "Bio", ".", "PDB", "structure", "and", "extract", "the", "atoms", "found", "as", "a", "list", "of", "...
[ "\"\"\"\n Given a pdb name string (without the extension \".pdb\") the function reads it as a Bio.PDB structure and extract the\n atoms found as a list of Bio.PDB.Atom objects.\n :param list_of_pdb_names: list of strings with pdb names.\n :return: list of lists with the Bio.PDB.Atom objects found in eac...
[ { "param": "list_of_pdb_names", "type": null } ]
{ "returns": [ { "docstring": "list of lists with the Bio.PDB.Atom objects found in each pdb file.", "docstring_tokens": [ "list", "of", "lists", "with", "the", "Bio", ".", "PDB", ".", "Atom", "objects", "f...
3e123b03d484cc398bba008aa6c2307dbc6a5cbb
danielSoler93/FrAG_PELE
frag_pele/Growing/add_fragment_from_pdbs.py
[ "MIT" ]
Python
extract_heavy_atoms
<not_specific>
def extract_heavy_atoms(pdb_atom_names, lists_of_bioatoms): """ Given a heavy atom name (string) and a list of Bio.PDB.Atom objects, it selects this atom of the list and return it as a single object. :param pdb_atom_names: heavy atom name (string). :param lists_of_bioatoms: list of Bio.PDB.Atom obje...
Given a heavy atom name (string) and a list of Bio.PDB.Atom objects, it selects this atom of the list and return it as a single object. :param pdb_atom_names: heavy atom name (string). :param lists_of_bioatoms: list of Bio.PDB.Atom objects. :return: Bio.PDB.Atom object correspondent to the heavy at...
Given a heavy atom name (string) and a list of Bio.PDB.Atom objects, it selects this atom of the list and return it as a single object.
[ "Given", "a", "heavy", "atom", "name", "(", "string", ")", "and", "a", "list", "of", "Bio", ".", "PDB", ".", "Atom", "objects", "it", "selects", "this", "atom", "of", "the", "list", "and", "return", "it", "as", "a", "single", "object", "." ]
def extract_heavy_atoms(pdb_atom_names, lists_of_bioatoms): heavy_atoms = [] for atom_name, list_of_bioatoms in zip(pdb_atom_names, lists_of_bioatoms): atom_heavy = pdb_joiner.select_atoms_from_list(atom_name, list_of_bioatoms) heavy_atoms.append(atom_heavy) return heavy_atoms
[ "def", "extract_heavy_atoms", "(", "pdb_atom_names", ",", "lists_of_bioatoms", ")", ":", "heavy_atoms", "=", "[", "]", "for", "atom_name", ",", "list_of_bioatoms", "in", "zip", "(", "pdb_atom_names", ",", "lists_of_bioatoms", ")", ":", "atom_heavy", "=", "pdb_join...
Given a heavy atom name (string) and a list of Bio.PDB.Atom objects, it selects this atom of the list and return it as a single object.
[ "Given", "a", "heavy", "atom", "name", "(", "string", ")", "and", "a", "list", "of", "Bio", ".", "PDB", ".", "Atom", "objects", "it", "selects", "this", "atom", "of", "the", "list", "and", "return", "it", "as", "a", "single", "object", "." ]
[ "\"\"\"\n Given a heavy atom name (string) and a list of Bio.PDB.Atom objects, it selects this atom of the list and return it\n as a single object.\n :param pdb_atom_names: heavy atom name (string).\n :param lists_of_bioatoms: list of Bio.PDB.Atom objects.\n :return: Bio.PDB.Atom object correspondent...
[ { "param": "pdb_atom_names", "type": null }, { "param": "lists_of_bioatoms", "type": null } ]
{ "returns": [ { "docstring": "Bio.PDB.Atom object correspondent to the heavy atom name.", "docstring_tokens": [ "Bio", ".", "PDB", ".", "Atom", "object", "correspondent", "to", "the", "heavy", "atom", "nam...
3e123b03d484cc398bba008aa6c2307dbc6a5cbb
danielSoler93/FrAG_PELE
frag_pele/Growing/add_fragment_from_pdbs.py
[ "MIT" ]
Python
extract_hydrogens
<not_specific>
def extract_hydrogens(pdb_atom_names, lists_of_bioatoms, list_of_pdbs, h_core=None, h_frag=None, c_chain="L", f_chain="L", c_resnum=None, f_resnum=None): """ Given a heavy atom name (string), a list of Bio.PDB.Atoms objects and a list of pdb files, it returns the hydrogens at bonding d...
Given a heavy atom name (string), a list of Bio.PDB.Atoms objects and a list of pdb files, it returns the hydrogens at bonding distance of the heavy atom. If there is more than one, a checking of contacts with the protein will be performed. In case of finding a possible contact between the hydrogen and the...
Given a heavy atom name (string), a list of Bio.PDB.Atoms objects and a list of pdb files, it returns the hydrogens at bonding distance of the heavy atom. If there is more than one, a checking of contacts with the protein will be performed. In case of finding a possible contact between the hydrogen and the protein, we ...
[ "Given", "a", "heavy", "atom", "name", "(", "string", ")", "a", "list", "of", "Bio", ".", "PDB", ".", "Atoms", "objects", "and", "a", "list", "of", "pdb", "files", "it", "returns", "the", "hydrogens", "at", "bonding", "distance", "of", "the", "heavy", ...
def extract_hydrogens(pdb_atom_names, lists_of_bioatoms, list_of_pdbs, h_core=None, h_frag=None, c_chain="L", f_chain="L", c_resnum=None, f_resnum=None): hydrogens = [] selected_hydrogens = [h_core, h_frag] chains = [c_chain, f_chain] resnums = [c_resnum, f_resnum] for atom_nam...
[ "def", "extract_hydrogens", "(", "pdb_atom_names", ",", "lists_of_bioatoms", ",", "list_of_pdbs", ",", "h_core", "=", "None", ",", "h_frag", "=", "None", ",", "c_chain", "=", "\"L\"", ",", "f_chain", "=", "\"L\"", ",", "c_resnum", "=", "None", ",", "f_resnum...
Given a heavy atom name (string), a list of Bio.PDB.Atoms objects and a list of pdb files, it returns the hydrogens at bonding distance of the heavy atom.
[ "Given", "a", "heavy", "atom", "name", "(", "string", ")", "a", "list", "of", "Bio", ".", "PDB", ".", "Atoms", "objects", "and", "a", "list", "of", "pdb", "files", "it", "returns", "the", "hydrogens", "at", "bonding", "distance", "of", "the", "heavy", ...
[ "\"\"\"\n Given a heavy atom name (string), a list of Bio.PDB.Atoms objects and a list of pdb files, it returns the hydrogens\n at bonding distance of the heavy atom. If there is more than one, a checking of contacts with the\n protein will be performed. In case of finding a possible contact between the hy...
[ { "param": "pdb_atom_names", "type": null }, { "param": "lists_of_bioatoms", "type": null }, { "param": "list_of_pdbs", "type": null }, { "param": "h_core", "type": null }, { "param": "h_frag", "type": null }, { "param": "c_chain", "type": null }...
{ "returns": [ { "docstring": "Bio.PDB.Atom object correspondent to the hydrogen bonded to the heavy atom", "docstring_tokens": [ "Bio", ".", "PDB", ".", "Atom", "object", "correspondent", "to", "the", "hydrogen", ...
3e123b03d484cc398bba008aa6c2307dbc6a5cbb
danielSoler93/FrAG_PELE
frag_pele/Growing/add_fragment_from_pdbs.py
[ "MIT" ]
Python
transform_coords_from_bio2prody
<not_specific>
def transform_coords_from_bio2prody(fragment_prody, bioatom_list): """ Given a fragment (prody molecule object) and a list of Bio.PDB.Atom objects correspondent to this fragment, it replace the coordinates of the prody molecule for the ones of the list of Bio.PDB.Atom objects and returns the new coordin...
Given a fragment (prody molecule object) and a list of Bio.PDB.Atom objects correspondent to this fragment, it replace the coordinates of the prody molecule for the ones of the list of Bio.PDB.Atom objects and returns the new coordinates. :param fragment_prody: prody molecule object. :param bioatom...
Given a fragment (prody molecule object) and a list of Bio.PDB.Atom objects correspondent to this fragment, it replace the coordinates of the prody molecule for the ones of the list of Bio.PDB.Atom objects and returns the new coordinates.
[ "Given", "a", "fragment", "(", "prody", "molecule", "object", ")", "and", "a", "list", "of", "Bio", ".", "PDB", ".", "Atom", "objects", "correspondent", "to", "this", "fragment", "it", "replace", "the", "coordinates", "of", "the", "prody", "molecule", "for...
def transform_coords_from_bio2prody(fragment_prody, bioatom_list): fragment_coords = pdb_joiner.transform_coords(bioatom_list) fragment_prody.setCoords(fragment_coords) return fragment_prody.getCoords()
[ "def", "transform_coords_from_bio2prody", "(", "fragment_prody", ",", "bioatom_list", ")", ":", "fragment_coords", "=", "pdb_joiner", ".", "transform_coords", "(", "bioatom_list", ")", "fragment_prody", ".", "setCoords", "(", "fragment_coords", ")", "return", "fragment_...
Given a fragment (prody molecule object) and a list of Bio.PDB.Atom objects correspondent to this fragment, it replace the coordinates of the prody molecule for the ones of the list of Bio.PDB.Atom objects and returns the new coordinates.
[ "Given", "a", "fragment", "(", "prody", "molecule", "object", ")", "and", "a", "list", "of", "Bio", ".", "PDB", ".", "Atom", "objects", "correspondent", "to", "this", "fragment", "it", "replace", "the", "coordinates", "of", "the", "prody", "molecule", "for...
[ "\"\"\"\n Given a fragment (prody molecule object) and a list of Bio.PDB.Atom objects correspondent to this fragment, it\n replace the coordinates of the prody molecule for the ones of the list of Bio.PDB.Atom objects and returns the new\n coordinates.\n :param fragment_prody: prody molecule object.\n ...
[ { "param": "fragment_prody", "type": null }, { "param": "bioatom_list", "type": null } ]
{ "returns": [ { "docstring": "array with the new coordinates of the prody molecule object.", "docstring_tokens": [ "array", "with", "the", "new", "coordinates", "of", "the", "prody", "molecule", "object", "." ...
3e123b03d484cc398bba008aa6c2307dbc6a5cbb
danielSoler93/FrAG_PELE
frag_pele/Growing/add_fragment_from_pdbs.py
[ "MIT" ]
Python
bond
<not_specific>
def bond(hydrogen_atom_names, molecules): """ Given a list with names of hydrogens (bonded to the heavy atoms that we want to link) and a list of molecules (prody molecule object), this function errase this hydrogens and bond the heavy atoms linked to them. In order to create this new bond we concatenat...
Given a list with names of hydrogens (bonded to the heavy atoms that we want to link) and a list of molecules (prody molecule object), this function errase this hydrogens and bond the heavy atoms linked to them. In order to create this new bond we concatenate the pairs of molecules (prody molecule object)....
Given a list with names of hydrogens (bonded to the heavy atoms that we want to link) and a list of molecules (prody molecule object), this function errase this hydrogens and bond the heavy atoms linked to them. In order to create this new bond we concatenate the pairs of molecules (prody molecule object). Note that th...
[ "Given", "a", "list", "with", "names", "of", "hydrogens", "(", "bonded", "to", "the", "heavy", "atoms", "that", "we", "want", "to", "link", ")", "and", "a", "list", "of", "molecules", "(", "prody", "molecule", "object", ")", "this", "function", "errase",...
def bond(hydrogen_atom_names, molecules): list_of_pairs = [] for hydrogen, molecule in zip(hydrogen_atom_names, molecules): mol_no_h = molecule.select("not name {}".format(hydrogen)) list_of_pairs.append(mol_no_h) i = 0 bonds = [] while i < len(list_of_pairs): merged = list_o...
[ "def", "bond", "(", "hydrogen_atom_names", ",", "molecules", ")", ":", "list_of_pairs", "=", "[", "]", "for", "hydrogen", ",", "molecule", "in", "zip", "(", "hydrogen_atom_names", ",", "molecules", ")", ":", "mol_no_h", "=", "molecule", ".", "select", "(", ...
Given a list with names of hydrogens (bonded to the heavy atoms that we want to link) and a list of molecules (prody molecule object), this function errase this hydrogens and bond the heavy atoms linked to them.
[ "Given", "a", "list", "with", "names", "of", "hydrogens", "(", "bonded", "to", "the", "heavy", "atoms", "that", "we", "want", "to", "link", ")", "and", "a", "list", "of", "molecules", "(", "prody", "molecule", "object", ")", "this", "function", "errase",...
[ "\"\"\"\n Given a list with names of hydrogens (bonded to the heavy atoms that we want to link) and a list of molecules (prody\n molecule object), this function errase this hydrogens and bond the heavy atoms linked to them. In order to create\n this new bond we concatenate the pairs of molecules (prody mol...
[ { "param": "hydrogen_atom_names", "type": null }, { "param": "molecules", "type": null } ]
{ "returns": [ { "docstring": "list of prody molecule objects as a result of merging the pairs of molecules.", "docstring_tokens": [ "list", "of", "prody", "molecule", "objects", "as", "a", "result", "of", "merging", ...
3e123b03d484cc398bba008aa6c2307dbc6a5cbb
danielSoler93/FrAG_PELE
frag_pele/Growing/add_fragment_from_pdbs.py
[ "MIT" ]
Python
join_structures_to_rotate
<not_specific>
def join_structures_to_rotate(core_bond, fragment_bond, list_of_atoms, core_structure, fragment_structure): """ It joins two ProDy structures into a single one, merging both bonds (core bond and fragment bond) creating a unique bond between the molecules. In order to do that this function performs a cross s...
It joins two ProDy structures into a single one, merging both bonds (core bond and fragment bond) creating a unique bond between the molecules. In order to do that this function performs a cross superimposition (in BioPython) of the whole fragment using as reference (fixed part) the atoms of the bond. Then...
It joins two ProDy structures into a single one, merging both bonds (core bond and fragment bond) creating a unique bond between the molecules. In order to do that this function performs a cross superimposition (in BioPython) of the whole fragment using as reference (fixed part) the atoms of the bond. Then, it transfor...
[ "It", "joins", "two", "ProDy", "structures", "into", "a", "single", "one", "merging", "both", "bonds", "(", "core", "bond", "and", "fragment", "bond", ")", "creating", "a", "unique", "bond", "between", "the", "molecules", ".", "In", "order", "to", "do", ...
def join_structures_to_rotate(core_bond, fragment_bond, list_of_atoms, core_structure, fragment_structure): pdb_joiner.superimpose(core_bond, fragment_bond, list_of_atoms) transform_coords_from_bio2prody(fragment_structure, list_of_atoms) h_atom_names = [core_bond[1].name, fragment_bond[0].name] merged_...
[ "def", "join_structures_to_rotate", "(", "core_bond", ",", "fragment_bond", ",", "list_of_atoms", ",", "core_structure", ",", "fragment_structure", ")", ":", "pdb_joiner", ".", "superimpose", "(", "core_bond", ",", "fragment_bond", ",", "list_of_atoms", ")", "transfor...
It joins two ProDy structures into a single one, merging both bonds (core bond and fragment bond) creating a unique bond between the molecules.
[ "It", "joins", "two", "ProDy", "structures", "into", "a", "single", "one", "merging", "both", "bonds", "(", "core", "bond", "and", "fragment", "bond", ")", "creating", "a", "unique", "bond", "between", "the", "molecules", "." ]
[ "\"\"\"\n It joins two ProDy structures into a single one, merging both bonds (core bond and fragment bond) creating a unique\n bond between the molecules. In order to do that this function performs a cross superimposition (in BioPython) of\n the whole fragment using as reference (fixed part) the atoms of ...
[ { "param": "core_bond", "type": null }, { "param": "fragment_bond", "type": null }, { "param": "list_of_atoms", "type": null }, { "param": "core_structure", "type": null }, { "param": "fragment_structure", "type": null } ]
{ "returns": [ { "docstring": "ProDy molecule with the core_structure and the fragment_structure (with the coordinates modified)\nconcatenated.", "docstring_tokens": [ "ProDy", "molecule", "with", "the", "core_structure", "and", "the", "f...
3e123b03d484cc398bba008aa6c2307dbc6a5cbb
danielSoler93/FrAG_PELE
frag_pele/Growing/add_fragment_from_pdbs.py
[ "MIT" ]
Python
join_structures
<not_specific>
def join_structures(core_bond, fragment_bond, core_structure, fragment_structure, pdb_complex, pdb_fragment, chain_complex, chain_fragment, output_path, only_grow=False, core_resnum=None): """ It joins two ProDy structures into a single one, merging both bonds (core bond ...
It joins two ProDy structures into a single one, merging both bonds (core bond and fragment bond) creating a unique bond between the molecules. In order to do that this function performs a cross superimposition (in BioPython) of the whole fragment using as reference (fixed part) the atoms of the bond. Then...
It joins two ProDy structures into a single one, merging both bonds (core bond and fragment bond) creating a unique bond between the molecules. In order to do that this function performs a cross superimposition (in BioPython) of the whole fragment using as reference (fixed part) the atoms of the bond. Then, it transfor...
[ "It", "joins", "two", "ProDy", "structures", "into", "a", "single", "one", "merging", "both", "bonds", "(", "core", "bond", "and", "fragment", "bond", ")", "creating", "a", "unique", "bond", "between", "the", "molecules", ".", "In", "order", "to", "do", ...
def join_structures(core_bond, fragment_bond, core_structure, fragment_structure, pdb_complex, pdb_fragment, chain_complex, chain_fragment, output_path, only_grow=False, core_resnum=None): name_to_replace_core = core_bond[1].name name_to_replace_fragment = fragment_bond[0...
[ "def", "join_structures", "(", "core_bond", ",", "fragment_bond", ",", "core_structure", ",", "fragment_structure", ",", "pdb_complex", ",", "pdb_fragment", ",", "chain_complex", ",", "chain_fragment", ",", "output_path", ",", "only_grow", "=", "False", ",", "core_r...
It joins two ProDy structures into a single one, merging both bonds (core bond and fragment bond) creating a unique bond between the molecules.
[ "It", "joins", "two", "ProDy", "structures", "into", "a", "single", "one", "merging", "both", "bonds", "(", "core", "bond", "and", "fragment", "bond", ")", "creating", "a", "unique", "bond", "between", "the", "molecules", "." ]
[ "\"\"\"\n It joins two ProDy structures into a single one, merging both bonds (core bond and fragment bond) creating a unique\n bond between the molecules. In order to do that this function performs a cross superimposition (in BioPython) of\n the whole fragment using as reference (fixed part) the atoms of ...
[ { "param": "core_bond", "type": null }, { "param": "fragment_bond", "type": null }, { "param": "core_structure", "type": null }, { "param": "fragment_structure", "type": null }, { "param": "pdb_complex", "type": null }, { "param": "pdb_fragment", "...
{ "returns": [ { "docstring": "ProDy molecule with the core_structure and the fragment_structure (with the coordinates modified)\nconcatenated.", "docstring_tokens": [ "ProDy", "molecule", "with", "the", "core_structure", "and", "the", "f...
3e123b03d484cc398bba008aa6c2307dbc6a5cbb
danielSoler93/FrAG_PELE
frag_pele/Growing/add_fragment_from_pdbs.py
[ "MIT" ]
Python
rotation_thought_axis
<not_specific>
def rotation_thought_axis(bond, theta, core_bond, list_of_atoms, fragment_bond, core_structure, fragment_structure, pdb_complex, pdb_fragment, chain_complex, chain_fragment, output_path, only_grow=False): """ Given a core molecule and a fragment, this function rotates the fragment atom...
Given a core molecule and a fragment, this function rotates the fragment atoms a certain theta angle around an axis (set by the bond). :param bond: Bio.PDB.Atom list composed by two elements: [heavy atom of the core, heavy atom of the fragment] :param theta: Rotation angle in rads. :param core_bond...
Given a core molecule and a fragment, this function rotates the fragment atoms a certain theta angle around an axis (set by the bond).
[ "Given", "a", "core", "molecule", "and", "a", "fragment", "this", "function", "rotates", "the", "fragment", "atoms", "a", "certain", "theta", "angle", "around", "an", "axis", "(", "set", "by", "the", "bond", ")", "." ]
def rotation_thought_axis(bond, theta, core_bond, list_of_atoms, fragment_bond, core_structure, fragment_structure, pdb_complex, pdb_fragment, chain_complex, chain_fragment, output_path, only_grow=False): vector = bond[1].get_vector() - bond[0].get_vector() rot_mat = bio.rotaxis(theta,...
[ "def", "rotation_thought_axis", "(", "bond", ",", "theta", ",", "core_bond", ",", "list_of_atoms", ",", "fragment_bond", ",", "core_structure", ",", "fragment_structure", ",", "pdb_complex", ",", "pdb_fragment", ",", "chain_complex", ",", "chain_fragment", ",", "out...
Given a core molecule and a fragment, this function rotates the fragment atoms a certain theta angle around an axis (set by the bond).
[ "Given", "a", "core", "molecule", "and", "a", "fragment", "this", "function", "rotates", "the", "fragment", "atoms", "a", "certain", "theta", "angle", "around", "an", "axis", "(", "set", "by", "the", "bond", ")", "." ]
[ "\"\"\"\n Given a core molecule and a fragment, this function rotates the fragment atoms a certain theta angle around an axis\n (set by the bond).\n :param bond: Bio.PDB.Atom list composed by two elements: [heavy atom of the core, heavy atom of the fragment]\n :param theta: Rotation angle in rads.\n ...
[ { "param": "bond", "type": null }, { "param": "theta", "type": null }, { "param": "core_bond", "type": null }, { "param": "list_of_atoms", "type": null }, { "param": "fragment_bond", "type": null }, { "param": "core_structure", "type": null }, ...
{ "returns": [ { "docstring": "ProDy molecule with the core_structure and the fragment_structure rotated around the axis of the bond.", "docstring_tokens": [ "ProDy", "molecule", "with", "the", "core_structure", "and", "the", "fragment_st...
3e123b03d484cc398bba008aa6c2307dbc6a5cbb
danielSoler93/FrAG_PELE
frag_pele/Growing/add_fragment_from_pdbs.py
[ "MIT" ]
Python
check_collision
<not_specific>
def check_collision(merged_structure, bond, theta, theta_interval, core_bond, list_of_atoms, fragment_bond, core_structure, fragment_structure, pdb_complex, pdb_fragment, chain_complex, chain_fragment, output_path, threshold_clash=None, only_grow=False, debug=False): """ ...
Given a structure composed by a core and a fragment, it checks that there is not collisions between the atoms of both. If it finds a collision, the molecule will be rotated "theta_interval" radians and the checking will be repeated. If it is not possible to find a conformation without atom collisions, it w...
Given a structure composed by a core and a fragment, it checks that there is not collisions between the atoms of both. If it finds a collision, the molecule will be rotated "theta_interval" radians and the checking will be repeated. If it is not possible to find a conformation without atom collisions, it will print a w...
[ "Given", "a", "structure", "composed", "by", "a", "core", "and", "a", "fragment", "it", "checks", "that", "there", "is", "not", "collisions", "between", "the", "atoms", "of", "both", ".", "If", "it", "finds", "a", "collision", "the", "molecule", "will", ...
def check_collision(merged_structure, bond, theta, theta_interval, core_bond, list_of_atoms, fragment_bond, core_structure, fragment_structure, pdb_complex, pdb_fragment, chain_complex, chain_fragment, output_path, threshold_clash=None, only_grow=False, debug=False): core_res...
[ "def", "check_collision", "(", "merged_structure", ",", "bond", ",", "theta", ",", "theta_interval", ",", "core_bond", ",", "list_of_atoms", ",", "fragment_bond", ",", "core_structure", ",", "fragment_structure", ",", "pdb_complex", ",", "pdb_fragment", ",", "chain_...
Given a structure composed by a core and a fragment, it checks that there is not collisions between the atoms of both.
[ "Given", "a", "structure", "composed", "by", "a", "core", "and", "a", "fragment", "it", "checks", "that", "there", "is", "not", "collisions", "between", "the", "atoms", "of", "both", "." ]
[ "\"\"\"\n Given a structure composed by a core and a fragment, it checks that there is not collisions between the atoms of\n both. If it finds a collision, the molecule will be rotated \"theta_interval\" radians and the checking will be\n repeated. If it is not possible to find a conformation without atom ...
[ { "param": "merged_structure", "type": null }, { "param": "bond", "type": null }, { "param": "theta", "type": null }, { "param": "theta_interval", "type": null }, { "param": "core_bond", "type": null }, { "param": "list_of_atoms", "type": null },...
{ "returns": [ { "docstring": "ProDy molecule with the core_structure and the fragment_structure (rotated and without intra-molecular\nclashes) around the axis of the bond.", "docstring_tokens": [ "ProDy", "molecule", "with", "the", "core_structure", "an...
3e123b03d484cc398bba008aa6c2307dbc6a5cbb
danielSoler93/FrAG_PELE
frag_pele/Growing/add_fragment_from_pdbs.py
[ "MIT" ]
Python
finishing_joining
null
def finishing_joining(molecule, chain): """ Given a ProDy molecule this function change the Resname of the atoms to "GRW" and the Resnum to "1". Following this process it is possible to transform a ProDy object with more than one element with different resnums and resnames into a single molecule. :p...
Given a ProDy molecule this function change the Resname of the atoms to "GRW" and the Resnum to "1". Following this process it is possible to transform a ProDy object with more than one element with different resnums and resnames into a single molecule. :param molecule: ProDy molecule. :return: Pro...
Given a ProDy molecule this function change the Resname of the atoms to "GRW" and the Resnum to "1". Following this process it is possible to transform a ProDy object with more than one element with different resnums and resnames into a single molecule.
[ "Given", "a", "ProDy", "molecule", "this", "function", "change", "the", "Resname", "of", "the", "atoms", "to", "\"", "GRW", "\"", "and", "the", "Resnum", "to", "\"", "1", "\"", ".", "Following", "this", "process", "it", "is", "possible", "to", "transform...
def finishing_joining(molecule, chain): molecule.setResnames("GRW") molecule.setResnums(1) molecule.setChids(chain)
[ "def", "finishing_joining", "(", "molecule", ",", "chain", ")", ":", "molecule", ".", "setResnames", "(", "\"GRW\"", ")", "molecule", ".", "setResnums", "(", "1", ")", "molecule", ".", "setChids", "(", "chain", ")" ]
Given a ProDy molecule this function change the Resname of the atoms to "GRW" and the Resnum to "1".
[ "Given", "a", "ProDy", "molecule", "this", "function", "change", "the", "Resname", "of", "the", "atoms", "to", "\"", "GRW", "\"", "and", "the", "Resnum", "to", "\"", "1", "\"", "." ]
[ "\"\"\"\n Given a ProDy molecule this function change the Resname of the atoms to \"GRW\" and the Resnum to \"1\". Following this\n process it is possible to transform a ProDy object with more than one element with different resnums and resnames\n into a single molecule.\n :param molecule: ProDy molecul...
[ { "param": "molecule", "type": null }, { "param": "chain", "type": null } ]
{ "returns": [ { "docstring": "ProDy molecule with Resname \"GRW\" and Resnum \"1\".", "docstring_tokens": [ "ProDy", "molecule", "with", "Resname", "\"", "GRW", "\"", "and", "Resnum", "\"", "1", "\"", ...
3e123b03d484cc398bba008aa6c2307dbc6a5cbb
danielSoler93/FrAG_PELE
frag_pele/Growing/add_fragment_from_pdbs.py
[ "MIT" ]
Python
compute_centroid
<not_specific>
def compute_centroid(molecule): """ Given a ProDy molecule, the function extract the coordinates of their atoms and compute the centroid of the molecule. :param molecule: ProDy molecule object. :return: centroid of the molecule, tuple(X,Y,Z). """ coords = molecule.getCoords() x = [] ...
Given a ProDy molecule, the function extract the coordinates of their atoms and compute the centroid of the molecule. :param molecule: ProDy molecule object. :return: centroid of the molecule, tuple(X,Y,Z).
Given a ProDy molecule, the function extract the coordinates of their atoms and compute the centroid of the molecule.
[ "Given", "a", "ProDy", "molecule", "the", "function", "extract", "the", "coordinates", "of", "their", "atoms", "and", "compute", "the", "centroid", "of", "the", "molecule", "." ]
def compute_centroid(molecule): coords = molecule.getCoords() x = [] y = [] z = [] for coord in coords: x.append(float(coord[0])) y.append(float(coord[1])) z.append(float(coord[2])) centroid = (np.mean(x), np.mean(y), np.mean(z)) return centroid
[ "def", "compute_centroid", "(", "molecule", ")", ":", "coords", "=", "molecule", ".", "getCoords", "(", ")", "x", "=", "[", "]", "y", "=", "[", "]", "z", "=", "[", "]", "for", "coord", "in", "coords", ":", "x", ".", "append", "(", "float", "(", ...
Given a ProDy molecule, the function extract the coordinates of their atoms and compute the centroid of the molecule.
[ "Given", "a", "ProDy", "molecule", "the", "function", "extract", "the", "coordinates", "of", "their", "atoms", "and", "compute", "the", "centroid", "of", "the", "molecule", "." ]
[ "\"\"\"\n Given a ProDy molecule, the function extract the coordinates of their atoms and compute the centroid of the\n molecule.\n :param molecule: ProDy molecule object.\n :return: centroid of the molecule, tuple(X,Y,Z).\n \"\"\"" ]
[ { "param": "molecule", "type": null } ]
{ "returns": [ { "docstring": "centroid of the molecule, tuple(X,Y,Z).", "docstring_tokens": [ "centroid", "of", "the", "molecule", "tuple", "(", "X", "Y", "Z", ")", "." ], "type": null } ], "ra...
3e123b03d484cc398bba008aa6c2307dbc6a5cbb
danielSoler93/FrAG_PELE
frag_pele/Growing/add_fragment_from_pdbs.py
[ "MIT" ]
Python
move_atom_along_vector
<not_specific>
def move_atom_along_vector(initial_coord, final_coord, position_proportion): """ Given two points (atom coordinates), this function moves the initial point a distance of "length of the vector formed by the two coordinates" * "position_proportion" on the vector's direction. :param initial_coord: initial ...
Given two points (atom coordinates), this function moves the initial point a distance of "length of the vector formed by the two coordinates" * "position_proportion" on the vector's direction. :param initial_coord: initial 3D coordinates (X, Y, Z). numpy.ndarray :param final_coord: final 3D coordinates...
Given two points (atom coordinates), this function moves the initial point a distance of "length of the vector formed by the two coordinates" * "position_proportion" on the vector's direction.
[ "Given", "two", "points", "(", "atom", "coordinates", ")", "this", "function", "moves", "the", "initial", "point", "a", "distance", "of", "\"", "length", "of", "the", "vector", "formed", "by", "the", "two", "coordinates", "\"", "*", "\"", "position_proportio...
def move_atom_along_vector(initial_coord, final_coord, position_proportion): vector = final_coord - initial_coord new_coords = initial_coord + (position_proportion * vector) return new_coords
[ "def", "move_atom_along_vector", "(", "initial_coord", ",", "final_coord", ",", "position_proportion", ")", ":", "vector", "=", "final_coord", "-", "initial_coord", "new_coords", "=", "initial_coord", "+", "(", "position_proportion", "*", "vector", ")", "return", "n...
Given two points (atom coordinates), this function moves the initial point a distance of "length of the vector formed by the two coordinates" * "position_proportion" on the vector's direction.
[ "Given", "two", "points", "(", "atom", "coordinates", ")", "this", "function", "moves", "the", "initial", "point", "a", "distance", "of", "\"", "length", "of", "the", "vector", "formed", "by", "the", "two", "coordinates", "\"", "*", "\"", "position_proportio...
[ "\"\"\"\n Given two points (atom coordinates), this function moves the initial point a distance of \"length of the vector\n formed by the two coordinates\" * \"position_proportion\" on the vector's direction.\n :param initial_coord: initial 3D coordinates (X, Y, Z). numpy.ndarray\n :param final_coord: f...
[ { "param": "initial_coord", "type": null }, { "param": "final_coord", "type": null }, { "param": "position_proportion", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "initial_coord", "type": null, "docstring": "initial 3D coordinates (X, Y, Z). numpy.ndarray", "docstring_tokens": [...
3e123b03d484cc398bba008aa6c2307dbc6a5cbb
danielSoler93/FrAG_PELE
frag_pele/Growing/add_fragment_from_pdbs.py
[ "MIT" ]
Python
reduce_molecule_size
null
def reduce_molecule_size(molecule, residue, lambda_in): """ This function performs a reduction of the size of a given residue of a ProDy molecule object. :param molecule: ProDy molecule object. :param residue: Resname of the residue of the molecule that we want to reduce. string :param lambda_in: pr...
This function performs a reduction of the size of a given residue of a ProDy molecule object. :param molecule: ProDy molecule object. :param residue: Resname of the residue of the molecule that we want to reduce. string :param lambda_in: proportion of reduction of the size that we want to apply to the ...
This function performs a reduction of the size of a given residue of a ProDy molecule object.
[ "This", "function", "performs", "a", "reduction", "of", "the", "size", "of", "a", "given", "residue", "of", "a", "ProDy", "molecule", "object", "." ]
def reduce_molecule_size(molecule, residue, lambda_in): if lambda_in >= 0 and lambda_in <= 1: selection = molecule.select("resname {}".format(residue)) centroid = compute_centroid(selection) for atom in selection: atom_coords = atom.getCoords() new_coords = move_atom_...
[ "def", "reduce_molecule_size", "(", "molecule", ",", "residue", ",", "lambda_in", ")", ":", "if", "lambda_in", ">=", "0", "and", "lambda_in", "<=", "1", ":", "selection", "=", "molecule", ".", "select", "(", "\"resname {}\"", ".", "format", "(", "residue", ...
This function performs a reduction of the size of a given residue of a ProDy molecule object.
[ "This", "function", "performs", "a", "reduction", "of", "the", "size", "of", "a", "given", "residue", "of", "a", "ProDy", "molecule", "object", "." ]
[ "\"\"\"\n This function performs a reduction of the size of a given residue of a ProDy molecule object.\n :param molecule: ProDy molecule object.\n :param residue: Resname of the residue of the molecule that we want to reduce. string\n :param lambda_in: proportion of reduction of the size that we want t...
[ { "param": "molecule", "type": null }, { "param": "residue", "type": null }, { "param": "lambda_in", "type": null } ]
{ "returns": [ { "docstring": "modify the coordinates of the selected residue for the result of the reduction.", "docstring_tokens": [ "modify", "the", "coordinates", "of", "the", "selected", "residue", "for", "the", "resu...
3e123b03d484cc398bba008aa6c2307dbc6a5cbb
danielSoler93/FrAG_PELE
frag_pele/Growing/add_fragment_from_pdbs.py
[ "MIT" ]
Python
translate_to_position
null
def translate_to_position(initial_pos, final_pos, molecule): """ This function applies a translation of a whole molecule, using the vector from the initial_pos to the final_pos. :param initial_pos: initial position in 3D coordinates. Generally we use the coordinates of an atom. numpy. ndarray :param fin...
This function applies a translation of a whole molecule, using the vector from the initial_pos to the final_pos. :param initial_pos: initial position in 3D coordinates. Generally we use the coordinates of an atom. numpy. ndarray :param final_pos: final position in 3D coordinates. Generally we use the coord...
This function applies a translation of a whole molecule, using the vector from the initial_pos to the final_pos.
[ "This", "function", "applies", "a", "translation", "of", "a", "whole", "molecule", "using", "the", "vector", "from", "the", "initial_pos", "to", "the", "final_pos", "." ]
def translate_to_position(initial_pos, final_pos, molecule): translation = initial_pos - final_pos coords_to_move = molecule.getCoords() list_of_new_coords = [] for coords in coords_to_move: new_coords = coords + translation list_of_new_coords.append(new_coords[0]) molecule.setCoords...
[ "def", "translate_to_position", "(", "initial_pos", ",", "final_pos", ",", "molecule", ")", ":", "translation", "=", "initial_pos", "-", "final_pos", "coords_to_move", "=", "molecule", ".", "getCoords", "(", ")", "list_of_new_coords", "=", "[", "]", "for", "coor...
This function applies a translation of a whole molecule, using the vector from the initial_pos to the final_pos.
[ "This", "function", "applies", "a", "translation", "of", "a", "whole", "molecule", "using", "the", "vector", "from", "the", "initial_pos", "to", "the", "final_pos", "." ]
[ "\"\"\"\n This function applies a translation of a whole molecule, using the vector from the initial_pos to the final_pos.\n :param initial_pos: initial position in 3D coordinates. Generally we use the coordinates of an atom. numpy. ndarray\n :param final_pos: final position in 3D coordinates. Generally we...
[ { "param": "initial_pos", "type": null }, { "param": "final_pos", "type": null }, { "param": "molecule", "type": null } ]
{ "returns": [ { "docstring": "modify the coordinates of the molecule.", "docstring_tokens": [ "modify", "the", "coordinates", "of", "the", "molecule", "." ], "type": null } ], "raises": [], "params": [ { "identifi...
3e123b03d484cc398bba008aa6c2307dbc6a5cbb
danielSoler93/FrAG_PELE
frag_pele/Growing/add_fragment_from_pdbs.py
[ "MIT" ]
Python
extract_protein_from_complex
<not_specific>
def extract_protein_from_complex(pdb_file): """ Given a pdb file containing a complex (ligand + protein) it returns only the protein. :param pdb_file: pdb file with a complex. string. :return: ProDy molecule with only the protein. """ complex = prody.parsePDB(pdb_file) protein = complex.sele...
Given a pdb file containing a complex (ligand + protein) it returns only the protein. :param pdb_file: pdb file with a complex. string. :return: ProDy molecule with only the protein.
Given a pdb file containing a complex (ligand + protein) it returns only the protein.
[ "Given", "a", "pdb", "file", "containing", "a", "complex", "(", "ligand", "+", "protein", ")", "it", "returns", "only", "the", "protein", "." ]
def extract_protein_from_complex(pdb_file): complex = prody.parsePDB(pdb_file) protein = complex.select("protein") return protein
[ "def", "extract_protein_from_complex", "(", "pdb_file", ")", ":", "complex", "=", "prody", ".", "parsePDB", "(", "pdb_file", ")", "protein", "=", "complex", ".", "select", "(", "\"protein\"", ")", "return", "protein" ]
Given a pdb file containing a complex (ligand + protein) it returns only the protein.
[ "Given", "a", "pdb", "file", "containing", "a", "complex", "(", "ligand", "+", "protein", ")", "it", "returns", "only", "the", "protein", "." ]
[ "\"\"\"\n Given a pdb file containing a complex (ligand + protein) it returns only the protein.\n :param pdb_file: pdb file with a complex. string.\n :return: ProDy molecule with only the protein.\n \"\"\"" ]
[ { "param": "pdb_file", "type": null } ]
{ "returns": [ { "docstring": "ProDy molecule with only the protein.", "docstring_tokens": [ "ProDy", "molecule", "with", "only", "the", "protein", "." ], "type": null } ], "raises": [], "params": [ { "identifier":...
3e123b03d484cc398bba008aa6c2307dbc6a5cbb
danielSoler93/FrAG_PELE
frag_pele/Growing/add_fragment_from_pdbs.py
[ "MIT" ]
Python
check_water
<not_specific>
def check_water(pdb_input): """ Given a pdb file checks if it contains water molecules. :param pdb_input: pdb input file :return: True or False """ checker = False with open(pdb_input) as pdb: for line in pdb: if "HETATM" in line: if line.split()[3] == "HO...
Given a pdb file checks if it contains water molecules. :param pdb_input: pdb input file :return: True or False
Given a pdb file checks if it contains water molecules.
[ "Given", "a", "pdb", "file", "checks", "if", "it", "contains", "water", "molecules", "." ]
def check_water(pdb_input): checker = False with open(pdb_input) as pdb: for line in pdb: if "HETATM" in line: if line.split()[3] == "HOH": print("Your pdb file contains water molecules") checker = True break ret...
[ "def", "check_water", "(", "pdb_input", ")", ":", "checker", "=", "False", "with", "open", "(", "pdb_input", ")", "as", "pdb", ":", "for", "line", "in", "pdb", ":", "if", "\"HETATM\"", "in", "line", ":", "if", "line", ".", "split", "(", ")", "[", "...
Given a pdb file checks if it contains water molecules.
[ "Given", "a", "pdb", "file", "checks", "if", "it", "contains", "water", "molecules", "." ]
[ "\"\"\"\n Given a pdb file checks if it contains water molecules.\n :param pdb_input: pdb input file\n :return: True or False\n \"\"\"" ]
[ { "param": "pdb_input", "type": null } ]
{ "returns": [ { "docstring": "True or False", "docstring_tokens": [ "True", "or", "False" ], "type": null } ], "raises": [], "params": [ { "identifier": "pdb_input", "type": null, "docstring": "pdb input file", "docstring_token...
3e123b03d484cc398bba008aa6c2307dbc6a5cbb
danielSoler93/FrAG_PELE
frag_pele/Growing/add_fragment_from_pdbs.py
[ "MIT" ]
Python
lignames_replacer
null
def lignames_replacer(pdb_file, original_ligname, new_ligname): """ Given a PDB file it replace the name of a ligand for a new one. :param pdb_file: file in PDB format :param original_ligname: original name of the ligand :param new_ligname: new name of the ligand that will replace the original name ...
Given a PDB file it replace the name of a ligand for a new one. :param pdb_file: file in PDB format :param original_ligname: original name of the ligand :param new_ligname: new name of the ligand that will replace the original name :return:
Given a PDB file it replace the name of a ligand for a new one.
[ "Given", "a", "PDB", "file", "it", "replace", "the", "name", "of", "a", "ligand", "for", "a", "new", "one", "." ]
def lignames_replacer(pdb_file, original_ligname, new_ligname): with open(pdb_file) as pdb: content = pdb.readlines() for index, line in enumerate(content): if line.startswith("HETATM"): line = line.replace(original_ligname, new_ligname) content[index] = line pdb_modi...
[ "def", "lignames_replacer", "(", "pdb_file", ",", "original_ligname", ",", "new_ligname", ")", ":", "with", "open", "(", "pdb_file", ")", "as", "pdb", ":", "content", "=", "pdb", ".", "readlines", "(", ")", "for", "index", ",", "line", "in", "enumerate", ...
Given a PDB file it replace the name of a ligand for a new one.
[ "Given", "a", "PDB", "file", "it", "replace", "the", "name", "of", "a", "ligand", "for", "a", "new", "one", "." ]
[ "\"\"\"\n Given a PDB file it replace the name of a ligand for a new one.\n :param pdb_file: file in PDB format\n :param original_ligname: original name of the ligand\n :param new_ligname: new name of the ligand that will replace the original name\n :return:\n \"\"\"" ]
[ { "param": "pdb_file", "type": null }, { "param": "original_ligname", "type": null }, { "param": "new_ligname", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "pdb_file", "type": null, "docstring": "file in PDB format", "docstring_tokens": [ "file", "in", ...
3e123b03d484cc398bba008aa6c2307dbc6a5cbb
danielSoler93/FrAG_PELE
frag_pele/Growing/add_fragment_from_pdbs.py
[ "MIT" ]
Python
check_and_fix_repeated_lignames
null
def check_and_fix_repeated_lignames(pdb1, pdb2, ligand_chain_1="L", ligand_chain_2="L", resnum_1=None, resnum_2=None): """ It checks if two pdbs have the same ligand name or if the pdb file 1 has as ligand name "GRW" and it is replaced by "LIG". :param pdb1: pdb file 1 :param pdb2: pdb file 2 :r...
It checks if two pdbs have the same ligand name or if the pdb file 1 has as ligand name "GRW" and it is replaced by "LIG". :param pdb1: pdb file 1 :param pdb2: pdb file 2 :return:
It checks if two pdbs have the same ligand name or if the pdb file 1 has as ligand name "GRW" and it is replaced by "LIG".
[ "It", "checks", "if", "two", "pdbs", "have", "the", "same", "ligand", "name", "or", "if", "the", "pdb", "file", "1", "has", "as", "ligand", "name", "\"", "GRW", "\"", "and", "it", "is", "replaced", "by", "\"", "LIG", "\"", "." ]
def check_and_fix_repeated_lignames(pdb1, pdb2, ligand_chain_1="L", ligand_chain_2="L", resnum_1=None, resnum_2=None): name_1 = extract_atoms_pdbs(pdb1, create_file=False, chain=ligand_chain_1, resnum=resnum_1) name_2 = extract_atoms_pdbs(pdb2, create_file=False, chain=ligand_chain_2, resnum=resnum_2) if na...
[ "def", "check_and_fix_repeated_lignames", "(", "pdb1", ",", "pdb2", ",", "ligand_chain_1", "=", "\"L\"", ",", "ligand_chain_2", "=", "\"L\"", ",", "resnum_1", "=", "None", ",", "resnum_2", "=", "None", ")", ":", "name_1", "=", "extract_atoms_pdbs", "(", "pdb1"...
It checks if two pdbs have the same ligand name or if the pdb file 1 has as ligand name "GRW" and it is replaced by "LIG".
[ "It", "checks", "if", "two", "pdbs", "have", "the", "same", "ligand", "name", "or", "if", "the", "pdb", "file", "1", "has", "as", "ligand", "name", "\"", "GRW", "\"", "and", "it", "is", "replaced", "by", "\"", "LIG", "\"", "." ]
[ "\"\"\"\n It checks if two pdbs have the same ligand name or if the pdb file 1 has as ligand name \"GRW\" and it is replaced\n by \"LIG\".\n :param pdb1: pdb file 1\n :param pdb2: pdb file 2\n :return:\n \"\"\"" ]
[ { "param": "pdb1", "type": null }, { "param": "pdb2", "type": null }, { "param": "ligand_chain_1", "type": null }, { "param": "ligand_chain_2", "type": null }, { "param": "resnum_1", "type": null }, { "param": "resnum_2", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "pdb1", "type": null, "docstring": "pdb file 1", "docstring_tokens": [ "pdb", "file", "1" ...
5cd6396b2c5b0c7c6a29bd9cc8073ca75809be2c
danielSoler93/FrAG_PELE
frag_pele/PlopRotTemp_S_2017/PlopRotTemp.py
[ "MIT" ]
Python
remove_tors
<not_specific>
def remove_tors(tors1, tors2): """ return the tors2 from tors 1 """ out_tors = [] for torsion1 in tors1: found = 0 for torsion2 in tors2: if torsion1 == torsion2: found = 1 if found == 0: out_tors.append(torsion1) return out_tors
return the tors2 from tors 1
return the tors2 from tors 1
[ "return", "the", "tors2", "from", "tors", "1" ]
def remove_tors(tors1, tors2): out_tors = [] for torsion1 in tors1: found = 0 for torsion2 in tors2: if torsion1 == torsion2: found = 1 if found == 0: out_tors.append(torsion1) return out_tors
[ "def", "remove_tors", "(", "tors1", ",", "tors2", ")", ":", "out_tors", "=", "[", "]", "for", "torsion1", "in", "tors1", ":", "found", "=", "0", "for", "torsion2", "in", "tors2", ":", "if", "torsion1", "==", "torsion2", ":", "found", "=", "1", "if", ...
return the tors2 from tors 1
[ "return", "the", "tors2", "from", "tors", "1" ]
[ "\"\"\"\n return the tors2 from tors 1\n \"\"\"" ]
[ { "param": "tors1", "type": null }, { "param": "tors2", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "tors1", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "tors2", "type": null, "docstring": null, "docstring_tokens":...
5cd6396b2c5b0c7c6a29bd9cc8073ca75809be2c
danielSoler93/FrAG_PELE
frag_pele/PlopRotTemp_S_2017/PlopRotTemp.py
[ "MIT" ]
Python
check_repite_names
null
def check_repite_names(atomnames): """ Check if the mae_file contains any repited name. If it's like this raise and error. """ atoms_repited = [] for i, atomname_target in enumerate(atomnames): index = i while(index!=0): index-=1 if(atomname_target == atomnames[index]): identif...
Check if the mae_file contains any repited name. If it's like this raise and error.
Check if the mae_file contains any repited name. If it's like this raise and error.
[ "Check", "if", "the", "mae_file", "contains", "any", "repited", "name", ".", "If", "it", "'", "s", "like", "this", "raise", "and", "error", "." ]
def check_repite_names(atomnames): atoms_repited = [] for i, atomname_target in enumerate(atomnames): index = i while(index!=0): index-=1 if(atomname_target == atomnames[index]): identifier = ' Atom:{}, AtomType:{}'.format(i, atomname_target) raise Exception(ERROR_ATOMTYPES + ide...
[ "def", "check_repite_names", "(", "atomnames", ")", ":", "atoms_repited", "=", "[", "]", "for", "i", ",", "atomname_target", "in", "enumerate", "(", "atomnames", ")", ":", "index", "=", "i", "while", "(", "index", "!=", "0", ")", ":", "index", "-=", "1...
Check if the mae_file contains any repited name.
[ "Check", "if", "the", "mae_file", "contains", "any", "repited", "name", "." ]
[ "\"\"\"\n Check if the mae_file contains any\n repited name. If it's like this\n raise and error.\n \"\"\"" ]
[ { "param": "atomnames", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "atomnames", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
5cd6396b2c5b0c7c6a29bd9cc8073ca75809be2c
danielSoler93/FrAG_PELE
frag_pele/PlopRotTemp_S_2017/PlopRotTemp.py
[ "MIT" ]
Python
replace_vdwr_from_library
null
def replace_vdwr_from_library(rotamer_library): """ Check if the rotamer library contains any vdw radius= 0 and replace them by 0.5000 """ found = False lines = [] radius_vdw_info, start_index, end_index = parse_nonbonded(rotamer_library) for i, rdw_line in enumerate(radius_vdw_info): NBOND...
Check if the rotamer library contains any vdw radius= 0 and replace them by 0.5000
Check if the rotamer library contains any vdw radius= 0 and replace them by 0.5000
[ "Check", "if", "the", "rotamer", "library", "contains", "any", "vdw", "radius", "=", "0", "and", "replace", "them", "by", "0", ".", "5000" ]
def replace_vdwr_from_library(rotamer_library): found = False lines = [] radius_vdw_info, start_index, end_index = parse_nonbonded(rotamer_library) for i, rdw_line in enumerate(radius_vdw_info): NBOND_info = rdw_line.split() rdw = float(NBOND_info[1])/2.0 epsilon = float(NBOND_info[2]) if(rdw ==...
[ "def", "replace_vdwr_from_library", "(", "rotamer_library", ")", ":", "found", "=", "False", "lines", "=", "[", "]", "radius_vdw_info", ",", "start_index", ",", "end_index", "=", "parse_nonbonded", "(", "rotamer_library", ")", "for", "i", ",", "rdw_line", "in", ...
Check if the rotamer library contains any vdw radius= 0 and replace them by 0.5000
[ "Check", "if", "the", "rotamer", "library", "contains", "any", "vdw", "radius", "=", "0", "and", "replace", "them", "by", "0", ".", "5000" ]
[ "\"\"\"\n Check if the rotamer library \n contains any vdw radius= 0\n and replace them by 0.5000\n \"\"\"" ]
[ { "param": "rotamer_library", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "rotamer_library", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
5cd6396b2c5b0c7c6a29bd9cc8073ca75809be2c
danielSoler93/FrAG_PELE
frag_pele/PlopRotTemp_S_2017/PlopRotTemp.py
[ "MIT" ]
Python
parse_nonbonded
<not_specific>
def parse_nonbonded(rotamer_library): """ Find Non bonded parameters inside the rotamer's library """ NBN_lines = [] with open(rotamer_library, 'r') as f: lines = f.readlines() for i, line in enumerate(lines): line = line.strip('\n') if(line == 'NBON'): start_index = i+1 ...
Find Non bonded parameters inside the rotamer's library
Find Non bonded parameters inside the rotamer's library
[ "Find", "Non", "bonded", "parameters", "inside", "the", "rotamer", "'", "s", "library" ]
def parse_nonbonded(rotamer_library): NBN_lines = [] with open(rotamer_library, 'r') as f: lines = f.readlines() for i, line in enumerate(lines): line = line.strip('\n') if(line == 'NBON'): start_index = i+1 elif(line == 'BOND'): end_index = i try: for i in range...
[ "def", "parse_nonbonded", "(", "rotamer_library", ")", ":", "NBN_lines", "=", "[", "]", "with", "open", "(", "rotamer_library", ",", "'r'", ")", "as", "f", ":", "lines", "=", "f", ".", "readlines", "(", ")", "for", "i", ",", "line", "in", "enumerate", ...
Find Non bonded parameters inside the rotamer's library
[ "Find", "Non", "bonded", "parameters", "inside", "the", "rotamer", "'", "s", "library" ]
[ "\"\"\"\n Find Non bonded parameters inside\n the rotamer's library\n \"\"\"" ]
[ { "param": "rotamer_library", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "rotamer_library", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
5cd6396b2c5b0c7c6a29bd9cc8073ca75809be2c
danielSoler93/FrAG_PELE
frag_pele/PlopRotTemp_S_2017/PlopRotTemp.py
[ "MIT" ]
Python
rvdw_change
null
def rvdw_change(rotamer_library, radius_vdw_info, start_index, end_index): """ Change all radius vanderwals 0 to 0.5 from the rotamer's library file """ with open(rotamer_library, 'r') as f: lines = f.readlines() for i, new_line in enumerate(radius_vdw_info): lines[start_index + i] = '{0:>5}...
Change all radius vanderwals 0 to 0.5 from the rotamer's library file
Change all radius vanderwals 0 to 0.5 from the rotamer's library file
[ "Change", "all", "radius", "vanderwals", "0", "to", "0", ".", "5", "from", "the", "rotamer", "'", "s", "library", "file" ]
def rvdw_change(rotamer_library, radius_vdw_info, start_index, end_index): with open(rotamer_library, 'r') as f: lines = f.readlines() for i, new_line in enumerate(radius_vdw_info): lines[start_index + i] = '{0:>5} {1:>8} {2:>8} {3:>10} {4:>8} {5:>8} {6:>13} {7:>13}\n'.format(*new_line) with open(rota...
[ "def", "rvdw_change", "(", "rotamer_library", ",", "radius_vdw_info", ",", "start_index", ",", "end_index", ")", ":", "with", "open", "(", "rotamer_library", ",", "'r'", ")", "as", "f", ":", "lines", "=", "f", ".", "readlines", "(", ")", "for", "i", ",",...
Change all radius vanderwals 0 to 0.5 from the rotamer's library file
[ "Change", "all", "radius", "vanderwals", "0", "to", "0", ".", "5", "from", "the", "rotamer", "'", "s", "library", "file" ]
[ "\"\"\"\n Change all radius vanderwals 0 to 0.5\n from the rotamer's library file\n \"\"\"" ]
[ { "param": "rotamer_library", "type": null }, { "param": "radius_vdw_info", "type": null }, { "param": "start_index", "type": null }, { "param": "end_index", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "rotamer_library", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "radius_vdw_info", "type": null, "docstring": null, ...
5cd6396b2c5b0c7c6a29bd9cc8073ca75809be2c
danielSoler93/FrAG_PELE
frag_pele/PlopRotTemp_S_2017/PlopRotTemp.py
[ "MIT" ]
Python
parse_mae_line
<not_specific>
def parse_mae_line(line): ''' Notice that this function is the same than MaeFileBuilder.__tokenizeLine . Try to delete this one once it will be no longer needed ''' output = [] while (len(line) > 0): a = re.search(r'^\s*(\S+)(.*)', line) if (a): b = re.search(r'\"', a.group...
Notice that this function is the same than MaeFileBuilder.__tokenizeLine . Try to delete this one once it will be no longer needed
Notice that this function is the same than MaeFileBuilder.__tokenizeLine . Try to delete this one once it will be no longer needed
[ "Notice", "that", "this", "function", "is", "the", "same", "than", "MaeFileBuilder", ".", "__tokenizeLine", ".", "Try", "to", "delete", "this", "one", "once", "it", "will", "be", "no", "longer", "needed" ]
def parse_mae_line(line): output = [] while (len(line) > 0): a = re.search(r'^\s*(\S+)(.*)', line) if (a): b = re.search(r'\"', a.group(1)) if (b): a = re.search(r'^\s*\"([^\"]*)\"(.*)', line) if (a): output.append(a.gro...
[ "def", "parse_mae_line", "(", "line", ")", ":", "output", "=", "[", "]", "while", "(", "len", "(", "line", ")", ">", "0", ")", ":", "a", "=", "re", ".", "search", "(", "r'^\\s*(\\S+)(.*)'", ",", "line", ")", "if", "(", "a", ")", ":", "b", "=", ...
Notice that this function is the same than MaeFileBuilder.__tokenizeLine .
[ "Notice", "that", "this", "function", "is", "the", "same", "than", "MaeFileBuilder", ".", "__tokenizeLine", "." ]
[ "''' \n Notice that this function is the same than MaeFileBuilder.__tokenizeLine . Try to delete this one once it will be no longer needed\n '''" ]
[ { "param": "line", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "line", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
5cd6396b2c5b0c7c6a29bd9cc8073ca75809be2c
danielSoler93/FrAG_PELE
frag_pele/PlopRotTemp_S_2017/PlopRotTemp.py
[ "MIT" ]
Python
find_connected
null
def find_connected(atom, bonds, assign): """ | **Description:** Find and assign the same "group (number)" to all the atoms connected to atom **Input:** atom: atom to look connections from bonds: list of all bonds assign: list of atoms with numbers assigned in order to cluster them ...
| **Description:** Find and assign the same "group (number)" to all the atoms connected to atom **Input:** atom: atom to look connections from bonds: list of all bonds assign: list of atoms with numbers assigned in order to cluster them e.g. -->[1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3,...
| Description:** Find and assign the same "group (number)" to all the atoms connected to atom atom to look connections from bonds: list of all bonds assign: list of atoms with numbers assigned in order to cluster them Atom 1 connected to 2 and 3 so they are in the same group specified by the number 1, etc
[ "|", "Description", ":", "**", "Find", "and", "assign", "the", "same", "\"", "group", "(", "number", ")", "\"", "to", "all", "the", "atoms", "connected", "to", "atom", "atom", "to", "look", "connections", "from", "bonds", ":", "list", "of", "all", "bon...
def find_connected(atom, bonds, assign): for i in range(len(bonds)): if (bonds[i][0] == atom and assign[bonds[i][1]] == 0 ): assign[bonds[i][1]] = assign[atom] find_connected(bonds[i][1], bonds, assign) if (bonds[i][1] == atom and assign[bonds[i][0]] == 0 ): assig...
[ "def", "find_connected", "(", "atom", ",", "bonds", ",", "assign", ")", ":", "for", "i", "in", "range", "(", "len", "(", "bonds", ")", ")", ":", "if", "(", "bonds", "[", "i", "]", "[", "0", "]", "==", "atom", "and", "assign", "[", "bonds", "[",...
| Description:** Find and assign the same "group (number)" to all the atoms connected to atom
[ "|", "Description", ":", "**", "Find", "and", "assign", "the", "same", "\"", "group", "(", "number", ")", "\"", "to", "all", "the", "atoms", "connected", "to", "atom" ]
[ "\"\"\"\n |\n **Description:** Find and assign the same \"group (number)\" to all the atoms connected to atom\n\n **Input:**\n atom: atom to look connections from\n bonds: list of all bonds\n assign: list of atoms with numbers assigned in order to cluster them\n\n \n e.g. -->[1, 1, 1, ...
[ { "param": "atom", "type": null }, { "param": "bonds", "type": null }, { "param": "assign", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "atom", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "bonds", "type": null, "docstring": null, "docstring_tokens": ...
5cd6396b2c5b0c7c6a29bd9cc8073ca75809be2c
danielSoler93/FrAG_PELE
frag_pele/PlopRotTemp_S_2017/PlopRotTemp.py
[ "MIT" ]
Python
assign_ligand_groups
<not_specific>
def assign_ligand_groups(tors, all_bonds, n_atoms): """ | **Description:** Cluster atoms in groups depending whether or not they are connected **Input:** - tors: all torsions of the ligand - all_bonds: all ligand bonds - n_atoms: number of atoms of the ligand **Output:** - ...
| **Description:** Cluster atoms in groups depending whether or not they are connected **Input:** - tors: all torsions of the ligand - all_bonds: all ligand bonds - n_atoms: number of atoms of the ligand **Output:** - assign= List of Cluster of atoms depending whether or not t...
| Description:** Cluster atoms in groups depending whether or not they are connected all torsions of the ligand all_bonds: all ligand bonds n_atoms: number of atoms of the ligand assign= List of Cluster of atoms depending whether or not they are connected Atom 1 connected to 2 and 3 so they are in the same group s...
[ "|", "Description", ":", "**", "Cluster", "atoms", "in", "groups", "depending", "whether", "or", "not", "they", "are", "connected", "all", "torsions", "of", "the", "ligand", "all_bonds", ":", "all", "ligand", "bonds", "n_atoms", ":", "number", "of", "atoms",...
def assign_ligand_groups(tors, all_bonds, n_atoms): bonds = remove_tors(all_bonds, tors) n_assign = 0 c_group = 0 assign = [0 for x in range(n_atoms)] for i in range(n_atoms): assign[i] = 0 done = 0 while (done == 0): done = 1 for i in range(n_atoms): if...
[ "def", "assign_ligand_groups", "(", "tors", ",", "all_bonds", ",", "n_atoms", ")", ":", "bonds", "=", "remove_tors", "(", "all_bonds", ",", "tors", ")", "n_assign", "=", "0", "c_group", "=", "0", "assign", "=", "[", "0", "for", "x", "in", "range", "(",...
| Description:** Cluster atoms in groups depending whether or not they are connected
[ "|", "Description", ":", "**", "Cluster", "atoms", "in", "groups", "depending", "whether", "or", "not", "they", "are", "connected" ]
[ "\"\"\"\n |\n **Description:** Cluster atoms in groups depending whether or not they are connected\n\n **Input:**\n - tors: all torsions of the ligand\n - all_bonds: all ligand bonds\n - n_atoms: number of atoms of the ligand\n\n **Output:**\n - assign= List of Cluster of atoms depen...
[ { "param": "tors", "type": null }, { "param": "all_bonds", "type": null }, { "param": "n_atoms", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "tors", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "all_bonds", "type": null, "docstring": null, "docstring_token...
5cd6396b2c5b0c7c6a29bd9cc8073ca75809be2c
danielSoler93/FrAG_PELE
frag_pele/PlopRotTemp_S_2017/PlopRotTemp.py
[ "MIT" ]
Python
assign_rank_group
<not_specific>
def assign_rank_group(atom_num, assign, rank, rank_num): """ | **Description:** Assign rank to each group **Input:** - atom_num: Atom respectively which we are producing the rank from - assign: Group of molecules grouped on clusters dependiong on the ligand connectivity - rank: list o...
| **Description:** Assign rank to each group **Input:** - atom_num: Atom respectively which we are producing the rank from - assign: Group of molecules grouped on clusters dependiong on the ligand connectivity - rank: list of numbers for each atom which will show which atoms...
| Description:** Assign rank to each group Atom respectively which we are producing the rank from assign: Group of molecules grouped on clusters dependiong on the ligand connectivity rank: list of numbers for each atom which will show which atoms are closer to the atom we are making the rank from. Output**: rank: ran...
[ "|", "Description", ":", "**", "Assign", "rank", "to", "each", "group", "Atom", "respectively", "which", "we", "are", "producing", "the", "rank", "from", "assign", ":", "Group", "of", "molecules", "grouped", "on", "clusters", "dependiong", "on", "the", "liga...
def assign_rank_group(atom_num, assign, rank, rank_num): for i in range(len(assign)): if (assign[i] == assign[atom_num]): rank[i] = rank_num return rank
[ "def", "assign_rank_group", "(", "atom_num", ",", "assign", ",", "rank", ",", "rank_num", ")", ":", "for", "i", "in", "range", "(", "len", "(", "assign", ")", ")", ":", "if", "(", "assign", "[", "i", "]", "==", "assign", "[", "atom_num", "]", ")", ...
| Description:** Assign rank to each group
[ "|", "Description", ":", "**", "Assign", "rank", "to", "each", "group" ]
[ "\"\"\"\n |\n **Description:** Assign rank to each group\n\n **Input:**\n - atom_num: Atom respectively which we are producing the rank from\n - assign: Group of molecules grouped on clusters dependiong on the ligand connectivity\n - rank: list of numbers for each atom which will show \n ...
[ { "param": "atom_num", "type": null }, { "param": "assign", "type": null }, { "param": "rank", "type": null }, { "param": "rank_num", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "atom_num", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "assign", "type": null, "docstring": null, "docstring_toke...
5cd6396b2c5b0c7c6a29bd9cc8073ca75809be2c
danielSoler93/FrAG_PELE
frag_pele/PlopRotTemp_S_2017/PlopRotTemp.py
[ "MIT" ]
Python
assign_rank
<not_specific>
def assign_rank(bonds, assign, atom_num): """ | **Description:** Define a list of ranks for each grup of atoms or cluster in assign which will show which atoms are closer to the group. As small is the number of the rank as close to the atom we are making the rank from it will be. **Input:** ...
| **Description:** Define a list of ranks for each grup of atoms or cluster in assign which will show which atoms are closer to the group. As small is the number of the rank as close to the atom we are making the rank from it will be. **Input:** - bonds: Ligand connectivity - assign: ...
| Description:** Define a list of ranks for each grup of atoms or cluster in assign which will show which atoms are closer to the group. As small is the number of the rank as close to the atom we are making the rank from it will be. Ligand connectivity assign: List of atoms with numbers assigned in order to cluster th...
[ "|", "Description", ":", "**", "Define", "a", "list", "of", "ranks", "for", "each", "grup", "of", "atoms", "or", "cluster", "in", "assign", "which", "will", "show", "which", "atoms", "are", "closer", "to", "the", "group", ".", "As", "small", "is", "the...
def assign_rank(bonds, assign, atom_num): rank = [] num_assign = 1; for i in range(len(assign)): rank.append(-1) rank = assign_rank_group(atom_num, assign, rank, 0) while (min_value(rank) < 0): cur_rank = max_value(rank) changed = 1 while (changed == 1): ...
[ "def", "assign_rank", "(", "bonds", ",", "assign", ",", "atom_num", ")", ":", "rank", "=", "[", "]", "num_assign", "=", "1", ";", "for", "i", "in", "range", "(", "len", "(", "assign", ")", ")", ":", "rank", ".", "append", "(", "-", "1", ")", "r...
| Description:** Define a list of ranks for each grup of atoms or cluster in assign which will show which atoms are closer to the group.
[ "|", "Description", ":", "**", "Define", "a", "list", "of", "ranks", "for", "each", "grup", "of", "atoms", "or", "cluster", "in", "assign", "which", "will", "show", "which", "atoms", "are", "closer", "to", "the", "group", "." ]
[ "\"\"\"\n |\n **Description:** Define a list of ranks for each grup of atoms or cluster in assign\n which will show which atoms are closer to the group.\n As small is the number of the rank as close to the atom we are making the rank from it will be.\n\n\n **Input:**\n - bonds: Ligand connectivi...
[ { "param": "bonds", "type": null }, { "param": "assign", "type": null }, { "param": "atom_num", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "bonds", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "assign", "type": null, "docstring": null, "docstring_tokens"...
5cd6396b2c5b0c7c6a29bd9cc8073ca75809be2c
danielSoler93/FrAG_PELE
frag_pele/PlopRotTemp_S_2017/PlopRotTemp.py
[ "MIT" ]
Python
assign_group
<not_specific>
def assign_group(bonds, rank): """ | **Description:** With the core atom and its rank defined grouped the atoms in cluster or rotatable chains. **Input:** - bonds: all bonds - rank: core atom rank **Output:** - group: groups of rotatable chains """ gro...
| **Description:** With the core atom and its rank defined grouped the atoms in cluster or rotatable chains. **Input:** - bonds: all bonds - rank: core atom rank **Output:** - group: groups of rotatable chains
| Description:** With the core atom and its rank defined grouped the atoms in cluster or rotatable chains. all bonds rank: core atom rank groups of rotatable chains
[ "|", "Description", ":", "**", "With", "the", "core", "atom", "and", "its", "rank", "defined", "grouped", "the", "atoms", "in", "cluster", "or", "rotatable", "chains", ".", "all", "bonds", "rank", ":", "core", "atom", "rank", "groups", "of", "rotatable", ...
def assign_group(bonds, rank): group = [] cur_group = -1 for i in range(len(rank)): if (rank[i] == 0): group.append(-1) else: group.append(-2) while ( min_value(group) < -1 ): cur_atom = -1 for i in range(len(rank)): if (rank[i] == ...
[ "def", "assign_group", "(", "bonds", ",", "rank", ")", ":", "group", "=", "[", "]", "cur_group", "=", "-", "1", "for", "i", "in", "range", "(", "len", "(", "rank", ")", ")", ":", "if", "(", "rank", "[", "i", "]", "==", "0", ")", ":", "group",...
| Description:** With the core atom and its rank defined grouped the atoms in cluster or rotatable chains.
[ "|", "Description", ":", "**", "With", "the", "core", "atom", "and", "its", "rank", "defined", "grouped", "the", "atoms", "in", "cluster", "or", "rotatable", "chains", "." ]
[ "\"\"\"\n |\n **Description:** With the core atom and its rank defined\n grouped the atoms in cluster or rotatable chains.\n\n **Input:**\n - bonds: all bonds\n - rank: core atom rank\n\n **Output:**\n - group: groups of rotatable chains\n \"\"\"", "# core atoms", ...
[ { "param": "bonds", "type": null }, { "param": "rank", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "bonds", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "rank", "type": null, "docstring": null, "docstring_tokens": ...
5cd6396b2c5b0c7c6a29bd9cc8073ca75809be2c
danielSoler93/FrAG_PELE
frag_pele/PlopRotTemp_S_2017/PlopRotTemp.py
[ "MIT" ]
Python
FindCore_GetCoreAtom
<not_specific>
def FindCore_GetCoreAtom(tors, bonds, natoms, user_core_atom, back_tors, use_mult_lib,debug=False): """ | **Description**: Search for the core atom wich maximes the number of sidechains. **Input:** - tors: Atoms with torsions - bonds: connectivity - natoms: number of atoms of...
| **Description**: Search for the core atom wich maximes the number of sidechains. **Input:** - tors: Atoms with torsions - bonds: connectivity - natoms: number of atoms of the ligand - user_core_atom: predefined user core atom - back_tors: user backbone atoms with t...
| Description**: Search for the core atom wich maximes the number of sidechains. atom which will be the center of the core assign: List of atoms with numbers assigned in order to cluster them rank: list of numbers for each atom which will show which atoms are closer to the atom we are making the rank from. group: L...
[ "|", "Description", "**", ":", "Search", "for", "the", "core", "atom", "wich", "maximes", "the", "number", "of", "sidechains", ".", "atom", "which", "will", "be", "the", "center", "of", "the", "core", "assign", ":", "List", "of", "atoms", "with", "number...
def FindCore_GetCoreAtom(tors, bonds, natoms, user_core_atom, back_tors, use_mult_lib,debug=False): assign = assign_ligand_groups(tors, bonds, natoms) if debug: print(' -- ligand groups assigned.') if (user_core_atom > 0): print(' -- r') core_atom = user_core_atom - 1 else: ...
[ "def", "FindCore_GetCoreAtom", "(", "tors", ",", "bonds", ",", "natoms", ",", "user_core_atom", ",", "back_tors", ",", "use_mult_lib", ",", "debug", "=", "False", ")", ":", "assign", "=", "assign_ligand_groups", "(", "tors", ",", "bonds", ",", "natoms", ")",...
| Description**: Search for the core atom wich maximes the number of sidechains.
[ "|", "Description", "**", ":", "Search", "for", "the", "core", "atom", "wich", "maximes", "the", "number", "of", "sidechains", "." ]
[ "\"\"\"\n |\n **Description**: \n Search for the core atom wich maximes\n the number of sidechains.\n\n **Input:**\n - tors: Atoms with torsions\n - bonds: connectivity\n - natoms: number of atoms of the ligand\n - user_core_atom: predefined user core atom\n - back_tors: user...
[ { "param": "tors", "type": null }, { "param": "bonds", "type": null }, { "param": "natoms", "type": null }, { "param": "user_core_atom", "type": null }, { "param": "back_tors", "type": null }, { "param": "use_mult_lib", "type": null }, { "p...
{ "returns": [], "raises": [], "params": [ { "identifier": "tors", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "bonds", "type": null, "docstring": null, "docstring_tokens": ...
5cd6396b2c5b0c7c6a29bd9cc8073ca75809be2c
danielSoler93/FrAG_PELE
frag_pele/PlopRotTemp_S_2017/PlopRotTemp.py
[ "MIT" ]
Python
assign_bonds_to_groups
<not_specific>
def assign_bonds_to_groups(tors, group): """ | **Description:** Make a group for each torsion bond and keep track of how many members Finally it returns the biggest group. **Input:** - Tors: atoms with torsions - Group: Atoms grouped by proximity **Output:** - output: li...
| **Description:** Make a group for each torsion bond and keep track of how many members Finally it returns the biggest group. **Input:** - Tors: atoms with torsions - Group: Atoms grouped by proximity **Output:** - output: lit of group_numbers - big_grup: biggest gro...
| Description:** Make a group for each torsion bond and keep track of how many members Finally it returns the biggest group. atoms with torsions Group: Atoms grouped by proximity lit of group_numbers big_grup: biggest group nbig_group: members on the biggest group
[ "|", "Description", ":", "**", "Make", "a", "group", "for", "each", "torsion", "bond", "and", "keep", "track", "of", "how", "many", "members", "Finally", "it", "returns", "the", "biggest", "group", ".", "atoms", "with", "torsions", "Group", ":", "Atoms", ...
def assign_bonds_to_groups(tors, group): output = [] big_group = -1 nbig_group = 0 ngroup = max(group) ngroup_members = [] for i in range(ngroup + 1): ngroup_members.append(0) for t in tors: group_number = max(group[t[0]], group[t[1]]) output.append(group_number) ...
[ "def", "assign_bonds_to_groups", "(", "tors", ",", "group", ")", ":", "output", "=", "[", "]", "big_group", "=", "-", "1", "nbig_group", "=", "0", "ngroup", "=", "max", "(", "group", ")", "ngroup_members", "=", "[", "]", "for", "i", "in", "range", "(...
| Description:** Make a group for each torsion bond and keep track of how many members
[ "|", "Description", ":", "**", "Make", "a", "group", "for", "each", "torsion", "bond", "and", "keep", "track", "of", "how", "many", "members" ]
[ "\"\"\"\n |\n **Description:** Make a group for each torsion bond\n and keep track of how many members\n\n Finally it returns the biggest group.\n\n **Input:**\n - Tors: atoms with torsions\n - Group: Atoms grouped by proximity\n\n **Output:**\n - output: lit of group_numbers\n ...
[ { "param": "tors", "type": null }, { "param": "group", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "tors", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "group", "type": null, "docstring": null, "docstring_tokens": ...
5cd6396b2c5b0c7c6a29bd9cc8073ca75809be2c
danielSoler93/FrAG_PELE
frag_pele/PlopRotTemp_S_2017/PlopRotTemp.py
[ "MIT" ]
Python
MatchTempMaeAtoms
<not_specific>
def MatchTempMaeAtoms(mae_file, template_file): """ | **Description:** Say which number of atom of th mae_file corresponds to the one on the template_file **Input:** - mae_file: topology of the ligand - template_file: topology of the ligand template **Output:** - ma...
| **Description:** Say which number of atom of th mae_file corresponds to the one on the template_file **Input:** - mae_file: topology of the ligand - template_file: topology of the ligand template **Output:** - mae2temp: Which number of atom of the template file corre...
| Description:** Say which number of atom of th mae_file corresponds to the one on the template_file topology of the ligand template_file: topology of the ligand template Explanation--> Atom number 5 from the mae correspond the 6th of the template. Explanation--> Atom number 5 of the template file corresponds to...
[ "|", "Description", ":", "**", "Say", "which", "number", "of", "atom", "of", "th", "mae_file", "corresponds", "to", "the", "one", "on", "the", "template_file", "topology", "of", "the", "ligand", "template_file", ":", "topology", "of", "the", "ligand", "templ...
def MatchTempMaeAtoms(mae_file, template_file): [parent, zmat, temp_names] = read_zmat_template(template_file) mae_names = find_names_in_mae(mae_file) if ( len(temp_names) != len(mae_names)): raise Exception( "MAE and template of different length %d!=%d (check if the input file has more ...
[ "def", "MatchTempMaeAtoms", "(", "mae_file", ",", "template_file", ")", ":", "[", "parent", ",", "zmat", ",", "temp_names", "]", "=", "read_zmat_template", "(", "template_file", ")", "mae_names", "=", "find_names_in_mae", "(", "mae_file", ")", "if", "(", "len"...
| Description:** Say which number of atom of th mae_file corresponds to the one on the template_file
[ "|", "Description", ":", "**", "Say", "which", "number", "of", "atom", "of", "th", "mae_file", "corresponds", "to", "the", "one", "on", "the", "template_file" ]
[ "\"\"\"\n |\n **Description:** Say which number of atom of th mae_file corresponds to the one on the template_file\n\n **Input:**\n - mae_file: topology of the ligand\n - template_file: topology of the ligand template\n\n **Output:**\n - mae2temp: Which number of atom of the...
[ { "param": "mae_file", "type": null }, { "param": "template_file", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "mae_file", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "template_file", "type": null, "docstring": null, "docstri...
5cd6396b2c5b0c7c6a29bd9cc8073ca75809be2c
danielSoler93/FrAG_PELE
frag_pele/PlopRotTemp_S_2017/PlopRotTemp.py
[ "MIT" ]
Python
check_max_rotatable_bonds
<not_specific>
def check_max_rotatable_bonds(group, tors, tors_ring_num): """ Check if some sidechain has more than 2 rotatable bonds to lower its resolution """ LIMIT_ROTATABLE_BONDS = 3 max_rotatable_bonds = [] for grp in range(max(group) + 1): count = 0 for i in range(l...
Check if some sidechain has more than 2 rotatable bonds to lower its resolution
Check if some sidechain has more than 2 rotatable bonds to lower its resolution
[ "Check", "if", "some", "sidechain", "has", "more", "than", "2", "rotatable", "bonds", "to", "lower", "its", "resolution" ]
def check_max_rotatable_bonds(group, tors, tors_ring_num): LIMIT_ROTATABLE_BONDS = 3 max_rotatable_bonds = [] for grp in range(max(group) + 1): count = 0 for i in range(len(tors)): if ( group[tors[i][0]] == grp or group[tors[i][1]] == grp): if (tors_ring_num[i] ==...
[ "def", "check_max_rotatable_bonds", "(", "group", ",", "tors", ",", "tors_ring_num", ")", ":", "LIMIT_ROTATABLE_BONDS", "=", "3", "max_rotatable_bonds", "=", "[", "]", "for", "grp", "in", "range", "(", "max", "(", "group", ")", "+", "1", ")", ":", "count",...
Check if some sidechain has more than 2 rotatable bonds to lower its resolution
[ "Check", "if", "some", "sidechain", "has", "more", "than", "2", "rotatable", "bonds", "to", "lower", "its", "resolution" ]
[ "\"\"\"\n Check if some sidechain has more\n than 2 rotatable bonds to lower\n its resolution\n \"\"\"" ]
[ { "param": "group", "type": null }, { "param": "tors", "type": null }, { "param": "tors_ring_num", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "group", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "tors", "type": null, "docstring": null, "docstring_tokens": ...
eb5188e03f2c085e25ad0de44367d2c29bdcf606
danielSoler93/FrAG_PELE
frag_pele/Growing/bestStructs.py
[ "MIT" ]
Python
parse_values
<not_specific>
def parse_values(reports, n_structs, criteria, sort_order, steps): """ Description: Parse the 'reports' and create a sorted array of size n_structs following the criteria chosen by the user. """ INITIAL_DATA = [(DIR, []), (REPORT, []), (steps, []), ...
Description: Parse the 'reports' and create a sorted array of size n_structs following the criteria chosen by the user.
Parse the 'reports' and create a sorted array of size n_structs following the criteria chosen by the user.
[ "Parse", "the", "'", "reports", "'", "and", "create", "a", "sorted", "array", "of", "size", "n_structs", "following", "the", "criteria", "chosen", "by", "the", "user", "." ]
def parse_values(reports, n_structs, criteria, sort_order, steps): INITIAL_DATA = [(DIR, []), (REPORT, []), (steps, []), (criteria, []) ] min_values = pd.DataFrame.from_dict(dict(INITIAL_DATA)) for f in reports: report_n...
[ "def", "parse_values", "(", "reports", ",", "n_structs", ",", "criteria", ",", "sort_order", ",", "steps", ")", ":", "INITIAL_DATA", "=", "[", "(", "DIR", ",", "[", "]", ")", ",", "(", "REPORT", ",", "[", "]", ")", ",", "(", "steps", ",", "[", "]...
Description: Parse the 'reports' and create a sorted array of size n_structs following the criteria chosen by the user.
[ "Description", ":", "Parse", "the", "'", "reports", "'", "and", "create", "a", "sorted", "array", "of", "size", "n_structs", "following", "the", "criteria", "chosen", "by", "the", "user", "." ]
[ "\"\"\"\n\n Description: Parse the 'reports' and create a sorted array\n of size n_structs following the criteria chosen by the user.\n\n \"\"\"", "# Skip first line not to get initial structure" ]
[ { "param": "reports", "type": null }, { "param": "n_structs", "type": null }, { "param": "criteria", "type": null }, { "param": "sort_order", "type": null }, { "param": "steps", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "reports", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "n_structs", "type": null, "docstring": null, "docstring_to...
413603baaa8b8056065050adda914d8433d5a711
danielSoler93/FrAG_PELE
frag_pele/Analysis/interaction_detector.py
[ "MIT" ]
Python
parse_arguments
<not_specific>
def parse_arguments(): """ Parse user arguments Output: list with all the user arguments """ # All the docstrings are very provisional and some of them are old, they would be changed in further steps!! parser = argparse.ArgumentParser(description="""""") required_named =...
Parse user arguments Output: list with all the user arguments
Parse user arguments Output: list with all the user arguments
[ "Parse", "user", "arguments", "Output", ":", "list", "with", "all", "the", "user", "arguments" ]
def parse_arguments(): parser = argparse.ArgumentParser(description="""""") required_named = parser.add_argument_group('required named arguments') required_named.add_argument("-tpdb", "--tar_pdb", required=True, help="""Target PDB file.""") required_named.add_argument("-r...
[ "def", "parse_arguments", "(", ")", ":", "parser", "=", "argparse", ".", "ArgumentParser", "(", "description", "=", "\"\"\"\"\"\"", ")", "required_named", "=", "parser", ".", "add_argument_group", "(", "'required named arguments'", ")", "required_named", ".", "add_a...
Parse user arguments Output: list with all the user arguments
[ "Parse", "user", "arguments", "Output", ":", "list", "with", "all", "the", "user", "arguments" ]
[ "\"\"\"\n Parse user arguments\n\n Output: list with all the user arguments\n \"\"\"", "# All the docstrings are very provisional and some of them are old, they would be changed in further steps!!", "# Growing related arguments" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
8326f9a53af2b011808743a126bb849f92b7b027
danielSoler93/FrAG_PELE
frag_pele/Analysis/get_plots.py
[ "MIT" ]
Python
parse_arguments
<not_specific>
def parse_arguments(): """ Parse user arguments Output: list with all the user arguments """ # All the docstrings are very provisional and some of them are old, they would be changed in further steps!! parser = argparse.ArgumentParser(description="""Script to perform plots. ...
Parse user arguments Output: list with all the user arguments
Parse user arguments Output: list with all the user arguments
[ "Parse", "user", "arguments", "Output", ":", "list", "with", "all", "the", "user", "arguments" ]
def parse_arguments(): parser = argparse.ArgumentParser(description="""Script to perform plots. You can choose between different type of plots (depending on your input file): 'boxplot_single' if your input is the result of the analysis between two structures, for which you have computed the RMSD and the CA ...
[ "def", "parse_arguments", "(", ")", ":", "parser", "=", "argparse", ".", "ArgumentParser", "(", "description", "=", "\"\"\"Script to perform plots. You can choose between different\n type of plots (depending on your input file): 'boxplot_single' if your input is the result of the analys...
Parse user arguments Output: list with all the user arguments
[ "Parse", "user", "arguments", "Output", ":", "list", "with", "all", "the", "user", "arguments" ]
[ "\"\"\"\n Parse user arguments\n\n Output: list with all the user arguments\n \"\"\"", "# All the docstrings are very provisional and some of them are old, they would be changed in further steps!!", "# Growing related arguments" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
30d6a8dd7f91842eef0f30050a69b973059840db
danielSoler93/FrAG_PELE
frag_pele/Growing/template_fragmenter.py
[ "MIT" ]
Python
main
<not_specific>
def main(template_initial_path, template_grown_path, step, total_steps, hydrogen_to_replace, core_atom_linker, tmpl_out_path, null_charges=False, growing_mode="SoftcoreLike"): """ Module to modify templates, currently working in OPLS2005. This main function basically compares two templates; an init...
Module to modify templates, currently working in OPLS2005. This main function basically compares two templates; an initial and a grown one, extracting the atoms of the fragment (that have been grown). Then, it uses this data to modify Linearly different attributes of the template, particularly, sigmas, cha...
Module to modify templates, currently working in OPLS2005. This main function basically compares two templates; an initial and a grown one, extracting the atoms of the fragment (that have been grown). Then, it uses this data to modify Linearly different attributes of the template, particularly, sigmas, charges, bond eq...
[ "Module", "to", "modify", "templates", "currently", "working", "in", "OPLS2005", ".", "This", "main", "function", "basically", "compares", "two", "templates", ";", "an", "initial", "and", "a", "grown", "one", "extracting", "the", "atoms", "of", "the", "fragmen...
def main(template_initial_path, template_grown_path, step, total_steps, hydrogen_to_replace, core_atom_linker, tmpl_out_path, null_charges=False, growing_mode="SoftcoreLike"): lambda_to_reduce = float(step/(total_steps+1)) templ_ini = TemplateImpact(template_initial_path) for bond in templ_ini.list...
[ "def", "main", "(", "template_initial_path", ",", "template_grown_path", ",", "step", ",", "total_steps", ",", "hydrogen_to_replace", ",", "core_atom_linker", ",", "tmpl_out_path", ",", "null_charges", "=", "False", ",", "growing_mode", "=", "\"SoftcoreLike\"", ")", ...
Module to modify templates, currently working in OPLS2005.
[ "Module", "to", "modify", "templates", "currently", "working", "in", "OPLS2005", "." ]
[ "\"\"\"\n Module to modify templates, currently working in OPLS2005. This main function basically compares two templates;\n an initial and a grown one, extracting the atoms of the fragment (that have been grown). Then, it uses this data\n to modify Linearly different attributes of the template, particularl...
[ { "param": "template_initial_path", "type": null }, { "param": "template_grown_path", "type": null }, { "param": "step", "type": null }, { "param": "total_steps", "type": null }, { "param": "hydrogen_to_replace", "type": null }, { "param": "core_atom_l...
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "template_initial_path", "type": null, "docstring": "Path to an OPLS2005 template of the core ligand.", "docstring_t...
0f63620b8efe2fb48e82483f845e6cc9ea4075e6
danielSoler93/FrAG_PELE
frag_pele/Helpers/center_of_mass.py
[ "MIT" ]
Python
center_of_mass
<not_specific>
def center_of_mass(pdbfile, include='ATOM,HETATM'): """ Calculates center of mass of a protein and/or ligand structure. Returns: center (list): List of float coordinates [x,y,z] that represent the center of mass (precision 3). """ center = [None, None, None] include = tuple(include.split(',')) ...
Calculates center of mass of a protein and/or ligand structure. Returns: center (list): List of float coordinates [x,y,z] that represent the center of mass (precision 3).
Calculates center of mass of a protein and/or ligand structure.
[ "Calculates", "center", "of", "mass", "of", "a", "protein", "and", "/", "or", "ligand", "structure", "." ]
def center_of_mass(pdbfile, include='ATOM,HETATM'): center = [None, None, None] include = tuple(include.split(',')) with open(pdbfile, 'r') as pdb: coordinates = [] masses = [] for line in pdb: if line.startswith(include): coordinates.append([float(line[30:38]), ...
[ "def", "center_of_mass", "(", "pdbfile", ",", "include", "=", "'ATOM,HETATM'", ")", ":", "center", "=", "[", "None", ",", "None", ",", "None", "]", "include", "=", "tuple", "(", "include", ".", "split", "(", "','", ")", ")", "with", "open", "(", "pdb...
Calculates center of mass of a protein and/or ligand structure.
[ "Calculates", "center", "of", "mass", "of", "a", "protein", "and", "/", "or", "ligand", "structure", "." ]
[ "\"\"\"\n Calculates center of mass of a protein and/or ligand structure.\n Returns:\n center (list): List of float coordinates [x,y,z] that represent the\n center of mass (precision 3).\n \"\"\"", "# extract coordinates [ [x1,y1,z1], [x2,y2,z2], ... ]", "# x_coord", "# y_coord", "# z_coord", ...
[ { "param": "pdbfile", "type": null }, { "param": "include", "type": null } ]
{ "returns": [ { "docstring": "center (list): List of float coordinates [x,y,z] that represent the\ncenter of mass (precision 3).", "docstring_tokens": [ "center", "(", "list", ")", ":", "List", "of", "float", "coordinates", ...
aa32c6fc5f6ed2ab97d9006fa4f7693029ca4ad9
danielSoler93/FrAG_PELE
frag_pele/Analysis/backtrackFragTrajectory.py
[ "MIT" ]
Python
parseArguments
<not_specific>
def parseArguments(): """ Parse the command-line options :returns: str, str, str, str -- path to file to backtrack, path to the result files, output path where to write the files, name of the files """ desc = "Write the information related to the conformation networ...
Parse the command-line options :returns: str, str, str, str -- path to file to backtrack, path to the result files, output path where to write the files, name of the files
Parse the command-line options
[ "Parse", "the", "command", "-", "line", "options" ]
def parseArguments(): desc = "Write the information related to the conformation network to file\n" parser = argparse.ArgumentParser(description=desc) parser.add_argument("file_to_backtrack", type=str, help="File of the selected_results folder that you want to" ...
[ "def", "parseArguments", "(", ")", ":", "desc", "=", "\"Write the information related to the conformation network to file\\n\"", "parser", "=", "argparse", ".", "ArgumentParser", "(", "description", "=", "desc", ")", "parser", ".", "add_argument", "(", "\"file_to_backtrac...
Parse the command-line options
[ "Parse", "the", "command", "-", "line", "options" ]
[ "\"\"\"\n Parse the command-line options\n\n :returns: str, str, str, str -- path to file to backtrack,\n path to the result files,\n output path where to write the files, name of the files\n \"\"\"" ]
[]
{ "returns": [ { "docstring": "str, str, str, str -- path to file to backtrack,\npath to the result files,\noutput path where to write the files, name of the files", "docstring_tokens": [ "str", "str", "str", "str", "--", "path", "to", "...
796d0d5d6cb7eb50cddbc5f5dc1605e1552e29ea
danielSoler93/FrAG_PELE
frag_pele/Growing/template_selector.py
[ "MIT" ]
Python
trajectory_selector
null
def trajectory_selector(output, path_to_file="/growing_output", report="report", trajectory="trajectory.pdb", criteria="Binding Energy"): """ This function select the step of a trajectory of PELE with the minimum value of the criteria selected and extract it as a single pdb file....
This function select the step of a trajectory of PELE with the minimum value of the criteria selected and extract it as a single pdb file.
This function select the step of a trajectory of PELE with the minimum value of the criteria selected and extract it as a single pdb file.
[ "This", "function", "select", "the", "step", "of", "a", "trajectory", "of", "PELE", "with", "the", "minimum", "value", "of", "the", "criteria", "selected", "and", "extract", "it", "as", "a", "single", "pdb", "file", "." ]
def trajectory_selector(output, path_to_file="/growing_output", report="report", trajectory="trajectory.pdb", criteria="Binding Energy"): with open(os.path.join(path_to_file, trajectory), 'r') as input_file: file_content = input_file.read() data = pd.read_csv(os.path.join(path_to...
[ "def", "trajectory_selector", "(", "output", ",", "path_to_file", "=", "\"/growing_output\"", ",", "report", "=", "\"report\"", ",", "trajectory", "=", "\"trajectory.pdb\"", ",", "criteria", "=", "\"Binding Energy\"", ")", ":", "with", "open", "(", "os", ".", "p...
This function select the step of a trajectory of PELE with the minimum value of the criteria selected and extract it as a single pdb file.
[ "This", "function", "select", "the", "step", "of", "a", "trajectory", "of", "PELE", "with", "the", "minimum", "value", "of", "the", "criteria", "selected", "and", "extract", "it", "as", "a", "single", "pdb", "file", "." ]
[ "\"\"\"\n This function select the step of a trajectory of PELE\n with the minimum value of the criteria selected\n and extract it as a single pdb file.\n \"\"\"", "# Storing the trajectory as a string", "# Storing the report file as pandas data-frame", "# Now, select only the columns corresponden...
[ { "param": "output", "type": null }, { "param": "path_to_file", "type": null }, { "param": "report", "type": null }, { "param": "trajectory", "type": null }, { "param": "criteria", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "output", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "path_to_file", "type": null, "docstring": null, "docstring_...
796d0d5d6cb7eb50cddbc5f5dc1605e1552e29ea
danielSoler93/FrAG_PELE
frag_pele/Growing/template_selector.py
[ "MIT" ]
Python
change_ligandname
null
def change_ligandname(input_file, output): """ From an input pdb file this function replace the first character of the ligand name string to the next one in alphabetic order """ # Creating a list of capital letters letters = list(string.ascii_uppercase) with open(output, 'w') as output_f: ...
From an input pdb file this function replace the first character of the ligand name string to the next one in alphabetic order
From an input pdb file this function replace the first character of the ligand name string to the next one in alphabetic order
[ "From", "an", "input", "pdb", "file", "this", "function", "replace", "the", "first", "character", "of", "the", "ligand", "name", "string", "to", "the", "next", "one", "in", "alphabetic", "order" ]
def change_ligandname(input_file, output): letters = list(string.ascii_uppercase) with open(output, 'w') as output_f: with open(input_file) as input_f: for line in input_f: if line.startswith("HETATM"): ligandname_old = line.split()[3] ...
[ "def", "change_ligandname", "(", "input_file", ",", "output", ")", ":", "letters", "=", "list", "(", "string", ".", "ascii_uppercase", ")", "with", "open", "(", "output", ",", "'w'", ")", "as", "output_f", ":", "with", "open", "(", "input_file", ")", "as...
From an input pdb file this function replace the first character of the ligand name string to the next one in alphabetic order
[ "From", "an", "input", "pdb", "file", "this", "function", "replace", "the", "first", "character", "of", "the", "ligand", "name", "string", "to", "the", "next", "one", "in", "alphabetic", "order" ]
[ "\"\"\"\n From an input pdb file this function replace the first character of the ligand name\n string to the next one in alphabetic order\n \"\"\"", "# Creating a list of capital letters", "# We only want to read lines that contain information about the ligand", "# This is the ligandname of the orig...
[ { "param": "input_file", "type": null }, { "param": "output", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "input_file", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "output", "type": null, "docstring": null, "docstring_to...
755f4a3e78295b4700c6a88ed1a56a28f720383e
danielSoler93/FrAG_PELE
frag_pele/Growing/simulations_linker.py
[ "MIT" ]
Python
control_file_modifier
<not_specific>
def control_file_modifier(control_template, pdb, license, working_dir, overlap=0.7, step=0, results_path="/growing_output", steps=6, chain="L", constraints=" ", center="", temperature=1000, seed=1279183, steering=0, translation_high=0.05, translation_low=0.02, ...
This function creates n control files for each intermediate template created in order to change the logPath, reportPath and trajectoryPath to have all control files prepared for PELE simulations.
This function creates n control files for each intermediate template created in order to change the logPath, reportPath and trajectoryPath to have all control files prepared for PELE simulations.
[ "This", "function", "creates", "n", "control", "files", "for", "each", "intermediate", "template", "created", "in", "order", "to", "change", "the", "logPath", "reportPath", "and", "trajectoryPath", "to", "have", "all", "control", "files", "prepared", "for", "PEL...
def control_file_modifier(control_template, pdb, license, working_dir, overlap=0.7, step=0, results_path="/growing_output", steps=6, chain="L", constraints=" ", center="", temperature=1000, seed=1279183, steering=0, translation_high=0.05, translation_low=0.02, ...
[ "def", "control_file_modifier", "(", "control_template", ",", "pdb", ",", "license", ",", "working_dir", ",", "overlap", "=", "0.7", ",", "step", "=", "0", ",", "results_path", "=", "\"/growing_output\"", ",", "steps", "=", "6", ",", "chain", "=", "\"L\"", ...
This function creates n control files for each intermediate template created in order to change the logPath, reportPath and trajectoryPath to have all control files prepared for PELE simulations.
[ "This", "function", "creates", "n", "control", "files", "for", "each", "intermediate", "template", "created", "in", "order", "to", "change", "the", "logPath", "reportPath", "and", "trajectoryPath", "to", "have", "all", "control", "files", "prepared", "for", "PEL...
[ "\"\"\"\n This function creates n control files for each intermediate template created in order to change\n the logPath, reportPath and trajectoryPath to have all control files prepared for PELE simulations.\n \"\"\"", "# Then, in the main loop we will do a copy of control files, so we will print this in...
[ { "param": "control_template", "type": null }, { "param": "pdb", "type": null }, { "param": "license", "type": null }, { "param": "working_dir", "type": null }, { "param": "overlap", "type": null }, { "param": "step", "type": null }, { "par...
{ "returns": [], "raises": [], "params": [ { "identifier": "control_template", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "pdb", "type": null, "docstring": null, "docstring...
755f4a3e78295b4700c6a88ed1a56a28f720383e
danielSoler93/FrAG_PELE
frag_pele/Growing/simulations_linker.py
[ "MIT" ]
Python
simulation_runner
null
def simulation_runner(path_to_pele, control_in, cpus=4, srun=True): """ Runs a PELE simulation with the parameters described in the input control file. Input: path_to_pele --> Complete path to PELE folder control_in --> Name of the control file with the parameters to run PELE """ if cpus:...
Runs a PELE simulation with the parameters described in the input control file. Input: path_to_pele --> Complete path to PELE folder control_in --> Name of the control file with the parameters to run PELE
Runs a PELE simulation with the parameters described in the input control file. Input. -> Complete path to PELE folder -> Name of the control file with the parameters to run PELE
[ "Runs", "a", "PELE", "simulation", "with", "the", "parameters", "described", "in", "the", "input", "control", "file", ".", "Input", ".", "-", ">", "Complete", "path", "to", "PELE", "folder", "-", ">", "Name", "of", "the", "control", "file", "with", "the"...
def simulation_runner(path_to_pele, control_in, cpus=4, srun=True): if cpus: cpus = int(cpus) if cpus < 2: logger.critical("Sorry, to run PELE with paralel processors you need at least 2 cores!") else: if srun: logger.info("Starting PELE simulation. Yo...
[ "def", "simulation_runner", "(", "path_to_pele", ",", "control_in", ",", "cpus", "=", "4", ",", "srun", "=", "True", ")", ":", "if", "cpus", ":", "cpus", "=", "int", "(", "cpus", ")", "if", "cpus", "<", "2", ":", "logger", ".", "critical", "(", "\"...
Runs a PELE simulation with the parameters described in the input control file.
[ "Runs", "a", "PELE", "simulation", "with", "the", "parameters", "described", "in", "the", "input", "control", "file", "." ]
[ "\"\"\"\n Runs a PELE simulation with the parameters described in the input control file.\n\n Input:\n\n path_to_pele --> Complete path to PELE folder\n\n control_in --> Name of the control file with the parameters to run PELE\n \"\"\"" ]
[ { "param": "path_to_pele", "type": null }, { "param": "control_in", "type": null }, { "param": "cpus", "type": null }, { "param": "srun", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "path_to_pele", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "control_in", "type": null, "docstring": null, "docstr...
7ab4fc70c2dd56fd827cacae9ca21d59edea9be5
danielSoler93/FrAG_PELE
frag_pele/Analysis/compute_atom_atom_distance.py
[ "MIT" ]
Python
parseArguments
<not_specific>
def parseArguments(): """ Parse the command-line options :returns: str, int, int -- path to file to results folder, index of the first atom, index of the second atom """ desc = "It includes the atom-atom distance of the specified ones to report files\n" parser = ...
Parse the command-line options :returns: str, int, int -- path to file to results folder, index of the first atom, index of the second atom
Parse the command-line options
[ "Parse", "the", "command", "-", "line", "options" ]
def parseArguments(): desc = "It includes the atom-atom distance of the specified ones to report files\n" parser = argparse.ArgumentParser(description=desc) required_named = parser.add_argument_group('required named arguments') required_named.add_argument("sim_folder", type=str, help="Path to the simula...
[ "def", "parseArguments", "(", ")", ":", "desc", "=", "\"It includes the atom-atom distance of the specified ones to report files\\n\"", "parser", "=", "argparse", ".", "ArgumentParser", "(", "description", "=", "desc", ")", "required_named", "=", "parser", ".", "add_argum...
Parse the command-line options
[ "Parse", "the", "command", "-", "line", "options" ]
[ "\"\"\"\n Parse the command-line options\n :returns: str, int, int -- path to file to results folder,\n index of the first atom,\n index of the second atom\n \"\"\"" ]
[]
{ "returns": [ { "docstring": "str, int, int -- path to file to results folder,\nindex of the first atom,\nindex of the second atom", "docstring_tokens": [ "str", "int", "int", "--", "path", "to", "file", "to", "results", ...
26c2d1d11a8d797379c3db69c3b2157d5fb0a2f5
danielSoler93/FrAG_PELE
frag_pele/Covalent/pdb_corrector.py
[ "MIT" ]
Python
parseArguments
<not_specific>
def parseArguments(): """ Parse the command-line options """ desc = "It process PDB files putting the ligand part of a covalent ligand into the residue that it is attached with." parser = argparse.ArgumentParser(description=desc) required_named = parser.add_argument_group('required named arg...
Parse the command-line options
Parse the command-line options
[ "Parse", "the", "command", "-", "line", "options" ]
def parseArguments(): desc = "It process PDB files putting the ligand part of a covalent ligand into the residue that it is attached with." parser = argparse.ArgumentParser(description=desc) required_named = parser.add_argument_group('required named arguments') required_named.add_argument("-i", "--input...
[ "def", "parseArguments", "(", ")", ":", "desc", "=", "\"It process PDB files putting the ligand part of a covalent ligand into the residue that it is attached with.\"", "parser", "=", "argparse", ".", "ArgumentParser", "(", "description", "=", "desc", ")", "required_named", "="...
Parse the command-line options
[ "Parse", "the", "command", "-", "line", "options" ]
[ "\"\"\"\n Parse the command-line options\n \"\"\"" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
26c2d1d11a8d797379c3db69c3b2157d5fb0a2f5
danielSoler93/FrAG_PELE
frag_pele/Covalent/pdb_corrector.py
[ "MIT" ]
Python
_get_ligand_section
null
def _get_ligand_section(self): """ It gets and prints the lines of the PDB file which contains the assigned ligand_resname. It will fill the attribute self._ligand_lines and self._ligand """ self._ligand_lines = self._pdb.get_atoms_of_resname(self._ligand_resname) self._l...
It gets and prints the lines of the PDB file which contains the assigned ligand_resname. It will fill the attribute self._ligand_lines and self._ligand
It gets and prints the lines of the PDB file which contains the assigned ligand_resname. It will fill the attribute self._ligand_lines and self._ligand
[ "It", "gets", "and", "prints", "the", "lines", "of", "the", "PDB", "file", "which", "contains", "the", "assigned", "ligand_resname", ".", "It", "will", "fill", "the", "attribute", "self", ".", "_ligand_lines", "and", "self", ".", "_ligand" ]
def _get_ligand_section(self): self._ligand_lines = self._pdb.get_atoms_of_resname(self._ligand_resname) self._ligand = ''.join(self._ligand_lines) if self._verbose: print('Ligand lines: \n' + self._ligand)
[ "def", "_get_ligand_section", "(", "self", ")", ":", "self", ".", "_ligand_lines", "=", "self", ".", "_pdb", ".", "get_atoms_of_resname", "(", "self", ".", "_ligand_resname", ")", "self", ".", "_ligand", "=", "''", ".", "join", "(", "self", ".", "_ligand_l...
It gets and prints the lines of the PDB file which contains the assigned ligand_resname.
[ "It", "gets", "and", "prints", "the", "lines", "of", "the", "PDB", "file", "which", "contains", "the", "assigned", "ligand_resname", "." ]
[ "\"\"\"\n It gets and prints the lines of the PDB file which contains the assigned ligand_resname.\n It will fill the attribute self._ligand_lines and self._ligand\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
26c2d1d11a8d797379c3db69c3b2157d5fb0a2f5
danielSoler93/FrAG_PELE
frag_pele/Covalent/pdb_corrector.py
[ "MIT" ]
Python
_get_residue_info
null
def _get_residue_info(self): """ It obtains the residue type of the residue that has the ligand covalently attached and fills the variable self.residue_type """ residue_lines = self._pdb.get_residue(self._residue_chain, str(self._residue_number)) self.residue = ''.join(re...
It obtains the residue type of the residue that has the ligand covalently attached and fills the variable self.residue_type
It obtains the residue type of the residue that has the ligand covalently attached and fills the variable self.residue_type
[ "It", "obtains", "the", "residue", "type", "of", "the", "residue", "that", "has", "the", "ligand", "covalently", "attached", "and", "fills", "the", "variable", "self", ".", "residue_type" ]
def _get_residue_info(self): residue_lines = self._pdb.get_residue(self._residue_chain, str(self._residue_number)) self.residue = ''.join(residue_lines) self.residue_type = ''.join(residue_lines[0][17:20]) if self._verbose: print('Residue lines: \n' + self.residue) ...
[ "def", "_get_residue_info", "(", "self", ")", ":", "residue_lines", "=", "self", ".", "_pdb", ".", "get_residue", "(", "self", ".", "_residue_chain", ",", "str", "(", "self", ".", "_residue_number", ")", ")", "self", ".", "residue", "=", "''", ".", "join...
It obtains the residue type of the residue that has the ligand covalently attached and fills the variable self.residue_type
[ "It", "obtains", "the", "residue", "type", "of", "the", "residue", "that", "has", "the", "ligand", "covalently", "attached", "and", "fills", "the", "variable", "self", ".", "residue_type" ]
[ "\"\"\"\n It obtains the residue type of the residue that has the ligand covalently attached and fills\n the variable self.residue_type\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
26c2d1d11a8d797379c3db69c3b2157d5fb0a2f5
danielSoler93/FrAG_PELE
frag_pele/Covalent/pdb_corrector.py
[ "MIT" ]
Python
_correct_ligand_to_be_residue
null
def _correct_ligand_to_be_residue(self): """ It corrects the ligand lines to transform it in to residue lines """ new_ligand_lines = [] for lig_line in self._ligand_lines: lig_line = list(lig_line) lig_line[0:6] = "ATOM " # Atom section lig_l...
It corrects the ligand lines to transform it in to residue lines
It corrects the ligand lines to transform it in to residue lines
[ "It", "corrects", "the", "ligand", "lines", "to", "transform", "it", "in", "to", "residue", "lines" ]
def _correct_ligand_to_be_residue(self): new_ligand_lines = [] for lig_line in self._ligand_lines: lig_line = list(lig_line) lig_line[0:6] = "ATOM " lig_line[17:20] = self.residue_type lig_line[21:22] = self._residue_chain lig_line[22:26...
[ "def", "_correct_ligand_to_be_residue", "(", "self", ")", ":", "new_ligand_lines", "=", "[", "]", "for", "lig_line", "in", "self", ".", "_ligand_lines", ":", "lig_line", "=", "list", "(", "lig_line", ")", "lig_line", "[", "0", ":", "6", "]", "=", "\"ATOM ...
It corrects the ligand lines to transform it in to residue lines
[ "It", "corrects", "the", "ligand", "lines", "to", "transform", "it", "in", "to", "residue", "lines" ]
[ "\"\"\"\n It corrects the ligand lines to transform it in to residue lines\n \"\"\"", "# Atom section", "# Residue name", "# Chain", "# Residue number, must be right-aligned" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
26c2d1d11a8d797379c3db69c3b2157d5fb0a2f5
danielSoler93/FrAG_PELE
frag_pele/Covalent/pdb_corrector.py
[ "MIT" ]
Python
_join_ligand_and_residue
<not_specific>
def _join_ligand_and_residue(self, reindexing=True): """ It appends ligand lines onto the residue, and it can reindex atom ids. Parameters ---------- reindexing : bool if it is true, it will reindex the atom IDs of the joining result Returns ...
It appends ligand lines onto the residue, and it can reindex atom ids. Parameters ---------- reindexing : bool if it is true, it will reindex the atom IDs of the joining result Returns ------- joining_result : list lines of t...
It appends ligand lines onto the residue, and it can reindex atom ids. Parameters reindexing : bool if it is true, it will reindex the atom IDs of the joining result Returns joining_result : list lines of the amino-acid with the ligand attached, all in the same residue
[ "It", "appends", "ligand", "lines", "onto", "the", "residue", "and", "it", "can", "reindex", "atom", "ids", ".", "Parameters", "reindexing", ":", "bool", "if", "it", "is", "true", "it", "will", "reindex", "the", "atom", "IDs", "of", "the", "joining", "re...
def _join_ligand_and_residue(self, reindexing=True): counter = 1 joining_result = [] for res_line in self.residue.split('\n')[0:-1]: res_line = list(res_line) if reindexing: res_line = list(res_line) res_line[6:11] = "{:>5}".format(counte...
[ "def", "_join_ligand_and_residue", "(", "self", ",", "reindexing", "=", "True", ")", ":", "counter", "=", "1", "joining_result", "=", "[", "]", "for", "res_line", "in", "self", ".", "residue", ".", "split", "(", "'\\n'", ")", "[", "0", ":", "-", "1", ...
It appends ligand lines onto the residue, and it can reindex atom ids.
[ "It", "appends", "ligand", "lines", "onto", "the", "residue", "and", "it", "can", "reindex", "atom", "ids", "." ]
[ "\"\"\"\n It appends ligand lines onto the residue, and it can reindex atom ids.\n\n Parameters\n ----------\n reindexing : bool\n if it is true, it will reindex the atom IDs of the joining result\n \n Returns\n -------\n joining_result : list\n...
[ { "param": "self", "type": null }, { "param": "reindexing", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "reindexing", "type": null, "docstring": null, "docstring_toke...
26c2d1d11a8d797379c3db69c3b2157d5fb0a2f5
danielSoler93/FrAG_PELE
frag_pele/Covalent/pdb_corrector.py
[ "MIT" ]
Python
correct
null
def correct(self, reindexing=True): """ It joins the ligand and the amino-acid of a covalent ligand into a single residue, and both are moved to the residue position of the PDB file. This makes it compatible with PELE. Parameters ---------- reindexing : bool ...
It joins the ligand and the amino-acid of a covalent ligand into a single residue, and both are moved to the residue position of the PDB file. This makes it compatible with PELE. Parameters ---------- reindexing : bool if it is true, it will reindex the atom IDs of ...
It joins the ligand and the amino-acid of a covalent ligand into a single residue, and both are moved to the residue position of the PDB file. This makes it compatible with PELE. Parameters reindexing : bool if it is true, it will reindex the atom IDs of the joining result
[ "It", "joins", "the", "ligand", "and", "the", "amino", "-", "acid", "of", "a", "covalent", "ligand", "into", "a", "single", "residue", "and", "both", "are", "moved", "to", "the", "residue", "position", "of", "the", "PDB", "file", ".", "This", "makes", ...
def correct(self, reindexing=True): global residue_idx new_pdb_lines = [] self._correct_ligand_to_be_residue() residue_corrected = self._join_ligand_and_residue(reindexing) index_filled = False for n, line in enumerate(self._pdb.lines): if line.startswith('ATO...
[ "def", "correct", "(", "self", ",", "reindexing", "=", "True", ")", ":", "global", "residue_idx", "new_pdb_lines", "=", "[", "]", "self", ".", "_correct_ligand_to_be_residue", "(", ")", "residue_corrected", "=", "self", ".", "_join_ligand_and_residue", "(", "rei...
It joins the ligand and the amino-acid of a covalent ligand into a single residue, and both are moved to the residue position of the PDB file.
[ "It", "joins", "the", "ligand", "and", "the", "amino", "-", "acid", "of", "a", "covalent", "ligand", "into", "a", "single", "residue", "and", "both", "are", "moved", "to", "the", "residue", "position", "of", "the", "PDB", "file", "." ]
[ "\"\"\"\n It joins the ligand and the amino-acid of a covalent ligand into a single residue, and both are moved to the\n residue position of the PDB file. This makes it compatible with PELE.\n\n Parameters\n ----------\n reindexing : bool\n if it is true, it will reinde...
[ { "param": "self", "type": null }, { "param": "reindexing", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "reindexing", "type": null, "docstring": null, "docstring_toke...
26c2d1d11a8d797379c3db69c3b2157d5fb0a2f5
danielSoler93/FrAG_PELE
frag_pele/Covalent/pdb_corrector.py
[ "MIT" ]
Python
write_file
null
def write_file(self, output_file, extract_ligand=True): """ It writes the content into an output PDB file. Parameters ---------- output_file : str path of the output PDB file extract_ligand : bool if true it extracts the ligand in a separated PDB ...
It writes the content into an output PDB file. Parameters ---------- output_file : str path of the output PDB file extract_ligand : bool if true it extracts the ligand in a separated PDB file
It writes the content into an output PDB file. Parameters output_file : str path of the output PDB file extract_ligand : bool if true it extracts the ligand in a separated PDB file
[ "It", "writes", "the", "content", "into", "an", "output", "PDB", "file", ".", "Parameters", "output_file", ":", "str", "path", "of", "the", "output", "PDB", "file", "extract_ligand", ":", "bool", "if", "true", "it", "extracts", "the", "ligand", "in", "a", ...
def write_file(self, output_file, extract_ligand=True): with open(output_file, "w") as out_pdb: out_pdb.write(self._pdb.content) print("PDB saved in {}.".format(output_file)) if extract_ligand: lig_lines = self._pdb.get_atoms_of_resname(f"{self._ligand_resname}") ...
[ "def", "write_file", "(", "self", ",", "output_file", ",", "extract_ligand", "=", "True", ")", ":", "with", "open", "(", "output_file", ",", "\"w\"", ")", "as", "out_pdb", ":", "out_pdb", ".", "write", "(", "self", ".", "_pdb", ".", "content", ")", "pr...
It writes the content into an output PDB file.
[ "It", "writes", "the", "content", "into", "an", "output", "PDB", "file", "." ]
[ "\"\"\"\n It writes the content into an output PDB file.\n\n Parameters\n ----------\n output_file : str\n path of the output PDB file\n extract_ligand : bool\n if true it extracts the ligand in a separated PDB file\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "output_file", "type": null }, { "param": "extract_ligand", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "output_file", "type": null, "docstring": null, "docstring_tok...
26c2d1d11a8d797379c3db69c3b2157d5fb0a2f5
danielSoler93/FrAG_PELE
frag_pele/Covalent/pdb_corrector.py
[ "MIT" ]
Python
run
null
def run(input_pdb, residue_chain, residue_number, out_pdb, ligand_resname='UNK', ligand_chain=' ', verbose=False, extract_ligand=True): """ It process PDB files putting the ligand part of a covalent ligand into the residue that it is attached with. Parameters ---------- input_pdb :...
It process PDB files putting the ligand part of a covalent ligand into the residue that it is attached with. Parameters ---------- input_pdb : str path to input PDB file residue_chain : str chain of the residue that has the ligand covalently attached res...
It process PDB files putting the ligand part of a covalent ligand into the residue that it is attached with. Parameters
[ "It", "process", "PDB", "files", "putting", "the", "ligand", "part", "of", "a", "covalent", "ligand", "into", "the", "residue", "that", "it", "is", "attached", "with", ".", "Parameters" ]
def run(input_pdb, residue_chain, residue_number, out_pdb, ligand_resname='UNK', ligand_chain=' ', verbose=False, extract_ligand=True): corrector = CovCorrector(input_pdb=input_pdb, residue_chain=residue_chain, residue_number=residue_number, ligand_resname=ligand_resname, ligan...
[ "def", "run", "(", "input_pdb", ",", "residue_chain", ",", "residue_number", ",", "out_pdb", ",", "ligand_resname", "=", "'UNK'", ",", "ligand_chain", "=", "' '", ",", "verbose", "=", "False", ",", "extract_ligand", "=", "True", ")", ":", "corrector", "=", ...
It process PDB files putting the ligand part of a covalent ligand into the residue that it is attached with.
[ "It", "process", "PDB", "files", "putting", "the", "ligand", "part", "of", "a", "covalent", "ligand", "into", "the", "residue", "that", "it", "is", "attached", "with", "." ]
[ "\"\"\"\n It process PDB files putting the ligand part of a covalent ligand into the residue that it is attached with.\n\n Parameters\n ----------\n input_pdb : str\n path to input PDB file\n residue_chain : str\n chain of the residue that has the ligand covalently a...
[ { "param": "input_pdb", "type": null }, { "param": "residue_chain", "type": null }, { "param": "residue_number", "type": null }, { "param": "out_pdb", "type": null }, { "param": "ligand_resname", "type": null }, { "param": "ligand_chain", "type": n...
{ "returns": [], "raises": [], "params": [ { "identifier": "input_pdb", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "residue_chain", "type": null, "docstring": null, "docstr...