-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
44b747e
commit 8cccce4
Showing
9 changed files
with
362 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,26 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<?eclipse-pydev version="1.0"?><pydev_project> | ||
|
||
|
||
|
||
<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH"> | ||
<path>/${PROJECT_DIR_NAME}/src/kstream</path> | ||
<path>/${PROJECT_DIR_NAME}/src/krisp</path> | ||
<path>/${PROJECT_DIR_NAME}/src/diagvar</path> | ||
<path>/${PROJECT_DIR_NAME}/src</path> | ||
<path>/${PROJECT_DIR_NAME}</path> | ||
</pydev_pathproperty> | ||
|
||
|
||
|
||
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python interpreter</pydev_property> | ||
|
||
|
||
|
||
<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">venv python 3</pydev_property> | ||
|
||
|
||
<pydev_pathproperty name="org.python.pydev.PROJECT_EXTERNAL_SOURCE_PATH"> | ||
|
||
<path>/media/fosterz/external_ssd_2/files/projects/work/current/krisp/.venv/lib/python3.9/site-packages</path> | ||
|
||
</pydev_pathproperty> | ||
|
||
</pydev_project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
def my_new_function(my_arg1, my_arg2, my_opt = TRUE): | ||
# All the code | ||
return None | ||
|
||
|
||
|
||
ref = ["A", "C", "GTC", "T", "T", "G", "G", "C", "C"] | ||
seqs = {"seq 1": ["A", "G", "GTC", "T/G", "T", "GC", "G", "A", "C"], | ||
"seq 2": ["A", "G", "G", "T", "", "G", "<123G12?>", "A", "C"]} | ||
|
||
my_new_function(ref, seqs, mask_same = TRUE) | ||
|
||
# Should print: | ||
# | ||
# Reference : ACGTC T TG- G CC | ||
# seq 1 : .G...T/GTGC G A. | ||
# seq 2 : .G.-- T -G-<1234G2?>A. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
|
||
|
||
|
||
|
||
|
||
def _mask_same(seqs, reference): | ||
""" | ||
Parameters | ||
---------- | ||
seqs : dict of list of str | ||
sequecnes to align, named by group | ||
reference : list of str | ||
The refenrece used to call variants | ||
Returns | ||
------- | ||
list str | ||
Modified version of seqs | ||
""" | ||
for group in seqs.keys(): | ||
for index in range(len(seqs[group])): | ||
if seqs[group][i] == reference[i]: | ||
seqs[group][i] = "." | ||
return(seqs) | ||
|
||
def _pad_columns(seqs, reference): | ||
"""Adding space to account for formatting (non indels).""" | ||
return seqs, reference | ||
|
||
def _pad_indel(seqs, reference): | ||
"""Add dashes to pad indels.""" | ||
return seqs, reference | ||
|
||
def _print_alignment(seqs, reference, ref_name = "Reference"): | ||
ref_name = ref_name.rjust(max_len, " ") | ||
print(f'{ref_name} : ' + ''.join(reference)) | ||
for group_name, seq in seqs.items(): | ||
group_name = group_name.rjust(max_len, " ") | ||
print(group_name + ' : ' + ''.join(seq)) | ||
|
||
|
||
def render_variant(seqs, reference): | ||
"""my short summary | ||
my llong summaryyyyyyyyyyyyyyyyyyyyyyyyyyyyy | ||
yyyyyyyyyyyyyyyyyyyyyyyy | ||
yyyyyyyyyyyy | ||
Parameters | ||
---------- | ||
seqs : dict of list of str | ||
sequecnes to align, named by group | ||
reference : list of str | ||
The refenrece used to call variants | ||
""" | ||
|
||
seqs = _mask_same(seqs, reference) | ||
seqs, reference = _pad_columns(seqs, reference) | ||
seqs = _pad_indel(seqs, reference) | ||
|
||
_print_alignment(seqs, reference) | ||
|
||
|
||
|
||
|
||
if __name__ == "__main__": | ||
|
||
render_variant() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.