Skip to content

Instantly share code, notes, and snippets.

View Vini2's full-sized avatar
🧬
Focusing

Vijini Mallawaarachchi Vini2

🧬
Focusing
View GitHub Profile
-- 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;
@Vini2
Vini2 / getdata.py
Created March 1, 2020 09:09
Pulling twitter data
import tweepy as tw
import pandas as pd
import json
# App Auth
consumer_key = 'XXX'
consumer_secret = 'XXX'
access_key = 'XXX'
access_secret = 'XXX'
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;
# 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")
# 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"}
# 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
# 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",
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,
@Vini2
Vini2 / Visualise_Graph_Demo.ipynb
Last active September 23, 2021 07:47
Visualising Graph Data with python-igraph
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# 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",