Skip to content

Instantly share code, notes, and snippets.

BLASTN 2.7.1+
Reference: Zheng Zhang, Scott Schwartz, Lukas Wagner, and Webb
Miller (2000), "A greedy algorithm for aligning DNA sequences", J
Comput Biol 2000; 7(1-2):203-14.
Database: cad_res_partial
from django.conf import settings
from demoapp import models
def RequestExposerMiddleware(get_response):
def middleware(request):
models.exposed_request = request
response = get_response(request)
return response
return middleware
cycler==0.10.0
Django==2.0.1
django-cors-headers==2.1.0
django-extensions==1.9.9
imutils==0.4.5
matplotlib==2.1.2
numpy==1.13.3
opencv-python==3.3.1.11
pandas==0.22.0
Pillow==5.0.0
library("seqinr")
getncbiseq <- function(accession)
{
require("seqinr") # this function requires the SeqinR R package
# first find which ACNUC database the accession is stored in:
dbs <- c("genbank","refseq","refseqViruses","bacterial")
numdbs <- length(dbs)
for (i in 1:numdbs)
{
db <- dbs[i]
findcommunities <- function(mygraph,minsize)
{
# Function to find network communities in a graph
# Load up the igraph library:
require("igraph")
# Set the counter for the number of communities:
cnt <- 0
# First find the connected components in the graph:
myconnectedcomponents <- connectedComp(mygraph)
# For each connected component, find the communities within that connected component:
with tf.Session() as sess:
sess.run(tf.global_variables_initializer())
for epoch in range(n_epochs):
train_data_batch_gen = get_train_data_batch(batch_size)
epoch_loss = 0
i=0
while i < total_lines:
train_x, train_y = next(train_data_batch_gen)
batch_x = np.array(train_x)
def get_train_data_batch(n):
features = []
with open('data.csv') as f:
count=0
for line in f:
splitted = line.split(';')
featureset = [int(float(x)) for x in splitted[:len(splitted)-1]]
label = int(float(splitted[-1].rstrip()))
count+=1
if count % n==0:
with tf.Session() as sess:
sess.run(tf.global_variables_initializer())
for epoch in range(n_epochs):
epoch_loss = 0
i=0
while i < len(train_x):
start = i
end = i+batch_size
batch_x = np.array(train_x[start:end])
@Ruhshan
Ruhshan / aa_comp.R
Created November 9, 2017 18:00
read a fasta file and gets amino acid composition for all proteins then writes to csv
library(Peptides)
library(seqinr)
get_comp <- function(fasta){
s=getSequence(fasta, as.string = TRUE);
sname=getName(fasta);
comp = aaComp(s);
r<-c(name=sname,
{"test_name":"TCHO","level_1_lower_range":10,"level_1_upper_range":20,"level_2_lower_range":20,"level_2_upper_range":30,"level_3_lower_range":30,"level_3_upper_range":40}