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
#This code assumes that scripts are kept in bin file and all other folders are within bin | |
import os | |
import random | |
def makeBlastDB(title, inputFilePath, out): #makes local blast database | |
blastCommand = "makeblastdb -dbtype nucl -in {} -title {} -out {}".format(inputFilePath, title, out) | |
print(blastCommand) | |
os.system(blastCommand) |
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 openpyxl | |
wb = openpyxl.load_workbook('Buzz.xlsx') | |
sheets = wb.sheetnames | |
names = [] | |
emails = [] | |
for i in sheets: #loops through 4 sheets in the file | |
current = wb[i] |
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 os | |
a,b,c,d = 0,0,0,0 | |
with open("commands.txt", "w") as list: | |
command = "bowtie2 -x V1V1Index -r LTRCon.txt -a -S test.sam --non-deterministic -p 4" | |
os.system(command) | |
print("command executed") | |
os.system("samtools view test.sam | wc -l > commandsNums.txt") |
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 java.io.*; | |
import java.util.*; | |
public class Text { | |
private ArrayList<String> words = new ArrayList<String>(); | |
private ArrayList<String> dictionary; | |
public Text() { //default contructor |
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 requests | |
from bs4 import * | |
url = 'https://www.cattle-exchange.com/' | |
req = requests.get(url) | |
homePage = BeautifulSoup(req.text, 'html.parser') | |
breeds = (homePage.find("ul", {"class" : "views-summary"})).contents | |
extensions = [] |
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
# script to plot the locations and number of LTR predictions for repens | |
# genome scaffolds. Previously thought that only scaffolds where present but | |
# some of the entries are labeled as chromosomes. Additionally, LTR elements | |
# almost exclusively predicted in the chromosome regions. chromosome predictably | |
# much longer than any single scaffold, not sure if they are seperate / unique | |
# from all scaffold sequences. | |
import csv | |
import matplotlib.pyplot as plt |
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
lines = [] | |
f_set = set([]) | |
with open('NATIONAL_FACILITY_FILE.CSV') as big: | |
for i, row in enumerate(big): | |
s = row.split(',') | |
if len(s) >= 7: | |
if s[6] == '"COOK"': | |
lines.append(row) | |
f_set.add(s[1]) |
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
lines = [] | |
f_set = set([]) | |
with open('NATIONAL_FACILITY_FILE.CSV') as big: | |
for i, row in enumerate(big): | |
s = row.split(',') | |
if len(s) >= 10: | |
if s[6] == '"COOK"' and s[9] == '"ILLINOIS"': | |
lines.append(row) |
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
def subset_sum(l, k): # l = list values, k is subset sum | |
l = sorted(l, reverse=True) | |
subset = set([]) | |
for i in l: | |
if k >= i and i not in subset: | |
k-= i | |
subset.add(i) | |
if k == 0: | |
break | |
return subset |
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 csv | |
GENES = set(['PML', 'OAS2', 'OASL', 'IRF7', 'OAS1', 'OAS3', 'BTBD1', 'BTBD2', 'IRF3', 'GBP1']) | |
# set of target genes | |
CGI = '' # G2R file path here | |
OUT = '' # output directory here | |
def find_genes(): | |
results = {} | |
with open(CGI) as C: |
OlderNewer