This file contains hidden or 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
import re | |
DNA = input('Please enter your DNA sequence...').upper() | |
while re.search('[^AGCT]', DNA): | |
exit("DNA sequence entered is not valid") |
This file contains hidden or 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
DNA = input('Please enter your DNA sequence...') |
This file contains hidden or 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
import re | |
DNA = input('Please enter your DNA sequence...').upper() | |
while re.search('[^AGCT]', DNA): | |
DNA = input('Please enter a valid DNA sequence...').upper() |
This file contains hidden or 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
import sys | |
pattern = sys.argv[1].upper() | |
pattern2 = sys.argv[2].upper() | |
count_no = int(sys.argv[3]) |
This file contains hidden or 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
import re | |
import sys | |
# DNA = input('Please enter your DNA sequence...').upper() | |
# while re.search('[^AGCT]', DNA): | |
# DNA = input('Please enter a valid DNA sequence...').upper() | |
DNA = open('E.coli_genome.fasta').read() | |
pattern = sys.argv[1].upper() | |
pattern2 = sys.argv[2].upper() |
This file contains hidden or 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
import argparse | |
parser = argparse.ArgumentParser(description='Finding restriction sites in DNA sequences') |
This file contains hidden or 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
parser.add_argument('input_filename') | |
args = parser.parse_args() |
This file contains hidden or 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
DNA = open(args.input_filename).read().rstrip('\n') |
This file contains hidden or 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
parser.add_argument('pattern', | |
help='Enter the pattern of the restriction enzyme') | |
parser.add_argument('count_no', | |
help='count number to be specified') | |
parser.add_argument('input-filename', | |
help='Enter the name of your DNA sequence') | |
args = parser.parse_args() |
This file contains hidden or 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
parser.add_argument("-i", | |
"--input_filename", | |
help='Enter the name of your DNA sequence') |