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
# Read the file and get the DNA string | |
file = open('sample_dna.txt', 'r') | |
dna = file.read() | |
print "DNA Sequence: ", dna | |
# DNA codon table | |
protein = {"TTT" : "F", "CTT" : "L", "ATT" : "I", "GTT" : "V", | |
"TTC" : "F", "CTC" : "L", "ATC" : "I", "GTC" : "V", | |
"TTA" : "L", "CTA" : "L", "ATA" : "I", "GTA" : "V", |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
import argparse | |
import scipy.special | |
import csv | |
parser = argparse.ArgumentParser(description="""Evaluate clustering results. This scripts will return the | |
precision, recall, F1-score and ARI of the provided clustering result""") | |
parser.add_argument("--clustered", | |
required=True, | |
type=str, |
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
# Read the file and get the RNA string | |
file = open('sample_rna.txt', 'r') | |
rna = file.read() | |
print "RNA String: ", rna | |
# RNA codon table | |
rna_codon = {"UUU" : "F", "CUU" : "L", "AUU" : "I", "GUU" : "V", | |
"UUC" : "F", "CUC" : "L", "AUC" : "I", "GUC" : "V", | |
"UUA" : "L", "CUA" : "L", "AUA" : "I", "GUA" : "V", |
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
# Read the file and get the DNA string | |
file = open('sample_dna.txt', 'r') | |
dna = file.read() | |
print "DNA: ", dna | |
rna = "" | |
# Generate the RNA string | |
for i in dna: | |
# Replace all occurrences of T with U |
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
# Read the file and get the DNA string | |
file = open("sample_dna.txt", "r") | |
dna = file.read() | |
# Print the original DNA string | |
print "DNA String: ", dna | |
# Create dictionary of complementing nucleobase pairs | |
comp_pairs = {"A" : "T", "T" : "A", "G" : "C", "C" : "G"} |
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
# Read the file and get the DNA string | |
file = open('sample_dna.txt', 'r') | |
dna = file.read() | |
# Print the original DNA string | |
print "DNA String: ", dna | |
# Print the count of each letter | |
print "Count of A: ", dna.count("A") | |
print "Count of C: ", dna.count("C") |
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
class Individual { | |
int fitness = 0; | |
int geneLength = 5; | |
int[] genes = new int[5]; | |
public Individual() { | |
Random rn = new Random(); | |
//Set genes randomly for each individual | |
for (int i = 0; i < geneLength; i++) { | |
genes[i] = rn.nextInt() % 2; |
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
import tweepy as tw | |
import pandas as pd | |
import json | |
# App Auth | |
consumer_key = 'XXX' | |
consumer_secret = 'XXX' | |
access_key = 'XXX' | |
access_secret = 'XXX' |
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
-- Projection example | |
SELECT DISTINCT member_id FROM borrow; | |
SELECT DISTINCT member_id,book_id FROM borrow; | |
-- Selection example | |
SELECT * FROM member WHERE date_of_birth='1997-10-21'; | |
-- Rename example | |
WITH library_member AS (SELECT * FROM member) SELECT * FROM library_member; |