Stub for demo notebook for report_diff_between_two_seq_strings.py
script.
import os
file_needed = "report_diff_between_two_seq_strings.py"
if not os.path.isfile(file_needed):
!curl -OL https://raw.githubusercontent.com/fomightez/sequencework/master/Compare_biological_seq_strings/{file_needed}
## Command line (or command line-like) use
%run report_diff_between_two_seq_strings.py GAATTC GATTTC --report_len_diff
1 0
Reporting amount of differences and difference in length of the two input sequences...
%run report_diff_between_two_seq_strings.py GAATTCA GATTTCGAGA
5
Reporting amount of differences...
%run report_diff_between_two_seq_strings.py GAAGGTTCACCCC GATTGGTCGACCCCGA
8
Reporting amount of differences...
%run report_diff_between_two_seq_strings.py GAAGGTTCACCCC GATTGGTCGACCCCGA --report_len_diff
8 3
Reporting amount of differences and difference in length of the two input sequences...
%run report_diff_between_two_seq_strings.py GAAGGTTCACCCC GATTGGTCGACCCCGA --report_len_diff --report_alignment
8 3 Alignments displaying 8 differences: -GAAGGTTCACCCC-- -XXX|||XX|||||-- GATTGGTCGACCCCGA GAAGGTTCACCCC--- ||XX|X||XX|||--- GATTGGTCGACCCCGA
Reporting amount of differences and difference in length of the two input sequences... Reporting alignments with 8 differences...
%run report_diff_between_two_seq_strings.py GAATTCA GATTTCGAGA --report_alignment
5 Alignment displaying 5 differences: GAATTCA--- ||X|||X--- GATTTCGAGA
Reporting amount of differences... Reporting alignment with 5 differences...
Intended for use in Jupyter/IPython environments primarily.
from report_diff_between_two_seq_strings import report_diff_between_two_seq_strings
diffs = report_diff_between_two_seq_strings("GAATTC","GATTTC ")
diffs
(1,)
from report_diff_between_two_seq_strings import report_diff_between_two_seq_strings
diffs = report_diff_between_two_seq_strings("GAATTCA","GATTTCGAGA ",report_len_diff = True)
print("number of differences:",diffs[0])
print("difference in size of unaligned:",diffs[1])
number of differences: 5 difference in size of unaligned: 4
from report_diff_between_two_seq_strings import report_diff_between_two_seq_strings
diffs = report_diff_between_two_seq_strings("GAAGGTTCACCCC","GATTGGTCGACCCCGA",report_len_diff = True, report_alignment = True)
print("number of differences:",diffs[0])
print("difference in size of unaligned:",diffs[1])
print("Alignments:")
for x in diffs[2]:
print(x)
number of differences: 8 difference in size of unaligned: 3 Alignments: -GAAGGTTCACCCC-- -XXX|||XX|||||-- GATTGGTCGACCCCGA GAAGGTTCACCCC--- ||XX|X||XX|||--- GATTGGTCGACCCCGA
from report_diff_between_two_seq_strings import report_diff_between_two_seq_strings
diffs = report_diff_between_two_seq_strings("GAAGGTTCACCCC","GATTGGTCGACCCCGA", report_alignment = True)
print("number of differences:",diffs[0])
print("Alignments:")
for x in diffs[1]:
print(x)
number of differences: 8 Alignments: -GAAGGTTCACCCC-- -XXX|||XX|||||-- GATTGGTCGACCCCGA GAAGGTTCACCCC--- ||XX|X||XX|||--- GATTGGTCGACCCCGA
import time
def executeSomething():
#code here
print ('.')
time.sleep(480) #60 seconds times 8 minutes
while True:
executeSomething()
.